This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes JBoss/WildFly and the fly likes Can't call ejb 3.1 form app client project in jboss 6.0 final Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Can Watch "Can New topic
Author

Can't call ejb 3.1 form app client project in jboss 6.0 final

Jose Alvarez de Lara
Ranch Hand

Joined: May 10, 2008
Posts: 92
Hi,

I am trying to call an EJB 3.1 from a client project. If I use DI I get
a java.lang.NullPointerException,



On the other hand I can use JNDI as follows,



In this case I get a NamingException

In both cases the try-catch block is needed because publishNews() throws Exception.

The environment is formed for JBoss 6.0 Final integrated into Eclipse Helios SR1.

Please, witch is the solution?

Thanks in advance,
Jose
Jose Alvarez de Lara
Ranch Hand

Joined: May 10, 2008
Posts: 92
Hi

Here is my client,



And this is the exception I am getting now,


09-mar-2011 19:24:12 client.Main getContext
INFO: using server0\client-jndi.properties for jndi
log4j:WARN No appenders could be found for logger (org.jnp.interfaces.TimedSocketFactory).
log4j:WARN Please initialize the log4j system properly.
java.lang.NullPointerExceptionl
at client.Main.test(Main.java:36)
at client.Main.main(Main.java:21)


Please, help!!!

Kind regards,
Jose
Jose Alvarez de Lara
Ranch Hand

Joined: May 10, 2008
Posts: 92
Sorry,

I forgot to post the server0/client-jndi.properties file.

Here it is,



Thanks,
Jose
Jose Alvarez de Lara
Ranch Hand

Joined: May 10, 2008
Posts: 92
Hi,

I am basing my code in the information that EJB3.1 in AS 6.0.0.M2
from JBoss Community.

Please, help.

Jose
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Can't call ejb 3.1 form app client project in jboss 6.0 final