//接上面的
//----------------------------------------------------------------------------
// Methods that use Home interface methods to generate a Remote interface reference
//---------------------------------------------------------------------------- public SessionBean1 create()
{
long startTime = 0;
if (logging)
{
log("Calling create()");
startTime = System.currentTimeMillis();
}
try
{
sessionBean1 = sessionBean1Home.create();
if (logging)
{
long endTime = System.currentTimeMillis();
log("Succeeded: create()");
log("Execution time: " + (endTime - startTime) + " ms.");
}
}
catch (Exception e)
{
if (logging)
{
log("Failed: create()");
}
e.printStackTrace();
} if (logging)
{
log("Return value from create(): " + sessionBean1 + ".");
}
return sessionBean1;
} public EJBMetaData getEJBMetaData()
{
EJBMetaData returnValue = null; long startTime = 0;
if (logging)
{
log("Calling getEJBMetaData()");
startTime = System.currentTimeMillis();
} try
{
returnValue = sessionBean1Home.getEJBMetaData();
if (logging)
{
long endTime = System.currentTimeMillis();
log("Succeeded: getEJBMetaData()");
log("Execution time: " + (endTime - startTime) + " ms.");
}
}
catch (Exception e)
{
if (logging)
{
log("Failed: getEJBMetaData()");
}
e.printStackTrace();
} if (logging)
{
log("Return value from getEJBMetaData(): " + returnValue + ".");
}
return returnValue;
} public HomeHandle getHomeHandle()
{
HomeHandle returnValue = null; long startTime = 0;
if (logging)
{
log("Calling getHomeHandle()");
startTime = System.currentTimeMillis();
} try
{
returnValue = sessionBean1Home.getHomeHandle();
if (logging)
{
long endTime = System.currentTimeMillis();
log("Succeeded: getHomeHandle()");
log("Execution time: " + (endTime - startTime) + " ms.");
}
}
catch (Exception e)
{
if (logging)
{
log("Failed: getHomeHandle()");
}
e.printStackTrace();
} if (logging)
{
log("Return value from getHomeHandle(): " + returnValue + ".");
}
return returnValue;
} public void remove(Object p0)
{
long startTime = 0;
if (logging)
{
log("Calling remove(" + p0 + ")");
startTime = System.currentTimeMillis();
} try
{
sessionBean1Home.remove(p0);
if (logging)
{
long endTime = System.currentTimeMillis();
log("Succeeded: remove(" + p0 + ")");
log("Execution time: " + (endTime - startTime) + " ms.");
}
}
catch (Exception e)
{
if (logging)
{
log("Failed: remove(" + p0 + ")");
}
e.printStackTrace();
}
} public void remove(Handle p0)
{
long startTime = 0;
if (logging)
{
log("Calling remove(" + p0 + ")");
startTime = System.currentTimeMillis();
} try
{
sessionBean1Home.remove(p0);
if (logging)
{
long endTime = System.currentTimeMillis();
log("Succeeded: remove(" + p0 + ")");
log("Execution time: " + (endTime - startTime) + " ms.");
}
}
catch (Exception e)
{
if (logging)
{
log("Failed: remove(" + p0 + ")");
}
e.printStackTrace();
}
} //----------------------------------------------------------------------------
// Methods that use Remote interface methods to access data through the bean
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// Utility Methods
//---------------------------------------------------------------------------- private void log(String message)
{
if (message == null)
{
System.out.println("-- null");
return;
}
if (message.length() > MAX_OUTPUT_LINE_LENGTH)
{
System.out.println("-- " +
message.substring(0, MAX_OUTPUT_LINE_LENGTH) +
" ...");
}
else
{
System.out.println("-- " + message);
}
} //Main method public static void main(String[] args)
{
SessionBean1TestClient1 client = new SessionBean1TestClient1();
// Use the client object to call one of the Home interface wrappers
// above, to create a Remote interface reference to the bean.
// If the return value is of the Remote interface type, you can use it
// to access the remote interface methods. You can also just use the
// client object to call the Remote interface wrappers.
}
}
//----------------------------------------------------------------------------
// Methods that use Home interface methods to generate a Remote interface reference
//---------------------------------------------------------------------------- public SessionBean1 create()
{
long startTime = 0;
if (logging)
{
log("Calling create()");
startTime = System.currentTimeMillis();
}
try
{
sessionBean1 = sessionBean1Home.create();
if (logging)
{
long endTime = System.currentTimeMillis();
log("Succeeded: create()");
log("Execution time: " + (endTime - startTime) + " ms.");
}
}
catch (Exception e)
{
if (logging)
{
log("Failed: create()");
}
e.printStackTrace();
} if (logging)
{
log("Return value from create(): " + sessionBean1 + ".");
}
return sessionBean1;
} public EJBMetaData getEJBMetaData()
{
EJBMetaData returnValue = null; long startTime = 0;
if (logging)
{
log("Calling getEJBMetaData()");
startTime = System.currentTimeMillis();
} try
{
returnValue = sessionBean1Home.getEJBMetaData();
if (logging)
{
long endTime = System.currentTimeMillis();
log("Succeeded: getEJBMetaData()");
log("Execution time: " + (endTime - startTime) + " ms.");
}
}
catch (Exception e)
{
if (logging)
{
log("Failed: getEJBMetaData()");
}
e.printStackTrace();
} if (logging)
{
log("Return value from getEJBMetaData(): " + returnValue + ".");
}
return returnValue;
} public HomeHandle getHomeHandle()
{
HomeHandle returnValue = null; long startTime = 0;
if (logging)
{
log("Calling getHomeHandle()");
startTime = System.currentTimeMillis();
} try
{
returnValue = sessionBean1Home.getHomeHandle();
if (logging)
{
long endTime = System.currentTimeMillis();
log("Succeeded: getHomeHandle()");
log("Execution time: " + (endTime - startTime) + " ms.");
}
}
catch (Exception e)
{
if (logging)
{
log("Failed: getHomeHandle()");
}
e.printStackTrace();
} if (logging)
{
log("Return value from getHomeHandle(): " + returnValue + ".");
}
return returnValue;
} public void remove(Object p0)
{
long startTime = 0;
if (logging)
{
log("Calling remove(" + p0 + ")");
startTime = System.currentTimeMillis();
} try
{
sessionBean1Home.remove(p0);
if (logging)
{
long endTime = System.currentTimeMillis();
log("Succeeded: remove(" + p0 + ")");
log("Execution time: " + (endTime - startTime) + " ms.");
}
}
catch (Exception e)
{
if (logging)
{
log("Failed: remove(" + p0 + ")");
}
e.printStackTrace();
}
} public void remove(Handle p0)
{
long startTime = 0;
if (logging)
{
log("Calling remove(" + p0 + ")");
startTime = System.currentTimeMillis();
} try
{
sessionBean1Home.remove(p0);
if (logging)
{
long endTime = System.currentTimeMillis();
log("Succeeded: remove(" + p0 + ")");
log("Execution time: " + (endTime - startTime) + " ms.");
}
}
catch (Exception e)
{
if (logging)
{
log("Failed: remove(" + p0 + ")");
}
e.printStackTrace();
}
} //----------------------------------------------------------------------------
// Methods that use Remote interface methods to access data through the bean
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// Utility Methods
//---------------------------------------------------------------------------- private void log(String message)
{
if (message == null)
{
System.out.println("-- null");
return;
}
if (message.length() > MAX_OUTPUT_LINE_LENGTH)
{
System.out.println("-- " +
message.substring(0, MAX_OUTPUT_LINE_LENGTH) +
" ...");
}
else
{
System.out.println("-- " + message);
}
} //Main method public static void main(String[] args)
{
SessionBean1TestClient1 client = new SessionBean1TestClient1();
// Use the client object to call one of the Home interface wrappers
// above, to create a Remote interface reference to the bean.
// If the return value is of the Remote interface type, you can use it
// to access the remote interface methods. You can also just use the
// client object to call the Remote interface wrappers.
}
}
解决方案 »
- 想实现jsp页面提示效果谁给指点一下 代码详细一点
- 关于孙卫琴《精通Struts基于MVC的java web设计与开发》中的一点疑问
- hibernate saveObject 时出现问题,急
- DispatchAction 与 validation 的问题!
- 请问如何设计该hibernate的Entity对象
- 第一个JSP!求救!
- 实体bean之间的关系描述符中的cmr field 是如何实现两个表之间的关系的!高分相送!
- 关于WebService。急!!!马上给分!!!!
- 高分寻求XML文比较工具
- 部署 ejb 的时候出现的提示信息 但程序仍然运行正常 它说明了什么呢...
- jbuilderX怎么配置struts?
- (SOS)VB调用Java所写WebServices服务端,当方法是复杂类型是怎么处理,不会的兄弟也来看看up一下吧.分不够再加?
D:\JBuilderX\jdk1.4\bin\javaw -classpath "E:\CODE\WEB\EJB2\classes;D:\jboss-3.2.5\client\concurrent.jar;D:\jboss-3.2.5\client\gnu-regexp.jar;D:\jboss-3.2.5\client\jacorb.jar;D:\jboss-3.2.5\client\jbossall-client.jar;D:\jboss-3.2.5\client\jboss-client.jar;D:\jboss-3.2.5\client\jboss-common-client.jar;D:\jboss-3.2.5\client\jbossha-client.jar;D:\jboss-3.2.5\client\jboss-iiop-client.jar;D:\jboss-3.2.5\client\jboss-j2ee.jar;D:\jboss-3.2.5\client\jboss-jaas.jar;D:\jboss-3.2.5\client\jbossjmx-ant.jar;D:\jboss-3.2.5\client\jbossmq-client.jar;D:\jboss-3.2.5\client\jbossmqha.jar;D:\jboss-3.2.5\client\jboss-net-client.jar;D:\jboss-3.2.5\client\jbosssx-client.jar;D:\jboss-3.2.5\client\jboss-system-client.jar;D:\jboss-3.2.5\client\jcert.jar;D:\jboss-3.2.5\client\jmx-connector-client-factory.jar;D:\jboss-3.2.5\client\jmx-ejb-connector-client.jar;D:\jboss-3.2.5\client\jmx-rmi-connector-client.jar;D:\jboss-3.2.5\client\jnet.jar;D:\jboss-3.2.5\client\jnp-client.jar;D:\jboss-3.2.5\client\jsse.jar;D:\jboss-3.2.5\client\log4j.jar;D:\JBuilderX\lib\j2ee.jar;D:\JBuilderX\jdk1.4\demo\jfc\Java2D\Java2Demo.jar;D:\JBuilderX\jdk1.4\demo\plugin\jfc\Java2D\Java2Demo.jar;D:\JBuilderX\jdk1.4\jre\javaws\javaws.jar;D:\JBuilderX\jdk1.4\jre\lib\charsets.jar;D:\JBuilderX\jdk1.4\jre\lib\ext\dnsns.jar;D:\JBuilderX\jdk1.4\jre\lib\ext\ldapsec.jar;D:\JBuilderX\jdk1.4\jre\lib\ext\localedata.jar;D:\JBuilderX\jdk1.4\jre\lib\ext\sunjce_provider.jar;D:\JBuilderX\jdk1.4\jre\lib\im\indicim.jar;D:\JBuilderX\jdk1.4\jre\lib\im\thaiim.jar;D:\JBuilderX\jdk1.4\jre\lib\jce.jar;D:\JBuilderX\jdk1.4\jre\lib\jsse.jar;D:\JBuilderX\jdk1.4\jre\lib\plugin.jar;D:\JBuilderX\jdk1.4\jre\lib\rt.jar;D:\JBuilderX\jdk1.4\jre\lib\sunrsasign.jar;D:\JBuilderX\jdk1.4\lib\dt.jar;D:\JBuilderX\jdk1.4\lib\htmlconverter.jar;D:\JBuilderX\jdk1.4\lib\tools.jar" ejb2.SessionBean1TestClient1
-- Initializing bean access.log4j:WARN No appenders could be found for logger (org.jnp.interfaces.NamingContext).log4j:WARN Please initialize the log4j system properly.javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1119) at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1196) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:516)-- Failed initializing bean access. at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:509) at javax.naming.InitialContext.lookup(InitialContext.java:347) at ejb2.SessionBean1TestClient1.initialize(SessionBean1TestClient1.java:49) at ejb2.SessionBean1TestClient1.<init>(SessionBean1TestClient1.java:31) at ejb2.SessionBean1TestClient1.main(SessionBean1TestClient1.java:288)Caused by: java.net.SocketTimeoutException: Receive timed out at java.net.PlainDatagramSocketImpl.receive(Native Method) at java.net.DatagramSocket.receive(DatagramSocket.java:711) at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1089) ... 7 more
试试网络通吗