geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mario Kofler" <mario.kof...@gmail.com>
Subject Re: Geronimo 2.0.2 - OpenEJB "Passivation Failed"
Date Mon, 25 Feb 2008 21:07:21 GMT
2008/2/25, Jacek Laskowski <jacek@laskowski.net.pl>:
>
> On Mon, Feb 25, 2008 at 12:20 PM, Mario Kofler <mario.kofler@gmail.com>
> wrote:
>
> > so there is a simple reason why i  decided to close the entity manager
> > explicitely: because i thought it is a good idea ;)
>
>
> And you didn't get any exception?! It's disallowed to play with server
> managed resources and close them just like you tried to do. The reason
> people are still using EJB3 and all the Java EE 5 stack is their
> simplicity (or attempt to be simple) as far as resources are
> concerned. You just use them and don't have to worry about managing
> them - that's the role of Geronimo or other less-feature-rich
> application servers ;-) Use it and when you're done forget about them.
> Geronimo takes care of them for you.
>
> >                 em.flush();
>
> Don't do that. Forget about managing resources by yourself and let
> Geronimo do that for you. Besides, it's also not recommended unless
> you're using RESOURCE_LOCAL PU which is not recommended in the managed
> environment like Geronimo either.


i think there was some reason why i called em.flush() but i commented it out
now and it seems to work fine too. if i run into some problem i will tell ;)

Show us the persistence.xml. Let's make it better/simpler/shorter
> (cross out or add any word you'd like to hear about your app ;-)). The
> less you write it's better for your app. That's why Geronimo (or other
> Java EE 5 app servers) are for.



ok thanks here is my persistence.xml:

<persistence xmlns="http://java.sun.com/xml/ns/persistence"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
             version="1.0">
  <persistence-unit name="valhalla" transaction-type="JTA">
    <description>videothek</description>
    <provider>org.apache.openjpa.persistence.PersistenceProviderImpl
</provider>
    <class>vt.bean.entity.Person</class>
    <class>vt.bean.entity.Actor</class>
    <class>vt.bean.entity.Director</class>
    <class>vt.bean.entity.Movie</class>
    <class>vt.bean.entity.Dvd</class>

    <properties>

      <property name="openjpa.jdbc.DBDictionary" value="postgres"/>

    </properties>
    <jta-data-source>jdbc/postgres</jta-data-source>
    <non-jta-data-source>jdbc/postgres</non-jta-data-source>
  </persistence-unit>
</persistence>

it took me some configuration time to get it working this way and i think it
is already as short as it can get ;)

so another thing is when i keep calling the bean repeatedly to insert 1
director per transaction as in a performance test after about 100 inserts it
is the first time i get an exception. the server continues inserting to the
db but the exception is coming every now and then.. i wonder what it means..
i don't want to just throw exceptions here, but maybe you see it with one
eye, taking a short look.. thanks in anyway, here is the stacktrace:

     [exec] EM created!
     [exec] Write of 1 Directors successful!
     [exec] EM created!
     [exec] Write of 1 Directors successful!
     [exec] EM created!
     [exec] Write of 1 Directors successful!
     [exec] javax.naming.NamingException: Could not look up :
ejb/WriteDataBean [Root exception is
java.lang.reflect.UndeclaredThrowableException]
     [exec]     at org.apache.xbean.naming.context.ContextUtil.resolve(
ContextUtil.java:65)
     [exec]     at org.apache.xbean.naming.context.AbstractContext.lookup(
AbstractContext.java:118)
     [exec]     at org.apache.xbean.naming.context.AbstractContext.lookup(
AbstractContext.java:617)
     [exec]     at org.apache.xbean.naming.context.AbstractContext.lookup(
AbstractContext.java:158)
     [exec]     at org.apache.xbean.naming.context.AbstractContext.lookup(
AbstractContext.java:617)
     [exec]     at org.apache.xbean.naming.context.AbstractContext.lookup(
AbstractContext.java:158)
     [exec]     at org.apache.xbean.naming.context.AbstractContext.lookup(
AbstractContext.java:603)
     [exec]     at javax.naming.InitialContext.lookup(InitialContext.java
:392)
     [exec]     at vt.servlet.AddServlet.doGet(AddServlet.java:46)
     [exec]     at javax.servlet.http.HttpServlet.service(HttpServlet.java
:693)
     [exec]     at javax.servlet.http.HttpServlet.service(HttpServlet.java
:806)
     [exec]     at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
ApplicationFilterChain.java:290)
     [exec]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(
ApplicationFilterChain.java:206)
     [exec]     at org.apache.catalina.core.StandardWrapperValve.invoke(
StandardWrapperValve.java:230)
     [exec]     at org.apache.catalina.core.StandardContextValve.invoke(
StandardContextValve.java:175)
     [exec]     at
org.apache.geronimo.tomcat.valve.DefaultSubjectValve.invoke(
DefaultSubjectValve.java:56)
     [exec]     at
org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMethodValve.invoke(
GeronimoStandardContext.java:353)
     [exec]     at
