0

我已经使用 Jboss 6 在 EJB 3.0 中创建了一个 helloworld 应用程序,如下面的链接所示

http://theopentutorials.com/examples/java-ee/ejb3/how-to-create-a-simple-ejb3-project-in-eclipse-jboss-6-1/

现在我遇到了异常,我已经做了很多关于它的 rnd 但我找不到它,因为我是 EJB 新手,请帮忙。

log4j:WARN 找不到记录器 (org.jnp.interfaces.TimedSocketFactory) 的附加程序。log4j:WARN 请正确初始化 log4j 系统。log4j:WARN 有关详细信息,请参阅http://logging.apache.org/log4j/1.2/faq.html#noconfig

* javax.naming.CommunicationException:无法获得与以下任何 url 的连接:localhost:1099 并且发现失败并出现错误:javax.naming.CommunicationException:接收超时 [根异常是 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 [根异常是
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 [根异常是 javax.naming.ServiceUnavailableException:无法连接到服务器 localhost/127.0.0.1:1099 [根异常是 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:连接被拒绝:连接] at 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

com.ibytecode.client.EJBApplicationClient.main(EJBApplicationClient.java:12) 处的线程“主”java.lang.NullPointerException 中的异常

4

1 回答 1

0

您在 EJBApplicationClient.java:12 有一个 Nullpointer

于 2015-05-11T14:43:12.963 回答