| Author |
using EJB to connect to LDAP with weblogic5.1
|
ron ray chaudhuri
Greenhorn
Joined: Aug 27, 2003
Posts: 7
|
|
I'm writing an application which retrieves some information from an LDAP directory. When my client is instantiating the EJB I'm getting the following error. public class ClientMos { ..... public void makeConnection() { try { MoveMosUtil.log("making connection to SecureWay directory"); //empty contructor used to initialise bean ctx_context = getInitialContext(); MoveMosUtil.log("context initialised"); MoveMosUtil.log("before home variable initialised"); home = (MoveMosHome) ctx_context.lookup("moveMos.MoveMosHome"); MoveMosUtil.log("home variable initialised"); MoveMosUtil.log(home.create().getClass().getName()); remote = (MoveMosRemote) home.create(); .... .... } } Output: making connection to SecureWay directory context initialised Error in makeConnection procedure java.lang.ClassCastException: com.eds.eoi.tools.ejb.movemos.MoveMosBeanHomeImpl ServiceStub at com.eds.eoi.tools.client.ClientMos.makeConnection(ClientMos.java:123 at jsp_servlet._movemos._selectorganisationalunit._jspService(_selector anisationalunit.java:120) at weblogic.servlet.jsp.JspBase.service(JspBase.java:27) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubI pl.java:120) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubI pl.java:138) at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispa cherImpl.java:158) at com.eds.eoi.tools.servlet.MoveMosServlet.service(MoveMosServlet.java 154) at javax.servlet.http.HttpServlet.service(HttpServlet.java:865) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubI pl.java:120) at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCo textImpl.java:915) at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCo textImpl.java:879) at weblogic.servlet.internal.ServletContextManager.invokeServlet(Servle ContextManager.java:269) at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.ja a:365) at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:253 at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129) Error in setDisplayOUList procedure java.lang.NullPointerException at com.eds.eoi.tools.client.ClientMos.setDisplayOUList(ClientMos.java:1 1) at jsp_servlet._movemos._selectorganisationalunit._jspService(_selector anisationalunit.java:121) at weblogic.servlet.jsp.JspBase.service(JspBase.java:27) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubI pl.java:120) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubI pl.java:138) at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispa cherImpl.java:158) at com.eds.eoi.tools.servlet.MoveMosServlet.service(MoveMosServlet.java 154) at javax.servlet.http.HttpServlet.service(HttpServlet.java:865) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubI pl.java:120) at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCo textImpl.java:915) at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCo textImpl.java:879) at weblogic.servlet.internal.ServletContextManager.invokeServlet(Servle ContextManager.java:269) at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.ja a:365) at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:253 at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129) My descriptor files all have the correct definitions and mapping to the corresponding JNDI name as follows: <weblogic-ejb-jar> <weblogic-enterprise-bean> <ejb-name>moveMos</ejb-name> <caching-descriptor> <max-beans-in-cache>100</max-beans-in-cache> </caching-descriptor> <jndi-name>moveMos.MoveMosHome</jndi-name> </weblogic-enterprise-bean> </weblogic-ejb-jar> My ejb-jar.xml is as follows: <ejb-jar> <enterprise-beans> <session> <description></description> <ejb-name>moveMos</ejb-name> <home>com.eds.eoi.tools.ejb.movemos.MoveMosHome</home> <remote>com.eds.eoi.tools.ejb.movemos.MoveMosRemote</remote> <ejb-class>com.eds.eoi.tools.ejb.movemos.MoveMosBean</ejb-class> <session-type>Stateless</session-type> <transaction-type>Container</transaction-type> </session> </enterprise-beans> <assembly-descriptor> <container-transaction> <method> <ejb-name>moveMos</ejb-name> <method-name>*</method-name> </method> <trans-attribute>Required</trans-attribute> </container-transaction> </assembly-descriptor> </ejb-jar> I'm using weblogic 5.1 sp9. Can anyone please help? Thanks in advance. [ October 16, 2003: Message edited by: ron ray chaudhuri ]
|
 |
 |
|
|
subject: using EJB to connect to LDAP with weblogic5.1
|
|
|