1 2 Previous Next 18 Replies Latest reply on Dec 7, 2006 6:57 AM by cypnsv

    javax.resource.spi.SecurityException

    cypnsv

      Hi

      I get an error "No Password credentials found" in jboss when i try to initialize

      Please tell me where i can set the password credentials?

      Thanks
      Vishnu

        • 1. Re: javax.resource.spi.SecurityException
          cypnsv

          i am actually sending message a queue

          • 2. Re: javax.resource.spi.SecurityException
            jaikiran

            When do you see this error? Is it during JBoss startup? Post the entire exception stacktrace that you are seeing and also provide more details about your application

            • 3. Re: javax.resource.spi.SecurityException
              cypnsv

              Below is the stack trace

              2006-12-04 15:02:51,705 DEBUG [org.jboss.mq.referenceable.SpyDestinationObjectFactory] SpyDestinationObjectFactory->getObjectInstance()
              2006-12-04 15:02:51,705 DEBUG [com.tlc.jms.Destination] Exiting initializeConnections()...
              2006-12-04 15:02:51,705 DEBUG [com.tlc.jms.Destination] Connected to Destination: queue/AlarmMgrRecvQueue and Factory: java:AlarmMgrConnectionFactory
              2006-12-04 15:02:51,705 DEBUG [com.tlc.jms.Destination] Connected. Exiting init(String)...
              2006-12-04 15:02:51,705 DEBUG [com.tlc.jms.Sender] Entering initSender()...
              2006-12-04 15:02:51,705 DEBUG [com.tlc.jms.Sender] Creating Queue Session...
              2006-12-04 15:02:51,705 DEBUG [com.tlc.jms.ConnectionWrapper] Entering createQueueSession()...
              2006-12-04 15:02:51,705 DEBUG [com.tlc.jms.ConnectionWrapper] Exiting createQueueSession()...
              2006-12-04 15:02:51,705 DEBUG [org.jboss.resource.connectionmanager.IdleRemover] internalRegisterPool: registering pool with interval 900000 old interval: 450000
              2006-12-04 15:02:51,705 WARN [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] Throwable while attempting to get a new connection: null
              javax.resource.spi.SecurityException: No Password credentials found
               at org.jboss.resource.adapter.jms.JmsCred.getJmsCred(JmsCred.java:75)
               at org.jboss.resource.adapter.jms.JmsManagedConnectionFactory.createManagedConnection(JmsManagedConnectionFactory.java:101)
               at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:539)
               at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:228)
               at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:417)
               at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:324)
               at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:301)
               at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:379)
               at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:812)
               at org.jboss.resource.adapter.jms.JmsSessionFactoryImpl.allocateConnection(JmsSessionFactoryImpl.java:389)
               at org.jboss.resource.adapter.jms.JmsSessionFactoryImpl.createQueueSession(JmsSessionFactoryImpl.java:144)
               at com.tlc.jms.ConnectionWrapper.createQueueSession(ConnectionWrapper.java:63)
               at com.tlc.jms.Sender.initSender(Sender.java:162)
               at com.tlc.jms.Sender.init(Sender.java:120)
               at com.tlc.re.AlarmAction.init(AlarmAction.java:86)
               at com.tlc.re.AlarmAction.<init>(AlarmAction.java:45)
               at com.tlc.re.RuleContext.jsFunction_createAlarmAction(RuleContext.java:157)
               at inv20.invoke()
               at org.mozilla.javascript.FunctionObject.doInvoke(FunctionObject.java:498)
               at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:413)
               at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1191)
               at org.mozilla.javascript.gen.c3.call(...:194)
               at org.mozilla.javascript.optimizer.OptRuntime.callSimple(OptRuntime.java:275)
               at org.mozilla.javascript.gen.c25.call(Case-Related Event Rules:30)
               at org.mozilla.javascript.gen.c25.exec(Case-Related Event Rules)
               at com.tlc.re.Rule.execute(Rule.java:80)
               at com.tlc.re.RuleSet.execute(RuleSet.java:109)
               at com.tlc.re.RuleEngine.execute(RuleEngine.java:301)
               at com.tlc.re.RuleEngine.exec(RuleEngine.java:339)
               at com.tlc.re.RuleEngine.exec(RuleEngine.java:325)
               at com.tlc.event.EventManager.onMessage(EventManager.java:111)
               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:585)
               at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
               at org.jboss.ejb.MessageDrivenContainer$ContainerInterceptor.invoke(MessageDrivenContainer.java:495)
               at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158)
               at org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor.invoke(MessageDrivenInstanceInterceptor.java:116)
               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 org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSecurityInterceptor.java:109)
               at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
               at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:136)
               at org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDrivenContainer.java:402)
               at org.jboss.ejb.Container.invoke(Container.java:954)
               at org.jboss.ejb.plugins.jms.JMSContainerInvoker.invoke(JMSContainerInvoker.java:987)
               at org.jboss.ejb.plugins.jms.JMSContainerInvoker$MessageListenerImpl.onMessage(JMSContainerInvoker.java:1287)
               at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:266)
               at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:902)
               at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:170)
               at org.jboss.mq.SpySession.run(SpySession.java:323)
               at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:194)
               at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:748)
               at java.lang.Thread.run(Thread.java:595)
              2006-12-04 15:02:51,705 ERROR [org.jboss.resource.adapter.jms.JmsSessionFactoryImpl] could not create session



              I think this is the issue with JMStemplate, How can i create a jmstemplate in jboss

              Thanks for the quick response
              -Vishnu

              • 4. Re: javax.resource.spi.SecurityException
                jaikiran

                Is your queue secured? Which API are you using on the QueueConnectionFactory to create a queue session, is it the one which accepts the user name and password? Can you post the code where you are doing this?

                • 5. Re: javax.resource.spi.SecurityException
                  cypnsv

                  Below is the java file AlarmAction.java

                  i have also added the

                  public class AlarmAction implements Action {
                   private static final String JMS_ALARM_CFG = "AlarmMgrRecvQueue.xml";
                   private static Category logger = Category.getInstance(AlarmAction.class.getName());
                   private static Sender eventSender;
                   private static boolean initialized = false;
                  
                   private HashMap map = null;
                  
                   public AlarmAction(String cid) {
                   map = new HashMap();
                   map.put("CID", cid);
                   if (!initialized) {
                   try {
                   init();
                   initialized = true;
                   }
                   catch (Exception e) {
                   // ignore - it'll be detected later in act()
                   logger.error(Utility.getStackTrace(e));
                   }
                   }
                   }
                  
                   public void setExpiration(Date d) {
                   map.put("TIMESTAMP", d);
                   }
                  
                   public void setUserId(String uid) {
                   map.put("USERID", uid);
                   }
                  
                   public void setEventObject(Object o) {
                   String key = "EventObject";
                   if (o instanceof WFWorkItem) {
                   WFWorkItem wfwi = (WFWorkItem)o;
                   String id = (new Long(wfwi.getId())).toString();
                   WFWorkItemRef wfwir = new WFWorkItemRef(id);
                   map.put(key, wfwir);
                   }
                   else {
                   map.put(key, o);
                   }
                   }
                  
                   public void addProperty(String key, Object value) {
                   if (key != null)
                   map.put(key, value);
                   }
                  
                   private synchronized void init() throws Exception {
                   logger.debug("In init()...");
                   Properties globalProps = Utility.getTLProps(true);
                   String tl_dom = globalProps.getProperty("tl_domain");
                   eventSender = new Sender();
                   if (eventSender.init(tl_dom + "/" + JMS_ALARM_CFG) == false)
                   throw new TLException("Could not initialize Sender for: " + JMS_ALARM_CFG);
                   eventSender.start();
                   }
                  
                   /**
                   *
                   * This evaluates every value in the stored HashMap, creates an ObjectMessage of type MSG_ADD_ALARM,
                   * and passes it to the AlarmMnager's queue.
                   *
                   */
                   public void act() throws REException {
                   try {
                   if (!initialized)
                   throw new REException("Not initialized.");
                  
                   if (map.get("TIMESTAMP") == null || map.get("EventObject") == null)
                   throw new REException("Properties not set properly");
                  
                   ObjectMessage omsg = null;
                  
                   synchronized (eventSender) {
                   omsg = eventSender.getObjectMessage();
                   omsg.setStringProperty(AlarmManager.MSGTYPE, AlarmManager.MSG_ADD_ALARM);
                   omsg.setObject(map);
                   eventSender.sendObjectMessage(omsg);
                   }
                   }
                   catch (Exception e) {
                   logger.error(Utility.getStackTrace(e));
                   throw new REException(e.getMessage());
                   }
                   }
                  }
                  



                  below is the AlarmMgrRecvQueue.xml which is used in the above java file

                  <!DOCTYPE JMSConfig SYSTEM "JMSConfig.dtd">
                  
                  <JMSConfig>
                   <Destination
                   destType="queue"
                   providerURL="jnp://localhost:3099"
                   connFactoryJNDIName="java:AlarmMgrConnectionFactory"
                   destJNDIName="queue/AlarmMgrRecvQueue"
                   timeToLive="1000000"
                   receiveTimeout="1000"
                  
                   />
                  </JMSConfig>


                  • 6. Re: javax.resource.spi.SecurityException
                    cypnsv

                    This code is working fine on weblogic , we migrated from weblogic to jboss

                    I think this queue is secured

                    • 7. Re: javax.resource.spi.SecurityException
                      jaikiran

                       

                      <!DOCTYPE JMSConfig SYSTEM "JMSConfig.dtd">
                      
                      <JMSConfig>
                       <Destination
                       destType="queue"
                       providerURL="jnp://localhost:3099"
                       connFactoryJNDIName="java:AlarmMgrConnectionFactory"
                       destJNDIName="queue/AlarmMgrRecvQueue"
                       timeToLive="1000000"
                       receiveTimeout="1000"
                      
                       />
                      </JMSConfig>


                      Pardon my ignorance, but i havent seen such a JMSConfig file before in JBoss.

                      • 8. Re: javax.resource.spi.SecurityException
                        cypnsv

                        Any updated please

                        • 9. Re: javax.resource.spi.SecurityException
                          cypnsv

                          i checked the queue and the queue is secured

                          can you tell me about creating jmstemplate in jboss

                          • 10. Re: javax.resource.spi.SecurityException
                            cypnsv

                            but i have an other xml file in the same format for Topic and it works fine

                            • 11. Re: javax.resource.spi.SecurityException
                              cypnsv

                              any updates.

                              • 12. Re: javax.resource.spi.SecurityException
                                cypnsv

                                Hi

                                Actual error is from

                                public QueueSession createQueueSession(boolean transacted,
                                 int acknowledgeMode) throws JMSException {
                                
                                 cat.debug("Entering createQueueSession()...");
                                 try {
                                 QueueConnection qcon = (QueueConnection) conn;
                                 cat.debug("Exiting createQueueSession()...");
                                 return qcon.createQueueSession(transacted, acknowledgeMode);
                                 } catch (ClassCastException e) {
                                 cat.debug(e.toString());
                                 throw new JMSException("Invalid Connection object");
                                 }
                                 }


                                return qcon.createQueueSession(transacted, acknowledgeMode); line generates exception



                                • 13. Re: javax.resource.spi.SecurityException
                                  cypnsv

                                  Hi

                                  I got the "No Password credentials" exception fixed

                                  solution was to remove the <security-domain-and-application>JmsXARealm</security-domain-and-application>

                                  from connectionfactory declaration in jms-ds.xml in server\default\deploy\jms directory

                                   <tx-connection-factory>
                                   <jndi-name>AlarmMgrConnectionFactory</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.Queue</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>


                                  Thanks for all you help

                                  -Vishnu

                                  • 14. Re: javax.resource.spi.SecurityException
                                    cypnsv

                                    i have problem with my jms client

                                    I get a error when i try to get queue from the lookup in the client program

                                    java.lang.ClassCastException: javax.naming.Reference
                                    

                                    I found on the site this error and the fix was to have the below jar files in the classpath

                                    messagingClient.jar
                                    naming.jar
                                    namingClient.jar
                                    ecutils.jar

                                    can you please tell me where can i find the above jar files in jboss.

                                    Please help....

                                    1 2 Previous Next