Hi.

I;m experiencing some passivation problems when i try to remove many cmp
beans.

using jboss 2.4 / embedded tomcat / sqlserver7 

The errors i get are listed below.

You'll notice that just before the IllegalArgumentException error i'm trying
to remove an entity using the container.remove(). I have also supplied part
of business method in my session bean where the problem is caused.;

PLEASE HELP! i'm not sure whats causing it or how to solve it! Thanks!

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>> server.log snippet >>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
[JAWS] findBySurveyQuestionsId command executing: SELECT
SURVEY_QUESTIONS_ANSWERS.SURVEY_QUESTIONS_ANSWERS_ID FROM
SURVEY_QUESTIONS_ANSWERS where SURVEY_QUESTIONS_ID=?
[JAWS] Set parameter: idx=1, jdbcType=INTEGER, value=19
[Default] [DEBUG]: -- sqarecs.size() = 3
[SurveyQuestionsAnswers] Activated bean SurveyQuestionsAnswers with id = 25
[JAWS] Load command executing: SELECT
SURVEY_QUESTIONS_ANSWERS.SURVEY_QUESTIONS_ANSWERS_ID,SURVEY_QUESTIONS_ANSWER
S.SURVEY_QUESTIONS_ANSWERS_TEXT,SURVEY_QUESTIONS_ANSWERS.SURVEY_QUESTIONS_ID
FROM SURVEY_QUESTIONS_ANSWERS WHERE SURVEY_QUESTIONS_ANSWERS_ID=?
[JAWS] Set parameter: idx=1, jdbcType=INTEGER, value=25
[SurveyQuestionsAnswers] Scheduled passivation of bean
SurveyQuestionsAnswers with id = 25
[Default] [DEBUG]: -- surveyId=10
[Default] [DEBUG]: -- surveyQuestionsId=19
[Default] [DEBUG]: -- surveyQuestionsAnswersId=25
[Default] [DEBUG]: -- about to remove sqa record
[JAWS] Remove command executing: DELETE FROM SURVEY_QUESTIONS_ANSWERS WHERE
SURVEY_QUESTIONS_ANSWERS_ID=?
[JAWS] Set parameter: idx=1, jdbcType=INTEGER, value=25
[Container factory] Postponed passivation of bean SurveyQuestionsAnswers
with id = 25
[JAWS] Rows affected = 1
[Default] [DEBUG]: -- removed sqa record
[SurveyQuestionsAnswers] TRANSACTION ROLLBACK EXCEPTION:Requesting an object
using a null key; nested exception is: 
        java.lang.IllegalArgumentException: Requesting an object using a
