3 Replies Latest reply on Jul 28, 2004 7:08 AM by s5554

    Errors w/ Duke's Bank as a Web Service

    cerenit

      After having followed the instructions for modifying AccountDetails and recompiling and redeploying, I then tried the run-ws-client target in Ant, only to get the following error in my JBoss console (I was wondering if this might not be related to the security domain which I added, according to the instructions in section 4.3 of the Getting Started guide):

      15:42:09,845 INFO [EmbeddedTomcatService] undeploy, ctxPath=/bank, warUrl=file:/Users/jpw/Documents/development/bunker/jboss-3.2.3/server/default/tmp/deploy/tmp2872JBossDukesBank.ear-contents/web-client.war/
      15:42:09,848 INFO [Engine] StandardHost[localhost]: Removing web application at context path /bank
      15:42:09,913 INFO [EjbModule] Stopping jboss.j2ee:module=tx-ejb.jar,service=EjbModule
      15:42:09,914 INFO [StatefulSessionContainer] Stopping jboss.j2ee:jndiName=MyTxController,service=EJB
      15:42:09,915 INFO [StatefulSessionInstancePool] Stopping jboss.j2ee:jndiName=MyTxController,plugin=pool,service=EJB
      15:42:09,915 INFO [StatefulSessionFilePersistenceManager] Stopping null
      15:42:09,915 INFO [EntityContainer] Stopping jboss.j2ee:jndiName=MyTx,service=EJB
      15:42:09,916 INFO [EntityInstancePool] Stopping jboss.j2ee:jndiName=MyTx,plugin=pool,service=EJB
      15:42:09,917 INFO [EjbModule] Stopping jboss.j2ee:module=account-ejb.jar,service=EjbModule
      15:42:09,917 INFO [StatefulSessionContainer] Stopping jboss.j2ee:jndiName=MyAccountController,service=EJB
      15:42:09,918 INFO [StatefulSessionInstancePool] Stopping jboss.j2ee:jndiName=MyAccountController,plugin=pool,service=EJB
      15:42:09,918 INFO [StatefulSessionFilePersistenceManager] Stopping null
      15:42:09,919 INFO [EntityContainer] Stopping jboss.j2ee:jndiName=MyAccount,service=EJB
      15:42:09,919 INFO [EntityInstancePool] Stopping jboss.j2ee:jndiName=MyAccount,plugin=pool,service=EJB
      15:42:09,940 INFO [EjbModule] Stopping jboss.j2ee:module=customer-ejb.jar,service=EjbModule
      15:42:09,941 INFO [StatefulSessionContainer] Stopping jboss.j2ee:jndiName=MyCustomerController,service=EJB
      15:42:09,941 INFO [StatefulSessionInstancePool] Stopping jboss.j2ee:jndiName=MyCustomerController,plugin=pool,service=EJB
      15:42:09,942 INFO [StatefulSessionFilePersistenceManager] Stopping null
      15:42:09,942 INFO [EntityContainer] Stopping jboss.j2ee:jndiName=MyCustomer,service=EJB
      15:42:09,942 INFO [EntityInstancePool] Stopping jboss.j2ee:jndiName=MyCustomer,plugin=pool,service=EJB
      15:42:09,943 INFO [EARDeployer] Undeploying J2EE application, destroy step: file:/Users/jpw/Documents/development/bunker/jboss-3.2.3/server/default/deploy/JBossDukesBank.ear
      15:42:10,182 INFO [EJBModule] destroy(), remove EJB-Module: jboss.management.local:J2EEApplication=JBossDukesBank.ear,J2EEServer=Local,j2eeType=EJBModule,name=tx-ejb.jar
      15:42:10,226 INFO [EJBModule] destroy(), remove EJB-Module: jboss.management.local:J2EEApplication=JBossDukesBank.ear,J2EEServer=Local,j2eeType=EJBModule,name=account-ejb.jar
      15:42:10,250 INFO [EJBModule] destroy(), remove EJB-Module: jboss.management.local:J2EEApplication=JBossDukesBank.ear,J2EEServer=Local,j2eeType=EJBModule,name=customer-ejb.jar
      15:42:10,253 INFO [MainDeployer] Starting deployment of package: file:/Users/jpw/Documents/development/bunker/jboss-3.2.3/server/default/deploy/JBossDukesBank.ear
      15:42:10,449 INFO [EARDeployer] Init J2EE application: file:/Users/jpw/Documents/development/bunker/jboss-3.2.3/server/default/deploy/JBossDukesBank.ear
      15:42:12,181 INFO [EjbModule] Deploying AccountEJB
      15:42:12,195 INFO [EjbModule] Deploying AccountControllerEJB
      15:42:13,341 INFO [EjbModule] Deploying TxEJB
      15:42:13,358 INFO [EjbModule] Deploying TxControllerEJB
      15:42:14,337 INFO [EjbModule] Deploying CustomerEJB
      15:42:14,353 INFO [EjbModule] Deploying CustomerControllerEJB
      15:42:14,713 INFO [EntityInstancePool] Started jboss.j2ee:jndiName=MyAccount,plugin=pool,service=EJB
      15:42:14,714 INFO [EntityContainer] Started jboss.j2ee:jndiName=MyAccount,service=EJB
      15:42:14,745 INFO [StatefulSessionInstancePool] Started jboss.j2ee:jndiName=MyAccountController,plugin=pool,service=EJB
      15:42:14,746 INFO [StatefulSessionFilePersistenceManager] Started null
      15:42:14,747 INFO [StatefulSessionContainer] Started jboss.j2ee:jndiName=MyAccountController,service=EJB
      15:42:14,748 INFO [EjbModule] Started jboss.j2ee:module=account-ejb.jar,service=EjbModule
      15:42:14,749 INFO [EJBDeployer] Deployed: file:/Users/jpw/Documents/development/bunker/jboss-3.2.3/server/default/tmp/deploy/tmp2889JBossDukesBank.ear-contents/account-ejb.jar
      15:42:14,797 INFO [EntityInstancePool] Started jboss.j2ee:jndiName=MyTx,plugin=pool,service=EJB
      15:42:14,798 INFO [EntityContainer] Started jboss.j2ee:jndiName=MyTx,service=EJB
      15:42:14,862 INFO [StatefulSessionInstancePool] Started jboss.j2ee:jndiName=MyTxController,plugin=pool,service=EJB
      15:42:14,863 INFO [StatefulSessionFilePersistenceManager] Started null
      15:42:14,864 INFO [StatefulSessionContainer] Started jboss.j2ee:jndiName=MyTxController,service=EJB
      15:42:14,865 INFO [EjbModule] Started jboss.j2ee:module=tx-ejb.jar,service=EjbModule
      15:42:14,866 INFO [EJBDeployer] Deployed: file:/Users/jpw/Documents/development/bunker/jboss-3.2.3/server/default/tmp/deploy/tmp2889JBossDukesBank.ear-contents/tx-ejb.jar
      15:42:14,918 INFO [EntityInstancePool] Started jboss.j2ee:jndiName=MyCustomer,plugin=pool,service=EJB
      15:42:14,920 INFO [EntityContainer] Started jboss.j2ee:jndiName=MyCustomer,service=EJB
      15:42:15,015 INFO [StatefulSessionInstancePool] Started jboss.j2ee:jndiName=MyCustomerController,plugin=pool,service=EJB
      15:42:15,016 INFO [StatefulSessionFilePersistenceManager] Started null
      15:42:15,017 INFO [StatefulSessionContainer] Started jboss.j2ee:jndiName=MyCustomerController,service=EJB
      15:42:15,018 INFO [EjbModule] Started jboss.j2ee:module=customer-ejb.jar,service=EjbModule
      15:42:15,019 INFO [EJBDeployer] Deployed: file:/Users/jpw/Documents/development/bunker/jboss-3.2.3/server/default/tmp/deploy/tmp2889JBossDukesBank.ear-contents/customer-ejb.jar
      15:42:15,223 INFO [EmbeddedTomcatService] deploy, ctxPath=/bank, warUrl=file:/Users/jpw/Documents/development/bunker/jboss-3.2.3/server/default/tmp/deploy/tmp2889JBossDukesBank.ear-contents/web-client.war/
      15:42:16,080 INFO [Engine] SingleSignOnContextConfig[/bank]: Added certificates -> request attribute Valve
      15:42:16,082 INFO [Engine] SingleSignOnContextConfig[/bank]: Configured an authenticator for method FORM
      15:42:16,130 WARN [EmbeddedTomcatService] Unable to invoke setDelegate on class loader:org.jboss.web.tomcat.tc4.WebCtxLoader$ENCLoader@51e7fb
      15:42:16,134 INFO [Engine] StandardManager[/bank]: Seeding random number generator class java.security.SecureRandom
      15:42:16,137 INFO [Engine] StandardManager[/bank]: Seeding of random number generator has been completed
      15:42:16,139 INFO [Engine] StandardWrapper[/bank:default]: Loading container servlet default
      15:42:16,141 INFO [Engine] StandardWrapper[/bank:invoker]: Loading container servlet invoker
      15:42:16,541 INFO [EARDeployer] Started J2EE application: file:/Users/jpw/Documents/development/bunker/jboss-3.2.3/server/default/deploy/JBossDukesBank.ear
      15:42:16,543 INFO [MainDeployer] Deployed package: file:/Users/jpw/Documents/development/bunker/jboss-3.2.3/server/default/deploy/JBossDukesBank.ear
      15:43:58,803 INFO [MainDeployer] Starting deployment of package: file:/Users/jpw/Documents/development/bunker/jboss-3.2.3/server/default/deploy/ebank.wsr
      15:43:59,108 INFO [MainDeployer] Deployed package: file:/Users/jpw/Documents/development/bunker/jboss-3.2.3/server/default/deploy/ebank.wsr
      15:44:47,820 INFO [JaasSecurityManagerService] Created securityMgr=org.jboss.security.plugins.JaasSecurityManager@adab2f
      15:44:47,825 INFO [JaasSecurityManagerService] setCachePolicy, c=org.jboss.util.TimedCachePolicy@f7ceaa
      15:44:47,829 INFO [JaasSecurityManagerService] Added other, org.jboss.security.plugins.SecurityDomainContext@21179a to map
      15:54:06,446 ERROR [SecurityInterceptor] Authentication exception, principal=null
      15:54:06,449 ERROR [LogInterceptor] EJBException, causedBy:
      java.lang.SecurityException: Authentication exception, principal=null
       at org.jboss.ejb.plugins.SecurityInterceptor.checkSecurityAssociation(SecurityInterceptor.java:164)
       at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:81)
       at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:214)
       at org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invokeHome(StatefulSessionInstanceInterceptor.java:126)
       at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:88)
       at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:267)
       at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:98)
       at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:120)
       at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:93)
       at org.jboss.ejb.StatefulSessionContainer.internalInvokeHome(StatefulSessionContainer.java:404)
       at org.jboss.ejb.Container.invoke(Container.java:720)
       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:324)
       at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
       at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:101)
       at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:90)
       at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
       at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:45)
       at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:173)
       at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:85)
       at $Proxy96.create(Unknown Source)
       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:324)
       at org.jboss.net.axis.server.EJBProvider.makeNewServiceObject(EJBProvider.java:139)
       at org.apache.axis.providers.java.JavaProvider.getNewServiceObject(JavaProvider.java:261)
       at org.apache.axis.providers.java.JavaProvider.getServiceObject(JavaProvider.java:138)
       at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:313)
       at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:71)
       at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:150)
       at org.apache.axis.SimpleChain.invoke(SimpleChain.java:120)
       at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:481)
       at org.apache.axis.server.AxisServer.invoke(AxisServer.java:323)
       at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:854)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
       at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:339)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
       at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
       at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
       at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
       at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
       at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.invoke(JBossSecurityMgrRealm.java:220)
       at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:553)
       at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
       at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
       at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
       at org.jboss.web.tomcat.tc4.statistics.ContainerStatsValve.invoke(ContainerStatsValve.java:76)
       at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
       at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
       at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
       at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
       at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
       at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
       at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
       at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:65)
       at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
       at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:577)
       at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
       at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
       at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
       at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
       at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
       at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
       at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:197)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549)
       at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:605)
       at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:677)
       at java.lang.Thread.run(Thread.java:552)
      


      And in the java console:
       [java] java.rmi.ServerException: EJBException:; nested exception is:
       [java] javax.ejb.EJBException: checkSecurityAssociation; CausedByException is:
       [java] Authentication exception, principal=null
      


      Any suggestions would be appreciated...

      Patterson

        • 1. Re: Errors w/ Duke's Bank as a Web Service
          cerenit

          I commented out all the security-domain statements in the xml files, recompiled and redeployed the JBossDukesBank.ear and the ebank.wsr and was finally able to connect using the WSClient.

          I added back in the security-domains, recompiled and redeployed, and once again got the errors I mentioned in my previous post.

          I therefore conclude that activating the security domain as mentioned in section 4.3.2 will prevent successfully running the WSClient application.

          I find it troublesome that you would present the Web Services section of the Getting Started guide after having suggested that readers modify the codebase in a way which will make their attempts to connect using the WSClient fail. At the very least, you should add a caveat to section 7.2.3 which mentions that the security-domain statements will need to be commented out and the .ear recompiled and redeployed before running the client. Better still, explain how we can make a web services call while respecting the security domain which has been set up.

          On a similar note, in section 7.2.3 there is no mention of the Ant target for running the client: I had to go fish it out of the jboss-build.xml file myself. It would probably be a good idea to mention it explicitly.

          Also, when doing the Net Traffic Analysis in 7.2.4, you mention recompiling the client, but don't say which Ant target to use. Via trial and error, I figured out that it was the "compile" target, but having this mentioned in the guide would have saved me some time.

          Don't get me wrong, I'm quite happy to have this guide available. I'm sure it's saved me hours of trial and error further down the road. I'd just like to see it made even better.

          Patterson Waltz

          • 2. Re: Errors w/ Duke's Bank as a Web Service

            You're right, the call will fail if the security domain has been applied at the EJB level (though obviously the web application is irrelevant here). I'll mention this in chapter 7. Thanks for your feedback.

            Luke.

            • 3. Re: Errors w/ Duke's Bank as a Web Service
              s5554

              Could it be that the appclient has the same or similar problem? At least I get Authentication exception, principal=null if I give <security-domain>java:/jaas/dukesbank</security-domain> in the -jboss.xml's and the client functions OK without security-domains in the ejb's.

              Risto Luukkanen