permaculture playing cards*
The moose likes JBoss/WildFly and the fly likes JMS ununderstable info logs. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "JMS ununderstable info logs." Watch "JMS ununderstable info logs." New topic
Author

JMS ununderstable info logs.

ray frid
Ranch Hand

Joined: Dec 23, 2010
Posts: 79
Hi all,
I am using jboss 5.1 and this is my first time iam trying to configure and use JMS via the admin console.

I have configured through the admin console the factory connection and Jms Queue. here is some code:



@Stateless
@Local(
{ RequestHandlerBeanLocal.class })
@LocalBinding(jndiBinding = "RequestHandlerBean")
public class RequestHandlerBean implements RequestHandlerBeanLocal
{
//CpLogger logger = CpLogger.getInstance();
private static final String TAG = "RequestHandlerBean:";

// for jms---------------

@Resource(mappedName = Constants.QUEUE_CONNECTION_FACTORY)
private QueueConnectionFactory conFactory;
private QueueConnection sendToEAIConnection;
private QueueSession sendToEAISession;
private QueueSender sendToEAISender;

@Resource(mappedName = Constants.SEND_TO_UDP_QUEUE)
private Queue sendToEAIQueue;



@Override
public void testMyJMS()
{
System.out.print("testMyJms");
// logger.debug("testMyJMS");
try
{
initSendToJMSQueue();

ObjectMessage sendToEAIMessage = sendToEAISession.createObjectMessage ();
sendToEAIMessage.setObject ("i am udp msg number one");
sendToEAISender.send (sendToEAIMessage);
} catch (JMSException e)
{
// TODO Auto-generated catch block
System.out.print(e.getMessage());
}

}

private void initSendToJMSQueue() throws JMSException
{

sendToEAIConnection = conFactory.createQueueConnection();
sendToEAISession = sendToEAIConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
sendToEAISender = sendToEAISession.createSender(sendToEAIQueue);

}

@PreDestroy
public void endBean ()
{
try {
sendToEAIConnection.close ();
}

catch (JMSException je){
//logger.error ("PMIJMSBean.endMDB An error occurred", je);
}
}

}


I can the counts being raised though the Admin Console of my queue. but I get some weird msgs in the console:


9:21:47,203 INFO [CachedConnectionManager] Closing a connection for you. Please close them yourself: org.jboss.resource.adapter.jms.JmsSession@7d97da
java.lang.Throwable: STACKTRACE
at org.jboss.resource.connectionmanager.CachedConnectionManager.registerConnection(CachedConnectionManager.java:278)
at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:524)
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.createQueueSession(JmsSessionFactoryImpl.java:145)
at com.mirs.ecms.beans.RequestHandlerBean.initSendToJMSQueue(RequestHandlerBean.java:87)
at com.mirs.ecms.beans.RequestHandlerBean.testMyJMS(RequestHandlerBean.java:70)
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.invokeTarget(MethodInvocation.java:122)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)
at org.jboss.ejb3.EJBContainerInvocationWrapper.invokeNext(EJBContainerInvocationWrapper.java:69)
at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.invoke(InterceptorSequencer.java:73)
at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.aroundInvoke(InterceptorSequencer.java:59)
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.advice.PerJoinpointAdvice.invoke(PerJoinpointAdvice.java:174)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.fillMethod(InvocationContextInterceptor.java:72)
at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_fillMethod_16058322.invoke(InvocationContextInterceptor_z_fillMethod_16058322.java)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.setup(InvocationContextInterceptor.java:88)
at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_setup_16058322.invoke(InvocationContextInterceptor_z_setup_16058322.java)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:62)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:56)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:68)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:190)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:186)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.session.SessionSpecContainer.invoke(SessionSpecContainer.java:176)
at org.jboss.ejb3.session.SessionSpecContainer.invoke(SessionSpecContainer.java:216)
at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:207)
at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:164)
at $Proxy258.testMyJMS(Unknown Source)
at StartUpServlet.<init>(StartUpServlet.java:35)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at org.jboss.web.tomcat.service.TomcatInjectionContainer.newInstance(TomcatInjectionContainer.java:264)
at org.jboss.web.tomcat.service.TomcatInjectionContainer.newInstance(TomcatInjectionContainer.java:256)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1006)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:777)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
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.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:598)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
09:21:56,750 INFO [BootstrapAction] Initializing Administration Console v1.2.0.GA...
09:21:58,515 WARN [SystemInfoFactory] System info API not accessible on this platform (native shared library not found in java.library.path).
09:21:58,750 INFO [PluginContainerResourceManager] Discovering Resources...
09:22:00,843 WARN [AbstractManagedObjectPopulator] Cannot create String name from non-Simple property: ManagedProperty{JNDIName,JNDIName,metaType=SimpleMetaType:java.lang.String}, value=null
09:22:00,859 WARN [AbstractManagedObjectPopulator] Cannot create String name from non-Simple property: ManagedProperty{JNDIName,JNDIName,metaType=SimpleMetaType:java.lang.String}, value=null
09:22:01,156 WARN [AbstractManagedObjectPopulator] Cannot create String name from non-Simple property: ManagedProperty{JNDIName,JNDIName,metaType=SimpleMetaType:java.lang.String}, value=null
09:22:16,984 INFO [Version] Hibernate Validator 3.1.0.GA
09:22:17,015 INFO [Version] Hibernate Commons Annotations 3.1.0.GA


Anyone please could tell me, how could I adjust my code to make it right? or what am I doing wrong?

thanks,

ray.

Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10069
    
163

As the INFO message says, you are not closing your JMS connection.

[My Blog] [JavaRanch Journal]
ray frid
Ranch Hand

Joined: Dec 23, 2010
Posts: 79
but I tried to use this:
@PreDestroy
public void endBean ()
{
try {
sendToEAIConnection.close ();
}

guess it never got any call. so I have to just removed the method sendToEAIConnection.close (); to here:

@Override
public void testMyJMS()
{
System.out.print("testMyJms");
// logger.debug("testMyJMS");
try
{
initSendToJMSQueue();

ObjectMessage sendToEAIMessage = sendToEAISession.createObjectMessage();
sendToEAIMessage.setObject("i am udp msg number one");
sendToEAISender.send(sendToEAIMessage);
sendToEAIConnection.close(); //added manually , working, but is logically right after each time I send msg to the que, i will close it right away?
} catch (JMSException e)
{
// TODO Auto-generated catch block
System.out.print(e.getMessage());
}

}


btw: the way I send my message to the que, is it right? coz now I get diffrent msgs in the console:

(just for the protocol, I use servlet from the webroot directory in order to trigger this method, and I get this msg:

10:29:04,734 WARN [SystemInfoFactory] System info API not accessible on this platform (native shared library not found in java.library.path).
10:29:05,203 INFO [PluginContainerResourceManager] Discovering Resources...
10:29:09,953 WARN [AbstractManagedObjectPopulator] Cannot create String name from non-Simple property: ManagedProperty{JNDIName,JNDIName,metaType=SimpleMetaType:java.lang.String}, value=null

thanks.



 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JMS ununderstable info logs.