5 Replies Latest reply on Dec 18, 2007 9:13 AM by jbalunas

    bug in Seam + JbossWS

    beligum

      Hi all,

      I wanted to check this before submitting it to JIRA:
      (cross-posted to JbossWS, but got no reply: http://www.jboss.com/index.html?module=bb&op=viewtopic&t=125662)

      I don't really know where to post this, but I guess it's more WS-related than it is Seam-related.

      Here's the issue: When I start an (ear) application, and nobody went to the website, before a remote login()-webserviceservice is contacted (which uses the seam Identity component to login), I always get an error that the security.drl file couldn't be found. Though, when I try to do this after someone visited the site (and security.drl) was loaded appropriately, everything is ok.

      It seems like the initialization of the security-rules is something the webservice-integration (in Seam) isn't able to do?

      Here's the stacktrace:

      13:39:56,432 INFO [RuleBase] parsing rules: security.drl
      13:39:56,472 ERROR [SOAPFaultHelperJAXWS] SOAP request exception
      javax.ejb.EJBException: org.jboss.seam.InstantiationException: Could not instantiate Seam component:
       org.jboss.seam.security.identity
       at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:63)
       at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
       at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor
      .java:62)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.jav
      a:77)
       at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationIntercepto
      r.java:110)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:1
      06)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.wsf.container.jboss42.InvocationHandlerEJB3.invoke(InvocationHandlerEJB3.java:1
      03)
       at org.jboss.ws.core.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:220)
       at org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHandlerImpl.java:414)
       at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:273)
       at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:190)
       at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:123
      )
       at org.jboss.wsf.stack.jbws.EndpointServlet.service(EndpointServlet.java:84)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j
      ava:290)
       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.j
      ava:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.ja
      va:179)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
       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:
      157)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.ja
      va:583)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
       at java.lang.Thread.run(Thread.java:619)
      Caused by: org.jboss.seam.InstantiationException: Could not instantiate Seam component: org.jboss.se
      am.security.identity
       at org.jboss.seam.Component.newInstance(Component.java:1962)
       at org.jboss.seam.Component.getInstance(Component.java:1865)
       at org.jboss.seam.Component.getInstance(Component.java:1844)
       at org.jboss.seam.Component.getInstance(Component.java:1821)
       at org.jboss.seam.Component.getInstance(Component.java:1816)
       at org.jboss.seam.security.Identity.instance(Identity.java:160)
       at com.acepostproduction.tumbolia.webservice.SecurityServiceImpl.getAllSpaces(SecurityServic
      eImpl.java:56)
       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.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
       at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
       at org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationContext.java:44)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
       at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
       at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:4
      2)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
       at org.jboss.seam.persistence.EntityManagerProxyInterceptor.aroundInvoke(EntityManagerProxyI
      nterceptor.java:26)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
       at org.jboss.seam.persistence.HibernateSessionProxyInterceptor.aroundInvoke(HibernateSession
      ProxyInterceptor.java:27)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
       at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
       at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:
      50)
       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.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
       at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor
      .java:63)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedE
      ntityManagerInterceptor.java:54)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
       ... 39 more
      Caused by: java.lang.IllegalStateException: could not locate rule file: security.drl
       at org.jboss.seam.drools.RuleBase.compileRuleBase(RuleBase.java:51)
       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:21)
       at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:125)
       at org.jboss.seam.Component.callComponentMethod(Component.java:2074)
       at org.jboss.seam.Component.callCreateMethod(Component.java:1997)
       at org.jboss.seam.Component.newInstance(Component.java:1968)
       at org.jboss.seam.Component.getInstance(Component.java:1865)
       at org.jboss.seam.Component.getInstance(Component.java:1832)
       at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:55)
       at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:50)
       at org.jboss.seam.el.SeamELResolver.resolveBase(SeamELResolver.java:166)
       at org.jboss.seam.el.SeamELResolver.getValue(SeamELResolver.java:53)
       at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
       at org.jboss.el.parser.AstIdentifier.getValue(AstIdentifier.java:44)
       at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
       at org.jboss.seam.core.Expressions$1.getValue(Expressions.java:112)
       at org.jboss.seam.Component$ELInitialValue.getValue(Component.java:2352)
       at org.jboss.seam.Component.initialize(Component.java:1381)
       at org.jboss.seam.Component.instantiateJavaBean(Component.java:1307)
       at org.jboss.seam.Component.instantiate(Component.java:1260)
       at org.jboss.seam.Component.newInstance(Component.java:1958)
       ... 75 more
      


      I guess this is important enough to post a jira-issue, but maybe I'm doing something wrong, so I'm checking with others first. Comments?

      bram

        • 1. Re: bug in Seam + JbossWS
          jbalunas

          From your stack trace, and the source code it appears the issue is not that the drools rules are not being initiated, but that when they are initiated on the call through WS the context of the call is different than when it is a regular web request.

          In other words, during a web request the context root of the call might be the web root ( base of the war), while during a WS call the context root might be the ear root (base of the ear).

          Just to be sure where is your security.drl file in the ear/war? Also if you put a full path to the files ( "/security.drl', or "/META-INF/security.drl") how does that effect the behavior.

          -Jay

          • 2. Re: bug in Seam + JbossWS
            beligum

            Whow, Jay, thanks for this.

            I really should have thought if this myself, sorry for that.
            My drl file was in the war/classes folder (don't really know why, I may have followed an example case).
            After moving it to the root ear dir, both approaches work.

            Again, thanks.

            bram

            • 3. Re: bug in Seam + JbossWS
              jbalunas

              I'm glad to hear that the changes worked for you.

              Do you happen to know what example you saw this in? I'll look around as well.

              Thanks,
              Jay

              • 4. Re: bug in Seam + JbossWS
                beligum

                Sorry Jay, no I don't.
                I've been using seam since the beginning, and my build.xml doesn't even look like the one, provided with the examples. Perhaps, I should refactor it accordingly. Btw, I tried it out with the seambay example, and it works perfect, so I didn't get it from there...

                b.

                • 5. Re: bug in Seam + JbossWS
                  jbalunas

                  No problem. I'll poke around the examples when I get a minute.

                  -Jay