null key
[SurveyQuestionsAnswers] java.lang.IllegalArgumentException: Requesting an
object using a null key
[SurveyQuestionsAnswers]        at
org.jboss.util.LRUCachePolicy.peek(LRUCachePolicy.java:133)
[SurveyQuestionsAnswers]        at
org.jboss.ejb.plugins.AbstractInstanceCache.insert(AbstractInstanceCache.jav
a:200)
[SurveyQuestionsAnswers]        at
org.jboss.ejb.plugins.AbstractInstanceCache.get(AbstractInstanceCache.java:1
80)
[SurveyQuestionsAnswers]        at
org.jboss.ejb.plugins.EntityInstanceCache.get(EntityInstanceCache.java:60)
[SurveyQuestionsAnswers]        at
org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterce
ptor.java:151)
[SurveyQuestionsAnswers]        at
org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:133)
[SurveyQuestionsAnswers]        at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.
java:307)
[SurveyQuestionsAnswers]        at
org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:99)
[SurveyQuestionsAnswers]        at
org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:12
8)
[SurveyQuestionsAnswers]        at
org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:195)
[SurveyQuestionsAnswers]        at
org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:349)
[SurveyQuestionsAnswers]        at
org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerI
nvoker.java:483)
[SurveyQuestionsAnswers]        at
org.jboss.ejb.plugins.jrmp.interfaces.GenericProxy.invokeContainer(GenericPr
oxy.java:335)
[SurveyQuestionsAnswers]        at
org.jboss.ejb.plugins.jrmp.interfaces.EntityProxy.invoke(EntityProxy.java:13
3)
[SurveyQuestionsAnswers]        at
$Proxy65.getSurveyQuestionsAnswersId(Unknown Source)
[SurveyQuestionsAnswers]        at
com.atomicmedia.totalpromoter.ejb.session.promo.PromoSurveysEJB.saveSurveys(
PromoSurveysEJB.java:110)
[SurveyQuestionsAnswers]        at java.lang.reflect.Method.invoke(Native
Method)
[SurveyQuestionsAnswers]        at
org.jboss.ejb.StatefulSessionContainer$ContainerInterceptor.invoke(StatefulS
essionContainer.java:650)
[SurveyQuestionsAnswers]        at
org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:12
8)
[SurveyQuestionsAnswers]        at
org.jboss.ejb.plugins.TxInterceptorBMT.invoke(TxInterceptorBMT.java:276)
[SurveyQuestionsAnswers]        at
org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invoke(StatefulSess
ionInstanceInterceptor.java:209)
[SurveyQuestionsAnswers]        at
org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:195)
[SurveyQuestionsAnswers]        at
org.jboss.ejb.StatefulSessionContainer.invoke(StatefulSessionContainer.java:
341)
[SurveyQuestionsAnswers]        at
org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerI
nvoker.java:393)
[SurveyQuestionsAnswers]        at
org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerI
nvoker.java:470)
[SurveyQuestionsAnswers]        at
org.jboss.ejb.plugins.jrmp.interfaces.GenericProxy.invokeContainer(GenericPr
oxy.java:335)
[SurveyQuestionsAnswers]        at
org.jboss.ejb.plugins.jrmp.interfaces.StatefulSessionProxy.invoke(StatefulSe
ssionProxy.java:136)
[SurveyQuestionsAnswers]        at $Proxy70.saveSurveys(Unknown Source)
[SurveyQuestionsAnswers]        at
com.atomicmedia.totalpromoter.lib.company.Survey.saveSurveys(Survey.java:671
)
[SurveyQuestionsAnswers]        at
mydetails._0002fmydetails_0002fhandler_0002ejsphandler_jsp_44._jspService(_0
002fmydetails_0002fhandler_0002ejsphandler_jsp_44.java:232)
[SurveyQuestionsAnswers]        at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
[SurveyQuestionsAnswers]        at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
[SurveyQuestionsAnswers]        at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
va:177)
[SurveyQuestionsAnswers]        at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
[SurveyQuestionsAnswers]        at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
[SurveyQuestionsAnswers]        at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
[SurveyQuestionsAnswers]        at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
[SurveyQuestionsAnswers]        at
org.apache.tomcat.core.Handler.service(Handler.java:286)
[SurveyQuestionsAnswers]        at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
[SurveyQuestionsAnswers]        at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
7)
[SurveyQuestionsAnswers]        at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
[SurveyQuestionsAnswers]        at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:210)
[SurveyQuestionsAnswers]        at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
[SurveyQuestionsAnswers]        at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
[SurveyQuestionsAnswers]        at java.lang.Thread.run(Unknown Source)
[Default] [DEBUG]: Exception in getting surveyQuestionsAnswers in
EntrantEJB.saveSurveys(): [Exception]:
javax.transaction.TransactionRolledbackException: Requesting an object using
a null key; nested exception is: 
        java.lang.IllegalArgumentException: Requesting an object using a
null key
[Default] [DEBUG]: Exception in getting surveyQuestions in
EntrantEJB.saveSurveys(): [Exception]: java.lang.Exception:
javax.transaction.TransactionRolledbackException: Requesting an object using
a null key; nested exception is: 
        java.lang.IllegalArgumentException: Requesting an object using a
