Hi,

I am working on a project where Tocat was embeded within Jboss3.2. I was able to 
access EJBs from the servlets in this configuration. However, I would like to 
separates the web tier from Jboss so that I may deploy the web tier codes without 
redeploy the EJBs. I user tomcat 4.1.30 for the web tier that runs in the same server 
box as Jboss3.2 did.  A java class was used to lookup the ENC information locally from 
the web.xml by calling;
ctx = new InitialContext(). 
serverIPAddress = (String)ctx.lookUp("AppServerIPAddr1");
serverPortNumber = (String)ctx.lookUp("ServerPortNumber");
urlPackagePrefixes = (String)ctx.lookUp("urlPackagePrefixes");
initialContextFactory = (String) ctx.lookUp("initialContextFactory");

These ENC information were used for creating properties to pass into a new 
InitialContext object that was used to lookup remote EJBs.

String url = "jnp://" + ServerIPAddress + ":" + ServerPortNumber;
Properties props = new Properties();
props.setProperty(Context.INITIAL_CONTEXT_FACTORY, initialContextFactory);
props.setProperty(Context.URL_PKG_PREFIXES, urlPackagePrefixes);
props.setProperty(Context.PROVIDER_URL, url);
remoteCtx = new InitialContext(props);

But I got NamingException 
(org.jnp.server.NamingServer.getBinding(NamingServer.java:495)) occured when the java 
class try to lookup the EJBs.
anEJBHome = (EJBHome) PortableRemoteObject.narrow       
(ctx.lookup("java:comp/env/ejb/refToUserControllerBean"), aHomeClass);

The following steps were taken to seperates the web tier;
1) copy jbossall-client.jar, jboss-client.jar, jboss-common-client.jar, 
jboss-j2ee.jar, jboss-jaas.jar, jbosssx-client.jar, jnp-client.jar to 
myWebApp/WEB-INF/lib directory.

2) Created a jndi.properties in myWebApp/WEB-INF/classes
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.provider.url=jnp://localhost:1099
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces

3) the web.xml file contains reference to the ejb as defined below
        <ejb-ref>
                
                      Reference to UserController Bean
                
                 <ejb-ref-name>
                      ejb/refToUserControllerBean
                 </ejb-ref-name>
                <ejb-ref-type>Session</ejb-ref-type>
                        
com.wlwa.Infra.BusinessLogic.SessionBeans.Controller.UserControllerRemoteHome
                
                
com.wlwa.Infra.BusinessLogic.SessionBeans.Controller.UserControllerRemote
                
                <ejb-link>UserControllerBean</ejb-link>
        </ejb-ref>

Did i have the <ejb-link> tag setup wrong? This declaration was used when the tomcat 
was embeded within Jboss and it worked fine. If it is wrong please let me know how to 
fix it. Any suggestion is greatly appreciated.
Kam


****************************** Debug *****************************
DEBUG [http8888-Processor2] (EnvEntriesFactory.java:52) - Begin lookUpEnvEntries
DEBUG [http8888-Processor2] (EnvEntriesFactory.java:68) - End lookUpEnvEntries
DEBUG [http8888-Processor2] (EnvEntriesFactory.java:52) - Begin lookUpEnvEntries
DEBUG [http8888-Processor2] (EnvEntriesFactory.java:68) - End lookUpEnvEntries
DEBUG [http8888-Processor2] (EnvEntriesFactory.java:52) - Begin lookUpEnvEntries
DEBUG [http8888-Processor2] (EnvEntriesFactory.java:68) - End lookUpEnvEntries
DEBUG [http8888-Processor2] (EnvEntriesFactory.java:52) - Begin lookUpEnvEntries
DEBUG [http8888-Processor2] (EnvEntriesFactory.java:68) - End lookUpEnvEntries
DEBUG [http8888-Processor2] (AbstractEJBHomeFactory.java:82) - 
Context.INITIAL_CONTEXT_FACTORY is set to :org.jnp.interfaces.NamingContextFactory
DEBUG [http8888-Processor2] (AbstractEJBHomeFactory.java:83) - 
Context.URL_PKG_PREFIXES is set to :org.jboss.naming:org.jnp.interfaces
DEBUG [http8888-Processor2] (AbstractEJBHomeFactory.java:84) - Application Server IP 
Address is set to :localhost
DEBUG [http8888-Processor2] (AbstractEJBHomeFactory.java:85) - Application Server Port 
Number is set to :1099
DEBUG [http8888-Processor2] (AbstractEJBHomeFactory.java:86) - Context.PROVIDER_URL is 
set to :jnp://localhost:1099
FATAL [http8888-Processor2] (EJBHomeRemoteFactory.java:123) - 
java:comp/env/ejb/refToUserControllerBean
DEBUG [http8888-Processor2] (ExceptionPrintingUtilities.java:29) - Begin 
PrintStackTraceElements
DEBUG [http8888-Processor2] (ExceptionPrintingUtilities.java:41) - End 
PrintStackTraceElements
FATAL [http8888-Processor2] (EJBHomeRemoteFactory.java:124) - NamingException
org.jnp.server.NamingServer.getBinding(NamingServer.java:495)
org.jnp.server.NamingServer.getBinding(NamingServer.java:503)
org.jnp.server.NamingServer.getObject(NamingServer.java:509)
org.jnp.server.NamingServer.lookup(NamingServer.java:253)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)



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

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3837304



-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
>From Windows to Linux, servers to mobile, InstallShield X is the one
installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to