0 Replies Latest reply on Jan 22, 2010 4:23 AM by Arek Stefaniuk

    EJB Problem

    Arek Stefaniuk Newbie

      Hi Everyone

       

      I have two ejb projects deployed on Jboss AS 5.1.First project is a core ejb application that should serve services through a local interface for second.

      So in the second project I try to run code below:


                
                 
                    Properties p = new Properties();
                    p.put("java.naming.provider.url", "localhost:1099");
                    p.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
                    p.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
                   
                    Context context = new InitialContext(p);
                   
                  
                   
                    TestInterface obj = (TestInterface) context.lookup("Project1/Test/local");

       

      When I try to run method I get error:

       

      javax.el.ELException: javax.naming.NamingException: Could not dereference object [Root exception is java.lang.RuntimeException: Can not find interface declared by Proxy in our CL + org.jboss.web.tomcat.service.WebCtxLoader$ENCLoader@f981fe]
               at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:333)
               at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:342)
               at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
               at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
               at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
               at org.jboss.seam.core.Expressions$2.invoke(Expressions.java:175)
               at org.jboss.seam.security.jaas.SeamLoginModule.login(SeamLoginModule.java:109)
               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
               at java.lang.reflect.Method.invoke(Method.java:597)
               at javax.security.auth.login.LoginContext.invoke(LoginContext.java:769)
               at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
               at javax.security.auth.login.LoginContext$5.run(LoginContext.java:706)
               at java.security.AccessController.doPrivileged(Native Method)
               at javax.security.auth.login.LoginContext.invokeCreatorPriv(LoginContext.java:703)
               at javax.security.auth.login.LoginContext.login(LoginContext.java:575)
               at org.jboss.seam.security.Identity.authenticate(Identity.java:344)
               at org.jboss.seam.security.Identity.authenticate(Identity.java:332)
               at org.jboss.seam.security.Identity.login(Identity.java:259)
               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
               at java.lang.reflect.Method.invoke(Method.java:597)
               at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:329)
               at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:342)
               at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
               at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
               at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
               at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
               at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
               at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
               at javax.faces.component.UICommand.broadcast(UICommand.java:387)
               at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:321)
               at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:296)
               at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:253)
               at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:466)
               at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
               at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
               at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
               at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
               at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
               at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
               at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
               at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
               at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
               at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
               at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
               at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
               at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
               at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:177)
               at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
               at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:380)
               at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507)
               at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
               at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
               at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
               at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
               at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
               at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
               at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
               at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
               at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
               at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
               at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
               at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
               at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
               at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
               at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
               at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
               at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
               at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
               at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
               at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
               at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
               at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
               at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
               at java.lang.Thread.run(Thread.java:619)
      Caused by: javax.naming.NamingException: Could not dereference object [Root exception is java.lang.RuntimeException: Can not find interface declared by Proxy in our CL + org.jboss.web.tomcat.service.WebCtxLoader$ENCLoader@f981fe]
               at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1504)
               at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:822)
               at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
               at javax.naming.InitialContext.lookup(InitialContext.java:392)
               at com.tporange.celownikGTP.session.Authenticator.authenticate(Authenticator.java:48)
               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
               at java.lang.reflect.Method.invoke(Method.java:597)
               at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
               at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
               at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
               at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
               at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
               at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)
               at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
               at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
               at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
               at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
               at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
               at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
               at com.tporange.celownikGTP.session.Authenticator_$$_javassist_1.authenticate(Authenticator_$$_javassist_1.java)
               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
               at java.lang.reflect.Method.invoke(Method.java:597)
               at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:329)
               ... 83 more
      Caused by: java.lang.RuntimeException: Can not find interface declared by Proxy in our CL + org.jboss.web.tomcat.service.WebCtxLoader$ENCLoader@f981fe
               at org.jboss.ejb3.proxy.impl.objectfactory.ProxyObjectFactory.redefineProxyInTcl(ProxyObjectFactory.java:410)
               at org.jboss.ejb3.proxy.impl.objectfactory.session.SessionProxyObjectFactory.createProxy(SessionProxyObjectFactory.java:134)
               at org.jboss.ejb3.proxy.impl.objectfactory.session.stateless.StatelessSessionProxyObjectFactory.getProxy(StatelessSessionProxyObjectFactory.java:79)
               at org.jboss.ejb3.proxy.impl.objectfactory.ProxyObjectFactory.getObjectInstance(ProxyObjectFactory.java:161)
               at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
               at org.jnp.interfaces.NamingContext.getObjectInstance(NamingContext.java:1479)
               at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1496)
               ... 109 more
      Caused by: java.lang.ClassNotFoundException: com.tporange.Discoverer.session.TestInterface
               at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
               at java.security.AccessController.doPrivileged(Native Method)
               at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
               at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
               at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
               at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
               at java.lang.Class.forName0(Native Method)
               at java.lang.Class.forName(Class.java:247)
               at org.jboss.ejb3.proxy.impl.objectfactory.ProxyObjectFactory.redefineProxyInTcl(ProxyObjectFactory.java:406)
               ... 115 more

       

      When I try to run standalone application using remote interface

       

          Properties p = new Properties();
                    p.put("java.naming.provider.url", "localhost:1099");
                    p.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
                    p.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
                   
                    Context context = new InitialContext(p);
                   
                  
                   
                    TestInterface obj = (TestInterface) context.lookup("Project1/Test/remote");

       

       

      everything goes OK. Any ideas?

       

       

      Thanks a lot for any replies.