aspose file tools*
The moose likes JBoss/WildFly and the fly likes Simple EJB3 session beans not deploying in JBOSS6 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Simple EJB3 session beans not deploying in JBOSS6" Watch "Simple EJB3 session beans not deploying in JBOSS6" New topic
Author

Simple EJB3 session beans not deploying in JBOSS6

Ravi Kumar Onteru
Greenhorn

Joined: Nov 10, 2009
Posts: 5
Hi,

I am newbie to EJB3 and started my first example with JBOSS6 installed in my machine.

I am able to run the server and When i deploy the ejb jar file into "%JBOSS_HOME%\server\default\deploy\" directory, it is not showing any message saying that the bean or the application has been deployed.

Also when i am trying to access the same with standalone client, it is throwing the following Exception...
i would appriciate any help in resolving this issue.

D:\EJB3Dev\simple-ejb\src>java -cp %JBOSS_HOME%\client\jbossall-client.jar;.\..\classes;. example.ClientEjb
about to lookup the JNDI name:java:comp/env/ejb/HelloWorldBean
log4j:WARN No appenders could be found for logger (org.jnp.interfaces.TimedSocketFactory).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" javax.naming.NameNotFoundException: comp not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
at org.jnp.server.NamingServer.lookup(NamingServer.java:396)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
at sun.rmi.transport.Transport$1.run(Transport.java:159)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)
at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:728)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:688)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at example.ClientEjb.main(ClientEjb.java:14)



Also here is my jndi.properties file in the "D:\EJB3Dev\simple-ejb\src" directory.
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.factory.url.pkgs=org.jboss.namingrg.jnp.interfaces
java.naming.provider.url=localhost:1099


Thanks & Regards,
Ravi


Ravi Kumar Onteru
SCJP1.4, SCWCD1.4
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9343
    
111

When i deploy the ejb jar file into "%JBOSS_HOME%\server\default\deploy\" directory, it is not showing any message saying that the bean or the application has been deployed.


What does that jar contain? Post the output of:




[My Blog] [JavaRanch Journal]
Sunny Bhandari
Ranch Hand

Joined: Dec 06, 2010
Posts: 448

if you could post the code of EJB and the client...


Java Experience
Ravi Kumar Onteru
Greenhorn

Joined: Nov 10, 2009
Posts: 5
Hi,

Here is the contents of the .jar file

C:\jboss-6.0.0\server\default\deploy>jar -tf HelloWorldEjb.jar
META-INF/
META-INF/MANIFEST.MF
../classes/example/HelloWorldInt.class
../classes/example/HelloWorldBean.class


And the Code is here

Business Interface:



Bean Class:



Standalone Client to access EJB




Regards,
Ravi
Ravi Kumar Onteru
Greenhorn

Joined: Nov 10, 2009
Posts: 5
Hi,

Here is the client code i have tried.






Regards,
Ravi
Ravi Kumar Onteru
Greenhorn

Joined: Nov 10, 2009
Posts: 5
Hi,

The contents of the JAR seems to be invalid. And thanks for pointing me to the contents of the jar. I have re-created the jar file that contains the following contents:
C:\jboss-6.0.0\server\default\deploy>jar -tf HelloWorldEjb.jar
META-INF/
META-INF/MANIFEST.MF
example/HelloWorldBean.class
example/HelloWorldInt.class

After this trail, the JBOSS6 server is responding with a message that it has considered the jar for deployment as follows:

HelloWorldBean/remote - EJB3.x Default Remote Business Interface
HelloWorldBean/remote-example.HelloWorldInt - EJB3.x Remote Business Interface

18:22:20,437 WARN [org.jboss.ejb3.TimerServiceContainer] EJBTHREE-2193: using deprecated TimerServiceFactory for restoring timers


But still, when i am trying to run the client code, it is throwing the following exception:

[color=darkred]D:\EJB3Dev\simple-ejb\classes>java -cp %JBOSS_HOME%\client\jbossall-client.jar;. example.ClientEjb
about to lookup the JNDI name:java:comp/env/ejb/HelloWorldBean
log4j:WARN No appenders could be found for logger (org.jnp.interfaces.TimedSocketFactory).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" javax.naming.NameNotFoundException: comp not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
at org.jnp.server.NamingServer.lookup(NamingServer.java:396)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
at sun.rmi.transport.Transport$1.run(Transport.java:159)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)
at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:728)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:688)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at example.ClientEjb.main(ClientEjb.java:14)
[/color]

Please help in resolving the same.

Regards,
Ravi
Ravi Kumar Onteru
Greenhorn

Joined: Nov 10, 2009
Posts: 5
Hi,

Thanks for all your focus on the problem. The problem is resolved now. There were two issues.

The first problem was that, the contents of the jar file was invalid. It has the top level directories also.
For jndi.properties, was not accessible in the classpath, some how.

Both of these problems have been resolved and my first bean started working.

Thanks & Regards,
Ravi
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9343
    
111

Glad to know you got it working!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Simple EJB3 session beans not deploying in JBOSS6
 
Similar Threads
JNDI Name binding in JBOSS 5.1.0 Beta.
Does jboss bind to 0.0.0.0 on a non-clustered server ?
need help on log4j.properties
Error: javax.naming.NameNotFoundException: SignOn not bound
Problem deploying sample HelloWorld Bean in JBoss 4.2.1 GA