我在EJB 3.0中使用Jboss 6创建了一个helloworld应用程序,如下面的链接
所示现在我得到了以下异常我已经做了很多关于它的事情但是我无法找到它,因为我是EJB的新手,请帮忙。
log4j:WARN找不到logger(org.jnp.interfaces.TimedSocketFactory)的appender。 log4j:WARN请正确初始化log4j系统。 log4j:WARN有关详细信息,请参阅http://logging.apache.org/log4j/1.2/faq.html#noconfig。
* javax.naming.CommunicationException:无法获取任何这些URL的连接:localhost:1099并且发现失败并显示错误:javax.naming.CommunicationException:接收超时[root异常是java。 net.SocketTimeoutException:接收超时] * 在org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1690)
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1761)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:695)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:688)
at javax.naming.InitialContext.lookup(Unknown Source)
at com.ibytecode.client.EJBApplicationClient.doLookup(EJBApplicationClient.java:22)
at com.ibytecode.client.EJBApplicationClient.main(EJBApplicationClient.java:10)
Caused by: java.net.SocketTimeoutException: Receive timed out
at java.net.TwoStacksPlainDatagramSocketImpl.receive0(Native Method)
at java.net.TwoStacksPlainDatagramSocketImpl.receive(Unknown Source)
at java.net.DatagramSocket.receive(Unknown Source)
at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1659)
... 6 more
[Root exception is javax.naming.CommunicationException: Failed to connect to server
localhost / 127.0.0.1:1099 [根异常是javax.naming.ServiceUnavailableException:
无法连接到服务器localhost / 127.0.0.1:1099 [root例外是
java.net.ConnectException:连接被拒绝:连接]]]
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1780)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:695)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:688)
at javax.naming.InitialContext.lookup(Unknown Source)
at com.ibytecode.client.EJBApplicationClient.doLookup(EJBApplicationClient.java:22)
at com.ibytecode.client.EJBApplicationClient.main(EJBApplicationClient.java:10)
引起:javax.naming.CommunicationException:无法连接到服务器localhost / 127.0.0.1:1099 [root异常是javax.naming.ServiceUnavailableException:无法连接到服务器localhost / 127.0.0.1:1099 [Root exception is java.net.ConnectException:连接被拒绝:连接]]
at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:337)
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1746)
... 5 more
引起:javax.naming.ServiceUnavailableException:无法连接到服务器localhost / 127.0.0.1:1099 [根异常是java.net.ConnectException:连接被拒绝:连接] 在org.jnp.interfaces.NamingContext.getServer(NamingContext.java:307) ......还有6个
引起:java.net.ConnectException:连接被拒绝:连接
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:97)
at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:82)
at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:303)
... 6 more
线程“main”java.lang.NullPointerException中的异常 在com.ibytecode.client.EJBApplicationClient.main(EJBApplicationClient.java:12)
答案 0 :(得分:0)
你在EJBApplicationClient.java:12
有一个Nullpointer