0 Replies Latest reply on Jul 2, 2013 3:38 AM by Bond Chan

    [jboss EAP5.1.2] attribute occupying several lines literally cause JMS security exception, whreas cat in one line not

    Bond Chan Novice

      The exception throw during sending JMS, from the exception seem security-domain not using the one I config(messaging), but using 'other'.

       

       

      ==============code sending JMS=======


      public void publishObjectToTopic(String topicname, String command, Serializable msg) throws NamingException, JMSException  {


      topicConnection = topicFactory.createTopicConnection("guest","guest");


      TopicSession topicSession = null;


      TopicPublisher topicPublisher = null;


      try{



      topicSession = topicConnection.createTopicSession(false,Session.AUTO_ACKNOWLEDGE);



      Topic topic = (Topic)sls.getJNDIResource(topicname);

      line:143
      topicPublisher = topicSession.createPublisher(topic);



      ObjectMessage message = topicSession.createObjectMessage();



      if(command!=null) { message.setStringProperty("command",command); }



      message.setObject(msg);



      message.setJMSDeliveryMode(DeliveryMode.NON_PERSISTENT);



      topicPublisher.publish(message);


      }catch(NamingException ne){



      log.error("A NamingException was thrown trying to get JNDI resource:" + topicname + "\n" + ne.getStackTrace());



      throw ne;


      }catch(JMSException jmse){



      log.error("A JMSException was trying to publish msg: " + msg + " to topic: " + topicname + "\n" + jmse.getStackTrace());



      throw jmse;


      }finally{



      closeTopicResource(topicConnection,topicSession,topicPublisher);


      }

      }

       

       

       

      ===============exception=======================

      2013-07-02 12:02:22,523 ERROR [org.jboss.security.auth.spi.UsersRolesLoginModule] (http-172.20.20.177-8080-4:) Failed to load users/passwords/role files

      java.io.IOException: No properties file: users.properties or defaults: defaultUsers.properties found

              at org.jboss.security.auth.spi.Util.loadProperties(Util.java:201)

              at org.jboss.security.auth.spi.UsersRolesLoginModule.loadUsers(UsersRolesLoginModule.java:186)

              at org.jboss.security.auth.spi.UsersRolesLoginModule.createUsers(UsersRolesLoginModule.java:200)

              at org.jboss.security.auth.spi.UsersRolesLoginModule.initialize(UsersRolesLoginModule.java:127)

              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:756)

              at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)

              at javax.security.auth.login.LoginContext$4.run(LoginContext.java:683)

              at java.security.AccessController.doPrivileged(Native Method)

              at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)

              at javax.security.auth.login.LoginContext.login(LoginContext.java:579)

              at org.jboss.security.plugins.auth.JaasSecurityManagerBase.defaultLogin(JaasSecurityManagerBase.java:553)

              at org.jboss.security.plugins.auth.JaasSecurityManagerBase.authenticate(JaasSecurityManagerBase.java:487)

              at org.jboss.security.plugins.auth.JaasSecurityManagerBase.isValid(JaasSecurityManagerBase.java:365)

              at org.jboss.security.plugins.JaasSecurityManager.isValid(JaasSecurityManager.java:160)

              at org.jboss.security.integration.JBossSecuritySubjectFactory.createSubject(JBossSecuritySubjectFactory.java:90)

              at org.jboss.resource.connectionmanager.BaseConnectionManager2.getSubject(BaseConnectionManager2.java:687)

              at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:495)

              at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:941)

              at org.jboss.resource.adapter.jms.JmsSessionFactoryImpl.allocateConnection(JmsSessionFactoryImpl.java:395)

              at org.jboss.resource.adapter.jms.JmsSessionFactoryImpl.createTopicSession(JmsSessionFactoryImpl.java:167)

              at com.lombardrisk.f3.jms.ServerJMSHelper.publishObjectToTopic(ServerJMSHelper.java:143)

              at com.lombardrisk.f3.useradmin.RolesServiceBean.publishUpdate(RolesServiceBean.java:287)

              at com.lombardrisk.f3.useradmin.RolesServiceBean.addRoleForUser(RolesServiceBean.java:441)

              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.invocation.Invocation.performCall(Invocation.java:386)

              at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:233)

              at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:156)

              at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:173)

              at com.lombardrisk.f3.audit.AuditTrailInterceptor.invoke(AuditTrailInterceptor.java:233)

              at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)

              at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)

              at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)

              at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)

              at com.lombardrisk.f3.accesscontrol.JBossEJBInterceptor.invoke(JBossEJBInterceptor.java:140)

              at org.jboss.ejb.plugins.SecurityInterceptor.process(SecurityInterceptor.java:228)

              at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:211)

              at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)

              at com.lombardrisk.f3.logging.ElapsedTimeInterceptor.invoke(ElapsedTimeInterceptor.java:41)

              at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:138)

              at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:650)

              at org.jboss.ejb.Container.invoke(Container.java:1092)

              at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:436)

              at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:103)

              at $Proxy442.addRoleForUser(Unknown Source)

              at com.lombardrisk.f3.useradmin.StandardUserManagerBean.addUser(StandardUserManagerBean.java:201)

              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.invocation.Invocation.performCall(Invocation.java:386)

              at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:233)

              at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:156)

              at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:173)

              at com.lombardrisk.f3.audit.AuditTrailInterceptor.invoke(AuditTrailInterceptor.java:233)

              at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)

              at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)

              at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)

              at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)

              at com.lombardrisk.f3.accesscontrol.JBossEJBInterceptor.invoke(JBossEJBInterceptor.java:140)

              at org.jboss.ejb.plugins.SecurityInterceptor.process(SecurityInterceptor.java:228)

              at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:211)

              at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)

              at com.lombardrisk.f3.logging.ElapsedTimeInterceptor.invoke(ElapsedTimeInterceptor.java:41)

              at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:138)

              at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:650)

              at org.jboss.ejb.Container.invoke(Container.java:1092)

              at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:436)

              at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:103)

              at $Proxy488.addUser(Unknown Source)

              at com.lombardrisk.f3.useradmin.UserServiceBean.addUser(UserServiceBean.java:397)

              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.invocation.Invocation.performCall(Invocation.java:386)

              at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:233)

              at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:156)

              at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:173)

              at com.lombardrisk.f3.audit.AuditTrailInterceptor.invoke(AuditTrailInterceptor.java:233)

              at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)

              at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)

              at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)

              at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)

              at com.lombardrisk.f3.accesscontrol.JBossEJBInterceptor.invoke(JBossEJBInterceptor.java:140)

              at org.jboss.ejb.plugins.SecurityInterceptor.process(SecurityInterceptor.java:228)

              at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:211)

              at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)

              at com.lombardrisk.f3.logging.ElapsedTimeInterceptor.invoke(ElapsedTimeInterceptor.java:41)

              at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:138)

              at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:650)

              at org.jboss.ejb.Container.invoke(Container.java:1092)

              at sun.reflect.GeneratedMethodAccessor399.invoke(Unknown Source)

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

              at java.lang.reflect.Method.invoke(Method.java:597)

              at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)

              at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)

              at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)

              at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)

              at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)

              at org.jboss.system.server.jmx.LazyMBeanServer.invoke(LazyMBeanServer.java:283)

              at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:169)

              at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:118)

              at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:260)

              at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:246)

              at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:61)

              at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:68)

              at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:112)

              at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:101)

              at $Proxy495.addUser(Unknown Source)

              at com.lombardrisk.webgui.admin.useradmin.actions.EditUserAction.doSaveNew(EditUserAction.java:171)

              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 com.lombardrisk.webgui.DispatcherAction.safePerform(DispatcherAction.java:65)

              at com.lombardrisk.webgui.WebguiAction.execute(WebguiAction.java:239)

              at org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:53)

              at org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:64)

              at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:48)

              at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)

              at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)

              at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)

              at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:280)

              at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1858)

              at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:459)

              at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)

              at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

              at com.lombardrisk.webgui.filter.ValidRequestForHttpOnlyFilter.doFilter(ValidRequestForHttpOnlyFilter.java:31)

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

              at com.lombardrisk.webgui.wrapper.TabbedFilter.doFilter(TabbedFilter.java:44)

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

              at org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125)

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

              at com.lombardrisk.webgui.filter.ValidRequestFilter.doFilter(ValidRequestFilter.java:41)

              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:183)

              at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)

              at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:95)

              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.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.internalProcess(ActiveRequestResponseCacheValve.java:74)

              at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:47)

              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:599)

              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:451)

              at java.lang.Thread.run(Thread.java:662)

       

       

       

       

       

       

       

       

       

       

       

      ===================config========================

       

      1)occupying several lines literally

              <tx-connection-factory>

                      <jndi-name>JmsXA</jndi-name>

                      <xa-transaction />

                      <rar-name>jms-ra.rar</rar-name>

                      <connection-definition>

                              org.jboss.resource.adapter.jms.JmsConnectionFactory

                      </connection-definition>

                      <config-property name="SessionDefaultType" type="java.lang.String">

                              javax.jms.Topic</config-property>

                      <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">

                              java:/DefaultJMSProvider</config-property>

                      <max-pool-size>20</max-pool-size>

                      <security-domain-and-application>JmsXARealm

                      </security-domain-and-application>

              </tx-connection-factory>

       

       

      2)cat in one line

                <tx-connection-factory>

                  <jndi-name>JmsXA</jndi-name>

                  <xa-transaction />

                  <rar-name>jms-ra.rar</rar-name>

                  <connection-definition>org.jboss.resource.adapter.jms.JmsConnectionFactory</connection-definition>

                  <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Topic</config-property>

                  <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/DefaultJMSProvider</config-property>

                  <max-pool-size>20</max-pool-size>

                  <security-domain-and-application>JmsXARealm</security-domain-and-application>

                  <depends>jboss.messaging:service=ServerPeer</depends>

                </tx-connection-factory>