null key
[Default] [DEBUG]: Exception in getting surveys in EntrantEJB.saveSurveys():
[Exception]: java.lang.Exception: java.lang.Exception:
javax.transaction.TransactionRolledbackException: Requesting an object using
a null key; nested exception is: 
        java.lang.IllegalArgumentException: Requesting an object using a
null key
[Default] [DEBUG]: Exception in Survey.saveSurveys(): [Exception]:
java.lang.Exception: java.lang.Exception: java.lang.Exception:
javax.transaction.TransactionRolledbackException: Requesting an object using
a null key; nested exception is: 
        java.lang.IllegalArgumentException: Requesting an object using a
null key
[EmbeddedTomcatSX] 2001-09-13 08:59:01 - Ctx( /totalpromoterdev ): Exception
in: R( /totalpromoterdev + /mydetails/handler.jsp + null) -
javax.servlet.ServletException: java.lang.Exception: java.lang.Exception:
java.lang.Exception: javax.transaction.TransactionRolledbackException:
Requesting an object using a null key; nested exception is: 
        java.lang.IllegalArgumentException: Requesting an object using a
null key
        at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
l.java:459)
        at
mydetails._0002fmydetails_0002fhandler_0002ejsphandler_jsp_44._jspService(_0
002fmydetails_0002fhandler_0002ejsphandler_jsp_44.java:249)
        at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
va:177)
        at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
        at org.apache.tomcat.core.Handler.service(Handler.java:286)
        at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
        at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
7)
        at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
        at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:210)
        at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
        at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
        at java.lang.Thread.run(Unknown Source)
Root cause:
java.lang.Exception: java.lang.Exception: java.lang.Exception:
java.lang.Exception: javax.transaction.TransactionRolledbackException:
Requesting an object using a null key; nested exception is: 
        java.lang.IllegalArgumentException: Requesting an object using a
null key
        at
com.atomicmedia.totalpromoter.lib.company.Survey.saveSurveys(Survey.java:681
)
        at
mydetails._0002fmydetails_0002fhandler_0002ejsphandler_jsp_44._jspService(_0
002fmydetails_0002fhandler_0002ejsphandler_jsp_44.java:232)
        at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
va:177)
        at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
        at org.apache.tomcat.core.Handler.service(Handler.java:286)
        at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
        at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
7)
        at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
        at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:210)
        at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
        at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
        at java.lang.Thread.run(Unknown Source)


>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>> my code snippet - Its a session bean called from a normal java class
via jsp page>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    /** business methods */
        public void saveSurveys(Integer companyId, Vector surveysArray)
