[Installation, Configuration & Deployment] - Re: javax.resource.spi.SecurityException
by nsv
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>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3990930#3990930
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3990930
18 years, 1 month
[Installation, Configuration & Deployment] - Re: javax.resource.spi.SecurityException
by nsv
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
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3990926#3990926
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3990926
18 years, 1 month