-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 
Author Message
 Post subject: How to clear the annoying message from jboss ?
PostPosted: Sun Sep 14, 2003 8:53 pm 
Regular
Regular

Joined: Wed Sep 03, 2003 8:04 am
Posts: 55
hi,all

i am using hibernate in stateless session bean running in jboss-3.2.1_tomcat-4.1.24. It works very well however jboss always reports the following error :

08:45:37,983 INFO [CachedConnectionManager] Successfully closed a connection for you. Please close them yourself: org.jboss.resource.adapter.jdbc.WrappedConnection@1ea25aa
java.lang.Exception: Stack Trace
at org.jboss.resource.connectionmanager.CachedConnectionManager.closeAll
(CachedConnectionManager.java:376)
at org.jboss.resource.connectionmanager.CachedConnectionManager.popMetaA
wareObject(CachedConnectionManager.java:199)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invo
ke(CachedConnectionInterceptor.java:190)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(Stat
elessSessionInstanceInterceptor.java:72)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte
rceptor.java:84)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
torCMT.java:243)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:1
04)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.
java:117)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFacto
ryFinderInterceptor.java:122)
at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessi
onContainer.java:322)
at org.jboss.ejb.Container.invoke(Container.java:674)
at sun.reflect.GeneratedMethodAccessor57.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
nDispatcher.java:284)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:101)
at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.jav
a:83)
at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.
java:46)
at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:4
5)
at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessi
onInterceptor.java:100)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:85)
at $Proxy37.getDeviceByLocation(Unknown Source)
at com.omnet.web.DeviceServlet.doGet(DeviceServlet.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:193)
at com.omnet.web.SetEncodingFilter.doFilter(SetEncodingFilter.java:30)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:213)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:256)

i have posted it before but got no answer :(


any suggestion is appreciated !


Top
 Profile  
 
 Post subject: why no answer for a long time ?
PostPosted: Wed Sep 17, 2003 12:18 am 
Regular
Regular

Joined: Wed Sep 03, 2003 8:04 am
Posts: 55
hi,sir

donot you encounter such a question ? jboss reports it at intervals :(

what should i do to clear it ?


thanks in advance !


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 17, 2003 10:39 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
Most likely you are either:
1) Calling one session bean from another; or
2) Not closing the Hibernate session prior to leaving the session bean

If #1, there is supposedly a way to configure JBoss to ignore this. But I don't use jboss and don't begin to understand why it reports this let alone how to perform the config. Here is a thread in which this is dicussed:http://forum.hibernate.org/viewtopic.php?p=504 Another option here would be to make sure that the session has a connection prior to making nested ejb call (the session lazily gets the jdbc connection only when its actually needed).

If #2, close the session.


Top
 Profile  
 
 Post subject: thanks ,more information ...
PostPosted: Wed Sep 17, 2003 8:23 pm 
Regular
Regular

Joined: Wed Sep 03, 2003 8:04 am
Posts: 55
thanks for your answer first.Here is our architecture:

servlet-------->SLSB---------->hibernate------------>MySQL


up to now the session beans donot call each other.The code snippet is as below:

public String getDevClass(String id) throws OMException
{
StringWriter result = new StringWriter();
Session sess = null;
try {
sess = sf.openSession();
Marshaller marshaller = new Marshaller(result);

com.omnet.bean.DevClass dc = (com.omnet.bean.DevClass)sess.load(com.omnet.bean.DevClass.class,
new Integer(id)
);
marshaller.marshal(dc);
sess.close(); //close it before return from any methods
}
catch(Exception e) {
throw new OMException(e);
}
return result.toString();
}

the SessionFactory is gotten as bebow:

public void setSessionContext(SessionContext sessionContext)
{
this.sessionContext = sessionContext;

Context ctx = null;
try {
ctx = new InitialContext();
sf = (SessionFactory) ctx.lookup("java:/hibernate/HibernateFactory");
}
catch (NamingException ex) {
ex.printStackTrace();
}
}

regards!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 17, 2003 9:04 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
Two things:

1) If an excption were to occurr in this processing, the sess.close() call would never occur. Move this to a finally block. In that situation, it would cause JBoss to complain because you opened a JDBC connection during execution of this session bean which you then did not close.

Code:
Session sess = null;
    try
    {
        sess = sf.openSession();
        ....
    }
    catch(Exception e)
    {
        ...
    }
    finally
    {
        if (sess != null)
        {
            try
            {
                sess.close();
            }
            catch(Exception ignore)
            {}
        }
    }


2) What does constructor for Marshaller do?


Did you even try what was suggested in the post I pain-stakingly looked up for you?


Top
 Profile  
 
 Post subject: I will try...
PostPosted: Wed Sep 17, 2003 9:30 pm 
Regular
Regular

Joined: Wed Sep 03, 2003 8:04 am
Posts: 55
Quote:
If an excption were to occurr in this processing, the sess.close() call would never occur. Move this to a finally block. In that situation, it would cause JBoss to complain because you opened a JDBC connection during execution of this session bean which you then did not close.


ok, i will add finally block and hope jboss will not complain

Quote:
What does constructor for Marshaller do?


Marshaller marshaller = new Marshaller(result);

Marshaller, which is from castor, is used to create xml data from java bean.The constructor does nothing but acccept a StringWriter used to write the xml result. After finishing marshalling i can get the xml from result.toString() call.


Quote:
Did you even try what was suggested in the post I pain-stakingly looked up for you?

Of course !


thanks again ![/quote]


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.