org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.invoke(
GeronimoBeforeAfterValve.java:47)
     [exec]     at org.apache.catalina.core.StandardHostValve.invoke(
StandardHostValve.java:128)
     [exec]     at org.apache.catalina.valves.ErrorReportValve.invoke(
ErrorReportValve.java:104)
     [exec]     at org.apache.catalina.core.StandardEngineValve.invoke(
StandardEngineValve.java:109)
     [exec]     at org.apache.catalina.valves.AccessLogValve.invoke(
AccessLogValve.java:563)
     [exec]     at org.apache.catalina.connector.CoyoteAdapter.service(
CoyoteAdapter.java:261)
     [exec]     at org.apache.coyote.http11.Http11Processor.process(
Http11Processor.java:844)
     [exec]     at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
Http11Protocol.java:581)
     [exec]     at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(
JIoEndpoint.java:447)
     [exec]     at java.lang.Thread.run(Thread.java:619)
     [exec] Caused by: java.lang.reflect.UndeclaredThrowableException
     [exec]     at $Proxy22.create(Unknown Source)
     [exec]     at
org.apache.openejb.core.ivm.naming.BusinessRemoteReference.getObject(
BusinessRemoteReference.java:33)
     [exec]     at org.apache.openejb.core.ivm.naming.IvmContext.lookup(
IvmContext.java:150)
     [exec]     at
org.apache.openejb.core.ivm.naming.IntraVmJndiReference.getObject(
IntraVmJndiReference.java:38)
     [exec]     at org.apache.openejb.core.ivm.naming.Reference.getContent(
Reference.java:40)
     [exec]     at org.apache.xbean.naming.context.ContextUtil.resolve(
ContextUtil.java:61)
     [exec]     ... 26 more
     [exec] Caused by: java.rmi.RemoteException: Container has suffered a
SystemException; nested exception is:
     [exec]     java.io.NotSerializableException:
org.apache.openjpa.persistence.EntityManagerImpl
     [exec]     at org.apache.openejb.core.ivm.EjbHomeProxyHandler._invoke(
EjbHomeProxyHandler.java:243)
     [exec]     at org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(
BaseEjbProxyHandler.java:245)
     [exec]     at
org.apache.openejb.util.proxy.Jdk13InvocationHandler.invoke(
Jdk13InvocationHandler.java:49)
     [exec]     ... 32 more
     [exec] Caused by: java.io.NotSerializableException:
org.apache.openjpa.persistence.EntityManagerImpl
     [exec]     at java.io.ObjectOutputStream.writeObject0(
ObjectOutputStream.java:1156)
     [exec]     at java.io.ObjectOutputStream.defaultWriteFields(
ObjectOutputStream.java:1509)
     [exec]     at java.io.ObjectOutputStream.writeSerialData(
ObjectOutputStream.java:1474)
     [exec]     at java.io.ObjectOutputStream.writeOrdinaryObject(
ObjectOutputStream.java:1392)
     [exec]     at java.io.ObjectOutputStream.writeObject0(
ObjectOutputStream.java:1150)
     [exec]     at java.io.ObjectOutputStream.defaultWriteFields(
ObjectOutputStream.java:1509)
     [exec]     at java.io.ObjectOutputStream.writeSerialData(
ObjectOutputStream.java:1474)
     [exec]     at java.io.ObjectOutputStream.writeOrdinaryObject(
ObjectOutputStream.java:1392)
     [exec]     at java.io.ObjectOutputStream.writeObject0(
ObjectOutputStream.java:1150)
     [exec]     at java.io.ObjectOutputStream.defaultWriteFields(
ObjectOutputStream.java:1509)
     [exec]     at java.io.ObjectOutputStream.writeSerialData(
ObjectOutputStream.java:1474)
     [exec]     at java.io.ObjectOutputStream.writeOrdinaryObject(
ObjectOutputStream.java:1392)
     [exec]     at java.io.ObjectOutputStream.writeObject0(
ObjectOutputStream.java:1150)
     [exec]     at java.io.ObjectOutputStream.writeObject(
ObjectOutputStream.java:326)
     [exec]     at
org.apache.openejb.core.stateful.SimplePassivater.passivate(
SimplePassivater.java:73)
     [exec]     at
org.apache.openejb.core.stateful.SimplePassivater.passivate(
SimplePassivater.java:93)
     [exec]     at
org.apache.openejb.core.stateful.StatefulInstanceManager.passivate(
StatefulInstanceManager.java:487)
     [exec]     at
org.apache.openejb.core.stateful.StatefulInstanceManager$BeanEntryQueue.add(
StatefulInstanceManager.java:579)
     [exec]     at
org.apache.openejb.core.stateful.StatefulInstanceManager.poolInstance(
StatefulInstanceManager.java:413)
     [exec]     at
org.apache.openejb.core.stateful.StatefulContainer.createEJBObject(
StatefulContainer.java:291)
     [exec]     at org.apache.openejb.core.stateful.StatefulContainer.invoke
(StatefulContainer.java:241)
     [exec]     at org.apache.openejb.core.ivm.EjbHomeProxyHandler.create(
EjbHomeProxyHandler.java:267)
     [exec]     at org.apache.openejb.core.ivm.EjbHomeProxyHandler._invoke(
EjbHomeProxyHandler.java:158)
     [exec]     ... 34 more
     [exec] EM created!
     [exec] Write of 1 Directors successful!
     [exec] EM created!
     [exec] Write of 1 Directors successful!



greetings,

mario

Mime
View raw message