hi all,

i'm developing an application under JBoss 5.0.0 with EJB3.
I'm using stateful EJBs, what works really fine inside the AS (i'm calling them 
from a deployed web-app).
All JNDI lookups from the webapp do return Proxy-interfaces as expected.

I also try to get my EJBs from an J2SE-client.
But here i get only references to "javax.naming.Reference"-objects.
Where's my fault?


Output of my J2SE-application:

  | Context <javax.naming.initialcont...@6d632c2d>
  | >>>> jndi.properties
  | java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
  | java.naming.provider.url=localhost:1099
  | java.naming.factory.url.pkgs=org.jnp.interfaces 
  | <<<<<
  | 
  | Proxy</CSDatabase/ServerWebClientRemote/remote> 
class<javax.naming.Reference>
  | 

JNDI-View (Extract):

  | java:comp namespace of the component 
jboss.j2ee:ear=CSDatabase.ear,jar=CSDatabaseEJB.jar,name=ServerWebClientRemote,service=EJB3
 :
  |   +- EJBContext (class: javax.ejb.EJBContext)
  |   +- TransactionSynchronizationRegistry[link -> 
java:TransactionSynchronizationRegistry] (class: javax.naming.LinkRef)
  |   +- UserTransaction (class: org.jboss.ejb3.tx.UserTransactionImpl)
  |   +- env (class: org.jnp.interfaces.NamingContext)
  |   |   +- entityManager (class: 
org.jboss.jpa.tx.TransactionScopedEntityManager)
  |   |   +- 
de.myapplication.general.database.server.services.ServerWebClientRemote (class: 
org.jnp.interfaces.NamingContext)
  |   |   |   +- entityManager (class: 
org.jboss.jpa.tx.TransactionScopedEntityManager)
  |   +- ORB[link -> java:/JBossCorbaORB] (class: javax.naming.LinkRef)
  | 
  | 
  | 
  | Global JNDI Namespace
  | 
  | +- CSDatabase (class: org.jnp.interfaces.NamingContext)
  |   |   +- ServerWebClientRemote (class: org.jnp.interfaces.NamingContext)
  |   |   |   +- remote (class: Proxy for: 
de.myapplication.general.database.server.services.IServerWebClientRemote)
  |   |   |   +- 
remote-de.myapplication.general.database.server.services.IServerWebClientRemote 
(class: Proxy for: 
de.myapplication.general.database.server.services.IServerWebClientRemote)
  | 



J2SE-Clientapp (see jndi.properties in Output above):

  | import java.util.Properties;
  | import javax.naming.Context;
  | import javax.naming.InitialContext;
  | 
  | 
  | public class JNDITest {
  | 
  |     private Context context = null; 
  |     private Properties contextProperties = null;
  |     
  |     public JNDITest() {
  |     }
  |     
  |     public void connect() throws Exception {
  |             if(context == null) {
  |                     context = contextProperties == null ? new 
InitialContext() : new InitialContext(contextProperties);
  |                     System.out.println("Context <"+context+">");
  |                     System.out.println(">>>> jndi.properties");
  |                     for(Object key : context.getEnvironment().keySet()) {
  |                             
System.out.println(key+"="+context.getEnvironment().get(key));
  |                     }
  |                     System.out.println("<<<<<");
  |                     System.out.println("");
  |             }
  |     }
  |     
  |     public Object loadBean(String key) throws Exception {
  |             Object proxy = null;
  |             try {
  |                     proxy = context.lookup(key);
  |             } catch(Exception excp) {
  |                     System.out.println("Key<"+key+"> Proxy<"+proxy+"> 
Exception<"+excp.getMessage()+">");
  |                     throw excp;
  |             }
  |             System.out.println("Proxy<"+key+"> 
class<"+proxy.getClass().getName()+">");
  |             return proxy;
  |     }
  |     
  |     
  |     public static void main(String[] args) throws Exception {
  |             JNDITest test = new JNDITest();
  |             test.connect();
  |             test.loadBean("/CSDatabase/ServerWebClientRemote/remote");
  |     }
  | }
  | 



Additional information:

- My EAR does not use JBoss-specific JARs (i want to stay portable). 

  |     hibernate-annotations.jar (for setting indexes)
  |     log4j.jar
  |     commons-beanutils-1.8.0.jar
  |     javaee.jar
  |     jsf-impl.jar
  |     jsf-api.jar
  |     jstl-1.2.jar
  | 

- My J2SE client only imports the necessary jars 

  |     jnp-client.jar
  |     commons-logging.jar
  |     jboss-logging-spi.jar
  |     log4j.jar
  |     slf4j-jboss-logging.jar
  |     jboss-messaging-client.jar
  |     jboss-javaee.jar
  |     jboss-aop-client.jar
  |     jboss-mdr.jar
  | 



Thanks in advance

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4235681#4235681

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4235681
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to