[jboss-user] [EJB3] - JBoss 6/EJB 3.1 - Lookup from client app under Tomcat
Armen Arzumanyan
do-not-reply at jboss.com
Thu May 26 09:23:06 EDT 2011
Armen Arzumanyan [http://community.jboss.org/people/armdev] created the discussion
"JBoss 6/EJB 3.1 - Lookup from client app under Tomcat"
To view the discussion, visit: http://community.jboss.org/message/607224#607224
--------------------------------------------------------------
HI All, I start usiing JBoss 6 and have the first big problem.
Could not lookup EJB 3.1 bean from client application what work undet Tomcat.
Previous times I added jbossall-client.jar to my web app libraries and all was ok.
But now I do the same but can not lookup, Also jbossall-client.jar in JBoss 6 too small.
Here is a standart code for lookup
static void testFacade() {
InitialContext context = null;
Properties props = new Properties();
props.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
props.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
props.setProperty("java.naming.provider.url", "jnp://localhost:1099");
try {
context = new InitialContext(props);
UserFacadeRemote manager = (UserFacadeRemote) context.lookup("realty/UserFacade/remote");
Object ob = context.getNameInNamespace();
manager.businessMethod();
} catch (Exception e) {
System.out.println(e);
}
}
Here isa exception
javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory]
Please help, if someone already fix this problem pls reply.
Best Regards,
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/607224#607224]
Start a new discussion in EJB3 at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2029]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110526/21ad6798/attachment.html
More information about the jboss-user
mailing list