throws Exception
        {
                Debug.out("Start PromoSurveysEJB.saveSurveys()");

                InitialContext ctx = new InitialContext();
                Integer surveyId                 = null;
                Integer surveyQuestionsId        = null;
                Integer surveyQuestionsAnswersId = null;
                String  surveyQuestionsType      = null;

                // first remove all the survey information
                try
                {
                        // get all surveys records for company id
                        SurveysHome sHome = (SurveysHome)
ctx.lookup("promotion/Surveys");
                        Collection srecs = sHome.findByCompanyId(companyId);

Debug.out("-- srecs.size() = " + srecs.size());
                        for (Iterator i = srecs.iterator(); i.hasNext();)
                        {
                                Surveys s = (Surveys) i.next();
                                surveyId = s.getSurveysId();
Debug.out("-- surveyId="+surveyId.toString());

                                // get all the surveyQuestions records for
the current surveys record
                                try
                                {
                                        SurveyQuestionsHome sqHome =
(SurveyQuestionsHome) ctx.lookup("promotion/SurveyQuestions");
                                        Collection sqrecs =
sqHome.findBySurveysId(surveyId);

Debug.out("-- sqrecs.size() = " + sqrecs.size());
                                        for (Iterator i2 =
sqrecs.iterator(); i2.hasNext();)
                                        {

                                                SurveyQuestions sq =
(SurveyQuestions) i2.next();
                                                surveyQuestionsId =
sq.getSurveyQuestionsId();
                                                surveyQuestionsType =
sq.getSurveyQuestionsType();

Debug.out("-- surveyId="+surveyId.toString());
Debug.out("-- surveyQuestionsId="+surveyQuestionsId.toString());
Debug.out("-- surveyQuestionsType="+surveyQuestionsType);
                                                // get all the
surveyQuestionsAnswers records for the current surveyQuestions record
                                                // only if the
sqrs.surveyQuestionsType.equals("MULTI")
                                                if
(surveyQuestionsType.equals(TPConstant.SURVEY_QUESTIONS_TYPE_MULTI))
                                                {
                                                        try
                                                        {
        
SurveyQuestionsAnswersHome sqaHome = (SurveyQuestionsAnswersHome)
ctx.lookup("promotion/SurveyQuestionsAnswers");
                                                                Collection
sqarecs = sqaHome.findBySurveyQuestionsId(surveyQuestionsId);

Debug.out("-- sqarecs.size() = " + sqarecs.size());
                                                                for
(Iterator i3 = sqarecs.iterator(); i3.hasNext();)
                                                                {
        
SurveyQuestionsAnswers sqa = (SurveyQuestionsAnswers) i3.next();
                                                                        //
remove the surveyQuestionsAnswers record
        
surveyQuestionsAnswersId = sqa.getSurveyQuestionsAnswersId();
Debug.out("-- surveyId="+surveyId.toString());
Debug.out("-- surveyQuestionsId="+surveyQuestionsId.toString());
Debug.out("--
surveyQuestionsAnswersId="+surveyQuestionsAnswersId.toString());
Debug.out("-- about to remove sqa record");
        
sqa.remove();
Debug.out("-- removed sqa record");
                                                                }

                                                        }
                                                        catch
(FinderException fe)
                                                        {
        
Debug.out("-- FinderException in getting surveyQuestionsAnswers in
EntrantEJB.saveSurveys(): [FinderException]: " + fe.toString());
                                                                // do
nothing
                                                        }
                                                        catch (Exception ex)
                                                        {
        
Debug.out("Exception in getting surveyQuestionsAnswers in
EntrantEJB.saveSurveys(): [Exception]: " + ex.toString());
                                                                throw new
Exception(ex.toString());
                                                        }
                                                }
                                                // remove the
surveyQuestions record
Debug.out("-- about to remove sq record");
                                                sq.remove();
Debug.out("-- removed sq record");
                                        }
                                }
                                catch (FinderException fe)
                                {
                                        Debug.out("FinderException in
getting surveyQuestions in EntrantEJB.saveSurveys(): [FinderException]: " +
fe.toString());
                                        // do nothing
                                }
                                catch (Exception ex)
                                {
                                        Debug.out("Exception in getting
surveyQuestions in EntrantEJB.saveSurveys(): [Exception]: " +
ex.toString());
                                        throw new Exception(ex.toString());
                                }

                                // remove the surveys record
Debug.out("-- about to remove s record");
                                s.remove();
Debug.out("-- removed s record");
                        }

                }
                catch (FinderException fe)
                {
                        Debug.out("FinderException in getting surveys
EntrantEJB.saveSurveys(): [FinderException]: " + fe.toString());
                        throw new Exception(fe.toString());
                }
                catch (Exception ex)
                {
                        Debug.out("Exception in getting surveys in
EntrantEJB.saveSurveys(): [Exception]: " + ex.toString());
                        throw new Exception(ex.toString());
                }
and so on...


Chris Tragas
-----------------------------------------
[EMAIL PROTECTED]
-----------------------------------------
www.atomicmedia.com
-----------------------------------------




_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to