You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Marco de Booij <ma...@debooy.eu> on 2012/10/27 23:19:48 UTC

Fatal Error

Hello,

I have installed Tomcat 7.0.28 (from the Wheezy test branch) on a server 
with Debian Squeeze. I copied the postgresql-8.4-703.jdbc4.jar to the 
/usr/share/tomcat7/lib lib. I deployed the tomee-plus-webapp-1.5.0.war 
and I start tomcat7 as a service the file openejb.xml is created in 
/etc/tomcat7. In this file I added the following datasources:
<Resource id="jdbc/DS1" type="DataSource">
     JdbcDriver   org.postgresql.Driver
     JdbcUrl      jdbc:postgresql://localhost/prda
     UserName     user1
     Password     pwd1
     JtaManaged   true
</Resource>

<Resource id="jdbc/DS2" type="DataSource">
     JdbcDriver   org.postgresql.Driver
     JdbcUrl      jdbc:postgresql://localhost/prda
     UserName     user2
     Password     pwd2
     JtaManaged   true
</Resource>

When I start tomcat7 again I get an error message that tells me to send 
it to this list.

Oct 27, 2012 11:01:10 PM org.apache.openejb.util.OpenEJBErrorHandler 
handleUnknownError
SEVERE: FATAL ERROR: Unknown error in Assembler.  Please send the 
following stack trace and this message to users@openejb.apache.org :
  org.apache.xbean.recipe.ConstructionException: Error invoking factory 
method: public static javax.sql.DataSource 
org.apache.openejb.resource.jdbc.DataSourceFactory.create(java.lang.String,boolean,java.lang.Class,java.lang.String,org.apache.openejb.util.Duration,org.apache.openejb.util.Duration,org.apache.openejb.util.Duration) 
throws 
java.lang.IllegalAccessException,java.lang.InstantiationException,java.io.IOException
         at 
org.apache.xbean.recipe.ReflectionUtil$StaticFactory.create(ReflectionUtil.java:1006)
         at 
org.apache.xbean.recipe.ObjectRecipe.internalCreate(ObjectRecipe.java:276)
         at 
org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:96)
         at 
org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:61)
         at 
org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:49)
         at 
org.apache.openejb.assembler.classic.Assembler.createResource(Assembler.java:1660)
         at 
org.apache.openejb.assembler.classic.Assembler.buildContainerSystem(Assembler.java:422)
         at 
org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:341)
         at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:144)
         at org.apache.openejb.OpenEJB.init(OpenEJB.java:290)
         at 
org.apache.tomee.catalina.TomcatLoader.initialize(TomcatLoader.java:231)
         at 
org.apache.tomee.catalina.TomcatLoader.init(TomcatLoader.java:131)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
         at java.lang.reflect.Method.invoke(Method.java:616)
         at org.apache.openejb.loader.Embedder.init(Embedder.java:77)
         at org.apache.tomee.loader.TomcatHook.hook(TomcatHook.java:173)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
         at java.lang.reflect.Method.invoke(Method.java:616)
         at 
org.apache.tomee.loader.TomcatEmbedder.embed(TomcatEmbedder.java:100)
         at 
org.apache.tomee.loader.LoaderServlet.init(LoaderServlet.java:66)
         at 
org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1266)
         at 
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1185)
         at 
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1080)
         at 
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5026)
         at 
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5313)
         at 
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
         at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
         at 
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
         at 
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:618)
         at 
org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:963)
         at 
org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1600)
         at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
         at 
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
         at java.util.concurrent.FutureTask.run(FutureTask.java:166)
         at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
         at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
         at java.lang.Thread.run(Thread.java:636)
Caused by: java.lang.NoClassDefFoundError: 
org/apache/tomcat/jdbc/pool/PoolProperties
         at 
org.apache.tomee.jdbc.TomEEDataSourceCreator.pool(TomEEDataSourceCreator.java:79)
         at 
org.apache.openejb.resource.jdbc.pool.PoolDataSourceCreator.poolManaged(PoolDataSourceCreator.java:64)
         at 
org.apache.openejb.resource.jdbc.DataSourceFactory.create(DataSourceFactory.java:115)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
         at java.lang.reflect.Method.invoke(Method.java:616)
         at 
org.apache.xbean.recipe.ReflectionUtil$StaticFactory.create(ReflectionUtil.java:996)
         ... 40 more
Caused by: java.lang.ClassNotFoundException: 
org.apache.tomcat.jdbc.pool.PoolProperties
         at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:334)
         ... 48 more

Is this a bug or did I forget to do something or did something wrong? 
When I have it working the same way with apache-tomee-1.5.0-plus.tar.gz 
on another server (I added the datasources in the tomee.xml file).

Regards,

Marco

Re: Fatal Error

Posted by Marco de Booij <ma...@debooy.eu>.
I found it myself :) :)

The tomcat7 installation does not contain a tomcat-jdbc.jar. I copied 
the one from the stand-alone tomee and after the restart my applications 
work.

Regards,

Marco

Op 28-10-12 15:40, Marco de Booij schreef:
> I nearly gave up :(
>
> Then I saw that the listener that I used was wrong (I used 
> org.apache.tomee.catalina.ServerListener like in my 'all-in 
> installation'). I replaced it by 
> org.apache.tomee.loader.OpenEJBListener and now tomee starts and it 
> has a listener. I also added the agent in the catalina.sh by hand 
> agent :)
>
> Unfortunately this still does not solve the problem that I started 
> with. I still have:
> INFO: Creating Resource(id=My DataSource)
> Oct 28, 2012 3:22:05 PM org.apache.openejb.util.OpenEJBErrorHandler 
> handleUnknownError
> SEVERE: FATAL ERROR: Unknown error in Assembler.  Please send the 
> following stack trace and this message to users@openejb.apache.org :
>  org.apache.xbean.recipe.ConstructionException: Error invoking factory 
> method: public static javax.sql.DataSource 
> org.apache.openejb.resource.jdbc.DataSourceFactory.create(java.lang.String,boolean,java.lang.Class,java.lang.String,org.apache.openejb.util.Duration,org.apache.openejb.util.Duration,org.apache.openejb.util.Duration) 
> throws 
> java.lang.IllegalAccessException,java.lang.InstantiationException,java.io.IOException
>         at 
> org.apache.xbean.recipe.ReflectionUtil$StaticFactory.create(ReflectionUtil.java:1006)
>
>
> When I check further I see that it is always related to a datasource. 
> Both the default ones in hsql as my own in postgres. Where is it 
> writing the internal databases? It might be a directory that is not 
> write accessible to tomcat7.
>
> Regards,
>
> Marco


Re: Fatal Error

Posted by Romain Manni-Bucau <rm...@gmail.com>.
It is in tomee.xml in conf/, can you paste the whole logs please?
Le 28 oct. 2012 15:41, "Marco de Booij" <ma...@debooy.eu> a
écrit :

> I nearly gave up :(
>
> Then I saw that the listener that I used was wrong (I used
> org.apache.tomee.catalina.**ServerListener like in my 'all-in
> installation'). I replaced it by org.apache.tomee.loader.**OpenEJBListener
> and now tomee starts and it has a listener. I also added the agent in the
> catalina.sh by hand agent :)
>
> Unfortunately this still does not solve the problem that I started with. I
> still have:
> INFO: Creating Resource(id=My DataSource)
> Oct 28, 2012 3:22:05 PM org.apache.openejb.util.**OpenEJBErrorHandler
> handleUnknownError
> SEVERE: FATAL ERROR: Unknown error in Assembler.  Please send the
> following stack trace and this message to users@openejb.apache.org :
>  org.apache.xbean.recipe.**ConstructionException: Error invoking factory
> method: public static javax.sql.DataSource org.apache.openejb.resource.**
> jdbc.DataSourceFactory.create(**java.lang.String,boolean,java.**
> lang.Class,java.lang.String,**org.apache.openejb.util.**
> Duration,org.apache.openejb.**util.Duration,org.apache.**openejb.util.Duration)
> throws java.lang.**IllegalAccessException,java.**
> lang.InstantiationException,**java.io.IOException
>         at org.apache.xbean.recipe.**ReflectionUtil$StaticFactory.**
> create(ReflectionUtil.java:**1006)
>
>
> When I check further I see that it is always related to a datasource. Both
> the default ones in hsql as my own in postgres. Where is it writing the
> internal databases? It might be a directory that is not write accessible to
> tomcat7.
>
> Regards,
>
> Marco
>
> Op 28-10-12 13:31, Romain Manni-Bucau schreef:
>
>> just copy tomee-loader-1.5.0, not others otherwise you'll need to copy the
>> whole webapp libs
>>
>> if you are not afraid of some code the installation can be summarized in
>> http://svn.apache.org/repos/**asf/openejb/trunk/openejb/**
>> tomee/tomee-common/src/main/**java/org/apache/tomee/**
>> installer/Installer.java<http://svn.apache.org/repos/asf/openejb/trunk/openejb/tomee/tomee-common/src/main/java/org/apache/tomee/installer/Installer.java>
>> in
>> method installAll()
>>
>> *Romain Manni-Bucau*
>> *Twitter: @rmannibucau <https://twitter.com/**rmannibucau<https://twitter.com/rmannibucau>
>> >*
>> *Blog: **http://rmannibucau.**wordpress.com/*<http://rmannibucau.wordpress.com/*>
>> <http://**rmannibucau.wordpress.com/ <http://rmannibucau.wordpress.com/>>
>> *LinkedIn: **http://fr.linkedin.com/in/**rmannibucau*<http://fr.linkedin.com/in/rmannibucau*>
>> *Github: https://github.com/**rmannibucau*<https://github.com/rmannibucau*>
>>
>>
>>
>>
>> 2012/10/28 Marco de Booij <ma...@debooy.eu>
>>
>>  I must do something wrong. I copied one-by-one the following jars:
>>> - tomee-catalina-1.5.0.jar (for the org.apache.tomee.loader.**
>>> OpenEJBListener)
>>> - tomee-loader-1.5.0.jar (for the org/apache/tomee/loader/****
>>> TomcatHelper)
>>> - openejb-loader-4.5.0.jar (for the org/apache/openejb/loader/**
>>> SystemInstance)
>>> - openejb-core-4.5.0.jar (for the org/apache/openejb/core/**
>>> ThreadContextListener)
>>>
>>> I also copied tomee-webapp-1.5.0.jar like you told but still it keeps
>>> missing classes (org/apache/openejb/server/****ServiceManager). I can
>>> continue if you want but I am afraid that I end up with putting all
>>> libraries in the tomee.war file in the tomcat7 lib. This way an upgrade
>>> will become the lot of work I want to avoid.
>>>
>>> regards,
>>>
>>> Marco
>>> Op 28-10-12 12:22, Romain Manni-Bucau schreef:
>>>
>>>  You just need tomee-loader in lib of tomcat, tomee webapp and the
>>>> openejblistener
>>>> Le 28 oct. 2012 11:58, "Marco de Booij" <ma...@debooy.eu> a
>>>> écrit :
>>>>
>>>>   So how do I solve this? I already copied tomee-catalina-1.5.0.jar and
>>>>
>>>>> tomee-loader-1.5.0.jar (because the tomee-catalina-1.5.0.jar was not
>>>>> enough) and it misses another class (org/apache/openejb/loader/**
>>>>> SystemInstance).
>>>>>
>>>>> Regards,
>>>>>
>>>>> Marco
>>>>>
>>>>>
>>>>>
>

Re: Fatal Error

Posted by Marco de Booij <ma...@debooy.eu>.
I nearly gave up :(

Then I saw that the listener that I used was wrong (I used 
org.apache.tomee.catalina.ServerListener like in my 'all-in 
installation'). I replaced it by org.apache.tomee.loader.OpenEJBListener 
and now tomee starts and it has a listener. I also added the agent in 
the catalina.sh by hand agent :)

Unfortunately this still does not solve the problem that I started with. 
I still have:
INFO: Creating Resource(id=My DataSource)
Oct 28, 2012 3:22:05 PM org.apache.openejb.util.OpenEJBErrorHandler 
handleUnknownError
SEVERE: FATAL ERROR: Unknown error in Assembler.  Please send the 
following stack trace and this message to users@openejb.apache.org :
  org.apache.xbean.recipe.ConstructionException: Error invoking factory 
method: public static javax.sql.DataSource 
org.apache.openejb.resource.jdbc.DataSourceFactory.create(java.lang.String,boolean,java.lang.Class,java.lang.String,org.apache.openejb.util.Duration,org.apache.openejb.util.Duration,org.apache.openejb.util.Duration) 
throws 
java.lang.IllegalAccessException,java.lang.InstantiationException,java.io.IOException
         at 
org.apache.xbean.recipe.ReflectionUtil$StaticFactory.create(ReflectionUtil.java:1006)


When I check further I see that it is always related to a datasource. 
Both the default ones in hsql as my own in postgres. Where is it writing 
the internal databases? It might be a directory that is not write 
accessible to tomcat7.

Regards,

Marco

Op 28-10-12 13:31, Romain Manni-Bucau schreef:
> just copy tomee-loader-1.5.0, not others otherwise you'll need to copy the
> whole webapp libs
>
> if you are not afraid of some code the installation can be summarized in
> http://svn.apache.org/repos/asf/openejb/trunk/openejb/tomee/tomee-common/src/main/java/org/apache/tomee/installer/Installer.java
> in
> method installAll()
>
> *Romain Manni-Bucau*
> *Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
> *Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
> *LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
> *Github: https://github.com/rmannibucau*
>
>
>
>
> 2012/10/28 Marco de Booij <ma...@debooy.eu>
>
>> I must do something wrong. I copied one-by-one the following jars:
>> - tomee-catalina-1.5.0.jar (for the org.apache.tomee.loader.**
>> OpenEJBListener)
>> - tomee-loader-1.5.0.jar (for the org/apache/tomee/loader/**TomcatHelper)
>> - openejb-loader-4.5.0.jar (for the org/apache/openejb/loader/**
>> SystemInstance)
>> - openejb-core-4.5.0.jar (for the org/apache/openejb/core/**
>> ThreadContextListener)
>>
>> I also copied tomee-webapp-1.5.0.jar like you told but still it keeps
>> missing classes (org/apache/openejb/server/**ServiceManager). I can
>> continue if you want but I am afraid that I end up with putting all
>> libraries in the tomee.war file in the tomcat7 lib. This way an upgrade
>> will become the lot of work I want to avoid.
>>
>> regards,
>>
>> Marco
>> Op 28-10-12 12:22, Romain Manni-Bucau schreef:
>>
>>> You just need tomee-loader in lib of tomcat, tomee webapp and the
>>> openejblistener
>>> Le 28 oct. 2012 11:58, "Marco de Booij" <ma...@debooy.eu> a
>>> écrit :
>>>
>>>   So how do I solve this? I already copied tomee-catalina-1.5.0.jar and
>>>> tomee-loader-1.5.0.jar (because the tomee-catalina-1.5.0.jar was not
>>>> enough) and it misses another class (org/apache/openejb/loader/**
>>>> SystemInstance).
>>>>
>>>> Regards,
>>>>
>>>> Marco
>>>>
>>>>


Re: Fatal Error

Posted by Romain Manni-Bucau <rm...@gmail.com>.
just copy tomee-loader-1.5.0, not others otherwise you'll need to copy the
whole webapp libs

if you are not afraid of some code the installation can be summarized in
http://svn.apache.org/repos/asf/openejb/trunk/openejb/tomee/tomee-common/src/main/java/org/apache/tomee/installer/Installer.java
in
method installAll()

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*




2012/10/28 Marco de Booij <ma...@debooy.eu>

> I must do something wrong. I copied one-by-one the following jars:
> - tomee-catalina-1.5.0.jar (for the org.apache.tomee.loader.**
> OpenEJBListener)
> - tomee-loader-1.5.0.jar (for the org/apache/tomee/loader/**TomcatHelper)
> - openejb-loader-4.5.0.jar (for the org/apache/openejb/loader/**
> SystemInstance)
> - openejb-core-4.5.0.jar (for the org/apache/openejb/core/**
> ThreadContextListener)
>
> I also copied tomee-webapp-1.5.0.jar like you told but still it keeps
> missing classes (org/apache/openejb/server/**ServiceManager). I can
> continue if you want but I am afraid that I end up with putting all
> libraries in the tomee.war file in the tomcat7 lib. This way an upgrade
> will become the lot of work I want to avoid.
>
> regards,
>
> Marco
> Op 28-10-12 12:22, Romain Manni-Bucau schreef:
>
>> You just need tomee-loader in lib of tomcat, tomee webapp and the
>> openejblistener
>> Le 28 oct. 2012 11:58, "Marco de Booij" <ma...@debooy.eu> a
>> écrit :
>>
>>  So how do I solve this? I already copied tomee-catalina-1.5.0.jar and
>>> tomee-loader-1.5.0.jar (because the tomee-catalina-1.5.0.jar was not
>>> enough) and it misses another class (org/apache/openejb/loader/**
>>> SystemInstance).
>>>
>>> Regards,
>>>
>>> Marco
>>>
>>>
>

Re: Fatal Error

Posted by Marco de Booij <ma...@debooy.eu>.
I must do something wrong. I copied one-by-one the following jars:
- tomee-catalina-1.5.0.jar (for the org.apache.tomee.loader.OpenEJBListener)
- tomee-loader-1.5.0.jar (for the org/apache/tomee/loader/TomcatHelper)
- openejb-loader-4.5.0.jar (for the 
org/apache/openejb/loader/SystemInstance)
- openejb-core-4.5.0.jar (for the 
org/apache/openejb/core/ThreadContextListener)

I also copied tomee-webapp-1.5.0.jar like you told but still it keeps 
missing classes (org/apache/openejb/server/ServiceManager). I can 
continue if you want but I am afraid that I end up with putting all 
libraries in the tomee.war file in the tomcat7 lib. This way an upgrade 
will become the lot of work I want to avoid.

regards,

Marco
Op 28-10-12 12:22, Romain Manni-Bucau schreef:
> You just need tomee-loader in lib of tomcat, tomee webapp and the
> openejblistener
> Le 28 oct. 2012 11:58, "Marco de Booij" <ma...@debooy.eu> a
> écrit :
>
>> So how do I solve this? I already copied tomee-catalina-1.5.0.jar and
>> tomee-loader-1.5.0.jar (because the tomee-catalina-1.5.0.jar was not
>> enough) and it misses another class (org/apache/openejb/loader/**
>> SystemInstance).
>>
>> Regards,
>>
>> Marco
>>


Re: Fatal Error

Posted by Romain Manni-Bucau <rm...@gmail.com>.
You just need tomee-loader in lib of tomcat, tomee webapp and the
openejblistener
Le 28 oct. 2012 11:58, "Marco de Booij" <ma...@debooy.eu> a
écrit :

> So how do I solve this? I already copied tomee-catalina-1.5.0.jar and
> tomee-loader-1.5.0.jar (because the tomee-catalina-1.5.0.jar was not
> enough) and it misses another class (org/apache/openejb/loader/**
> SystemInstance).
>
> Regards,
>
> Marco
> Op 28-10-12 11:31, Romain Manni-Bucau schreef:
>
>> Yep thats org.apache.tomee.loader.**OpenEJBListener for the install with
>> tomee webapp
>> Le 28 oct. 2012 11:26, "Marco de Booij" <ma...@debooy.eu> a
>> écrit :
>>
>>  I added the listener as the first one. When I start tomcat7 it fails
>>> because it cannot find the ServerListener of tomee. Do I need to add a
>>> jar
>>> from tomee into the classpath of tomcat7? I checked the tomee
>>> documentation
>>> and cannot find a description on how to use the drop-in.
>>>
>>>
>

Re: Fatal Error

Posted by Marco de Booij <ma...@debooy.eu>.
So how do I solve this? I already copied tomee-catalina-1.5.0.jar and 
tomee-loader-1.5.0.jar (because the tomee-catalina-1.5.0.jar was not 
enough) and it misses another class 
(org/apache/openejb/loader/SystemInstance).

Regards,

Marco
Op 28-10-12 11:31, Romain Manni-Bucau schreef:
> Yep thats org.apache.tomee.loader.OpenEJBListener for the install with
> tomee webapp
> Le 28 oct. 2012 11:26, "Marco de Booij" <ma...@debooy.eu> a
> écrit :
>
>> I added the listener as the first one. When I start tomcat7 it fails
>> because it cannot find the ServerListener of tomee. Do I need to add a jar
>> from tomee into the classpath of tomcat7? I checked the tomee documentation
>> and cannot find a description on how to use the drop-in.
>>


Re: Fatal Error

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Yep thats org.apache.tomee.loader.OpenEJBListener for the install with
tomee webapp
Le 28 oct. 2012 11:26, "Marco de Booij" <ma...@debooy.eu> a
écrit :

> I added the listener as the first one. When I start tomcat7 it fails
> because it cannot find the ServerListener of tomee. Do I need to add a jar
> from tomee into the classpath of tomcat7? I checked the tomee documentation
> and cannot find a description on how to use the drop-in.
>
> <Server port="8005" shutdown="SHUTDOWN">
>   <Listener className="org.apache.tomee.**catalina.ServerListener" />
>   <Listener className="org.apache.**catalina.core.JasperListener" />
>   <Listener className="org.apache.**catalina.core.**
> JreMemoryLeakPreventionListene**r" />
>   <Listener className="org.apache.**catalina.mbeans.**
> GlobalResourcesLifecycleListen**er" />
>   <Listener className="org.apache.**catalina.core.**
> ThreadLocalLeakPreventionListe**ner" />
>
> WARNING: Catalina.start using conf/server.xml: Error at (24, 68) :
> org.apache.tomee.catalina.**ServerListener
> Oct 28, 2012 11:19:46 AM org.apache.tomcat.util.**digester.Digester
> startElement
> SEVERE: Begin event threw exception
> java.lang.**ClassNotFoundException: org.apache.tomee.catalina.**
> ServerListener
>
> Regards,
>
> Marco
> Op 28-10-12 10:52, Jacek Laskowski schreef:
>
>> On Sun, Oct 28, 2012 at 11:36 AM, Marco de Booij
>> <ma...@debooy.eu> wrote:
>>
>>  <?xml version='1.0' encoding='utf-8'?>
>>> <Server port="8005" shutdown="SHUTDOWN">
>>>    <Listener className="org.apache.**catalina.core.JasperListener" />
>>>    <Listener
>>> className="org.apache.**catalina.core.**JreMemoryLeakPreventionListene**r"
>>> />
>>>    <Listener
>>> className="org.apache.**catalina.mbeans.**GlobalResourcesLifecycleListen
>>> **er" />
>>>    <Listener
>>> className="org.apache.**catalina.core.**ThreadLocalLeakPreventionListe**ner"
>>> />
>>>
>> Add <Listener className="org.apache.tomee.**catalina.ServerListener" />
>> to the listeners. As a bonus, it will also check whether or not the
>> jars are in a good place as the listener is expected to be loaded at
>> Tomcat's startup.
>>
>> Jacek
>>
>>
>

Re: Fatal Error

Posted by Marco de Booij <ma...@debooy.eu>.
I added the listener as the first one. When I start tomcat7 it fails 
because it cannot find the ServerListener of tomee. Do I need to add a 
jar from tomee into the classpath of tomcat7? I checked the tomee 
documentation and cannot find a description on how to use the drop-in.

<Server port="8005" shutdown="SHUTDOWN">
   <Listener className="org.apache.tomee.catalina.ServerListener" />
   <Listener className="org.apache.catalina.core.JasperListener" />
   <Listener 
className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
   <Listener 
className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
   <Listener 
className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />

WARNING: Catalina.start using conf/server.xml: Error at (24, 68) : 
org.apache.tomee.catalina.ServerListener
Oct 28, 2012 11:19:46 AM org.apache.tomcat.util.digester.Digester 
startElement
SEVERE: Begin event threw exception
java.lang.ClassNotFoundException: org.apache.tomee.catalina.ServerListener

Regards,

Marco
Op 28-10-12 10:52, Jacek Laskowski schreef:
> On Sun, Oct 28, 2012 at 11:36 AM, Marco de Booij
> <ma...@debooy.eu> wrote:
>
>> <?xml version='1.0' encoding='utf-8'?>
>> <Server port="8005" shutdown="SHUTDOWN">
>>    <Listener className="org.apache.catalina.core.JasperListener" />
>>    <Listener
>> className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
>>    <Listener
>> className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
>>    <Listener
>> className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
> Add <Listener className="org.apache.tomee.catalina.ServerListener" />
> to the listeners. As a bonus, it will also check whether or not the
> jars are in a good place as the listener is expected to be loaded at
> Tomcat's startup.
>
> Jacek
>


Re: Fatal Error

Posted by Jacek Laskowski <ja...@japila.pl>.
On Sun, Oct 28, 2012 at 11:36 AM, Marco de Booij
<ma...@debooy.eu> wrote:

> <?xml version='1.0' encoding='utf-8'?>
> <Server port="8005" shutdown="SHUTDOWN">
>   <Listener className="org.apache.catalina.core.JasperListener" />
>   <Listener
> className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
>   <Listener
> className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
>   <Listener
> className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />

Add <Listener className="org.apache.tomee.catalina.ServerListener" />
to the listeners. As a bonus, it will also check whether or not the
jars are in a good place as the listener is expected to be loaded at
Tomcat's startup.

Jacek

-- 
Jacek Laskowski
Functional languages (Clojure), Java EE, and IBM WebSphere -
http://blog.japila.pl
"Never discourage anyone who continually makes progress, no matter how
slow." Plato

Re: Fatal Error

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Yes this listener makes tomcat being tomee
Le 28 oct. 2012 10:37, "Marco de Booij" <ma...@debooy.eu> a
écrit :

> I downloaded the tomee-plus-webapp-1.5.0.war and renamed it to tomee.war.
> This I deployed through the tomcat manager console. I do not know what you
> mean by the server listener to be in the server.xml. My server.xml of
> tomcat7 looks like (I removed the comments so it is much smaller. Hope I
> did not remove too much):
> <?xml version='1.0' encoding='utf-8'?>
> <Server port="8005" shutdown="SHUTDOWN">
>   <Listener className="org.apache.**catalina.core.JasperListener" />
>   <Listener className="org.apache.**catalina.core.**
> JreMemoryLeakPreventionListene**r" />
>   <Listener className="org.apache.**catalina.mbeans.**
> GlobalResourcesLifecycleListen**er" />
>   <Listener className="org.apache.**catalina.core.**
> ThreadLocalLeakPreventionListe**ner" />
>   <GlobalNamingResources>
>     <Resource name="UserDatabase" auth="Container"
>               type="org.apache.catalina.**UserDatabase"
>               description="User database that can be updated and saved"
> factory="org.apache.catalina.**users.**MemoryUserDatabaseFactory"
>               pathname="conf/tomcat-users.**xml" />
>   </GlobalNamingResources>
>   <Service name="Catalina">
>     <Connector port="8080" protocol="HTTP/1.1"
>                connectionTimeout="20000"
>                URIEncoding="UTF-8"
>                redirectPort="8443" />
>     <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
>     <Engine name="Catalina" defaultHost="localhost">
>       <Realm className="org.apache.**catalina.realm.LockOutRealm">
>         <Realm className="org.apache.**catalina.realm.**UserDatabaseRealm"
>                resourceName="UserDatabase"/>
>       </Realm>
>       <Host name="localhost"  appBase="webapps"
>             unpackWARs="true" autoDeploy="true">
>         <Valve className="org.apache.**catalina.valves.**AccessLogValve"
> directory="logs"
>                prefix="localhost_access_log." suffix=".txt"
>                pattern="%h %l %u %t &quot;%r&quot; %s %b" />
>
>       </Host>
>     </Engine>
>   </Service>
> </Server>
>
> In Tomee there is an optional menu option to install a listener. Is this
> the one you meant? If I click on that option I get a screen with the
> Catalina Home, Catalina Base, and Catalina server.xml. When I click on
> Install I get an error that the openejb/installer does not exist. My
> Catalina Home and Catalina Base are owned by root and do not have write
> rights for group and others.
>
> I checked the server.xml that I have locally. This comes from the package
> tomee plus with tomcat7 included. There I only find a tomee thing
> (<Listener className="org.apache.tomee.**catalina.ServerListener" />) in
> the shutdown part.
>
> Regards,
>
> Marco
>
> Op 28-10-12 00:24, Romain Manni-Bucau schreef:
>
>> How is tomee installed? Is your sercer.xml ok (does it contain server
>> listener)?
>> Le 27 oct. 2012 23:20, "Marco de Booij" <ma...@debooy.eu> a
>> écrit :
>>
>>  Hello,
>>>
>>> I have installed Tomcat 7.0.28 (from the Wheezy test branch) on a server
>>> with Debian Squeeze. I copied the postgresql-8.4-703.jdbc4.jar to the
>>> /usr/share/tomcat7/lib lib. I deployed the tomee-plus-webapp-1.5.0.war
>>> and
>>> I start tomcat7 as a service the file openejb.xml is created in
>>> /etc/tomcat7. In this file I added the following datasources:
>>> <Resource id="jdbc/DS1" type="DataSource">
>>>      JdbcDriver   org.postgresql.Driver
>>>      JdbcUrl      jdbc:postgresql://localhost/****prda
>>>      UserName     user1
>>>      Password     pwd1
>>>      JtaManaged   true
>>> </Resource>
>>>
>>> <Resource id="jdbc/DS2" type="DataSource">
>>>      JdbcDriver   org.postgresql.Driver
>>>      JdbcUrl      jdbc:postgresql://localhost/****prda
>>>      UserName     user2
>>>      Password     pwd2
>>>      JtaManaged   true
>>> </Resource>
>>>
>>> When I start tomcat7 again I get an error message that tells me to send
>>> it
>>> to this list.
>>>
>>> Oct 27, 2012 11:01:10 PM org.apache.openejb.util.****OpenEJBErrorHandler
>>> handleUnknownError
>>> SEVERE: FATAL ERROR: Unknown error in Assembler.  Please send the
>>> following stack trace and this message to users@openejb.apache.org :
>>>   org.apache.xbean.recipe.****ConstructionException: Error invoking
>>> factory
>>> method: public static javax.sql.DataSource org.apache.openejb.resource.**
>>> jdbc.DataSourceFactory.create(****java.lang.String,boolean,**java.**
>>> lang.Class,java.lang.String,****org.apache.openejb.util.**
>>> Duration,org.apache.openejb.****util.Duration,org.apache.****
>>> openejb.util.Duration)
>>> throws java.lang.****IllegalAccessException,java.**
>>> lang.InstantiationException,****java.io.IOException
>>>          at org.apache.xbean.recipe.****ReflectionUtil$StaticFactory.***
>>> *
>>> create(ReflectionUtil.java:****1006)
>>>
>>> Is this a bug or did I forget to do something or did something wrong?
>>> When
>>> I have it working the same way with apache-tomee-1.5.0-plus.tar.gz on
>>> another server (I added the datasources in the tomee.xml file).
>>>
>>> Regards,
>>>
>>> Marco
>>>
>>>
>

Re: Fatal Error

Posted by Marco de Booij <ma...@debooy.eu>.
I downloaded the tomee-plus-webapp-1.5.0.war and renamed it to 
tomee.war. This I deployed through the tomcat manager console. I do not 
know what you mean by the server listener to be in the server.xml. My 
server.xml of tomcat7 looks like (I removed the comments so it is much 
smaller. Hope I did not remove too much):
<?xml version='1.0' encoding='utf-8'?>
<Server port="8005" shutdown="SHUTDOWN">
   <Listener className="org.apache.catalina.core.JasperListener" />
   <Listener 
className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
   <Listener 
className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
   <Listener 
className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
   <GlobalNamingResources>
     <Resource name="UserDatabase" auth="Container"
               type="org.apache.catalina.UserDatabase"
               description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
               pathname="conf/tomcat-users.xml" />
   </GlobalNamingResources>
   <Service name="Catalina">
     <Connector port="8080" protocol="HTTP/1.1"
                connectionTimeout="20000"
                URIEncoding="UTF-8"
                redirectPort="8443" />
     <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
     <Engine name="Catalina" defaultHost="localhost">
       <Realm className="org.apache.catalina.realm.LockOutRealm">
         <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
                resourceName="UserDatabase"/>
       </Realm>
       <Host name="localhost"  appBase="webapps"
             unpackWARs="true" autoDeploy="true">
         <Valve className="org.apache.catalina.valves.AccessLogValve" 
directory="logs"
                prefix="localhost_access_log." suffix=".txt"
                pattern="%h %l %u %t &quot;%r&quot; %s %b" />

       </Host>
     </Engine>
   </Service>
</Server>

In Tomee there is an optional menu option to install a listener. Is this 
the one you meant? If I click on that option I get a screen with the 
Catalina Home, Catalina Base, and Catalina server.xml. When I click on 
Install I get an error that the openejb/installer does not exist. My 
Catalina Home and Catalina Base are owned by root and do not have write 
rights for group and others.

I checked the server.xml that I have locally. This comes from the 
package tomee plus with tomcat7 included. There I only find a tomee 
thing (<Listener className="org.apache.tomee.catalina.ServerListener" 
/>) in the shutdown part.

Regards,

Marco

Op 28-10-12 00:24, Romain Manni-Bucau schreef:
> How is tomee installed? Is your sercer.xml ok (does it contain server
> listener)?
> Le 27 oct. 2012 23:20, "Marco de Booij" <ma...@debooy.eu> a
> écrit :
>
>> Hello,
>>
>> I have installed Tomcat 7.0.28 (from the Wheezy test branch) on a server
>> with Debian Squeeze. I copied the postgresql-8.4-703.jdbc4.jar to the
>> /usr/share/tomcat7/lib lib. I deployed the tomee-plus-webapp-1.5.0.war and
>> I start tomcat7 as a service the file openejb.xml is created in
>> /etc/tomcat7. In this file I added the following datasources:
>> <Resource id="jdbc/DS1" type="DataSource">
>>      JdbcDriver   org.postgresql.Driver
>>      JdbcUrl      jdbc:postgresql://localhost/**prda
>>      UserName     user1
>>      Password     pwd1
>>      JtaManaged   true
>> </Resource>
>>
>> <Resource id="jdbc/DS2" type="DataSource">
>>      JdbcDriver   org.postgresql.Driver
>>      JdbcUrl      jdbc:postgresql://localhost/**prda
>>      UserName     user2
>>      Password     pwd2
>>      JtaManaged   true
>> </Resource>
>>
>> When I start tomcat7 again I get an error message that tells me to send it
>> to this list.
>>
>> Oct 27, 2012 11:01:10 PM org.apache.openejb.util.**OpenEJBErrorHandler
>> handleUnknownError
>> SEVERE: FATAL ERROR: Unknown error in Assembler.  Please send the
>> following stack trace and this message to users@openejb.apache.org :
>>   org.apache.xbean.recipe.**ConstructionException: Error invoking factory
>> method: public static javax.sql.DataSource org.apache.openejb.resource.**
>> jdbc.DataSourceFactory.create(**java.lang.String,boolean,java.**
>> lang.Class,java.lang.String,**org.apache.openejb.util.**
>> Duration,org.apache.openejb.**util.Duration,org.apache.**openejb.util.Duration)
>> throws java.lang.**IllegalAccessException,java.**
>> lang.InstantiationException,**java.io.IOException
>>          at org.apache.xbean.recipe.**ReflectionUtil$StaticFactory.**
>> create(ReflectionUtil.java:**1006)
>>
>> Is this a bug or did I forget to do something or did something wrong? When
>> I have it working the same way with apache-tomee-1.5.0-plus.tar.gz on
>> another server (I added the datasources in the tomee.xml file).
>>
>> Regards,
>>
>> Marco
>>


Re: Fatal Error

Posted by Romain Manni-Bucau <rm...@gmail.com>.
How is tomee installed? Is your sercer.xml ok (does it contain server
listener)?
Le 27 oct. 2012 23:20, "Marco de Booij" <ma...@debooy.eu> a
écrit :

> Hello,
>
> I have installed Tomcat 7.0.28 (from the Wheezy test branch) on a server
> with Debian Squeeze. I copied the postgresql-8.4-703.jdbc4.jar to the
> /usr/share/tomcat7/lib lib. I deployed the tomee-plus-webapp-1.5.0.war and
> I start tomcat7 as a service the file openejb.xml is created in
> /etc/tomcat7. In this file I added the following datasources:
> <Resource id="jdbc/DS1" type="DataSource">
>     JdbcDriver   org.postgresql.Driver
>     JdbcUrl      jdbc:postgresql://localhost/**prda
>     UserName     user1
>     Password     pwd1
>     JtaManaged   true
> </Resource>
>
> <Resource id="jdbc/DS2" type="DataSource">
>     JdbcDriver   org.postgresql.Driver
>     JdbcUrl      jdbc:postgresql://localhost/**prda
>     UserName     user2
>     Password     pwd2
>     JtaManaged   true
> </Resource>
>
> When I start tomcat7 again I get an error message that tells me to send it
> to this list.
>
> Oct 27, 2012 11:01:10 PM org.apache.openejb.util.**OpenEJBErrorHandler
> handleUnknownError
> SEVERE: FATAL ERROR: Unknown error in Assembler.  Please send the
> following stack trace and this message to users@openejb.apache.org :
>  org.apache.xbean.recipe.**ConstructionException: Error invoking factory
> method: public static javax.sql.DataSource org.apache.openejb.resource.**
> jdbc.DataSourceFactory.create(**java.lang.String,boolean,java.**
> lang.Class,java.lang.String,**org.apache.openejb.util.**
> Duration,org.apache.openejb.**util.Duration,org.apache.**openejb.util.Duration)
> throws java.lang.**IllegalAccessException,java.**
> lang.InstantiationException,**java.io.IOException
>         at org.apache.xbean.recipe.**ReflectionUtil$StaticFactory.**
> create(ReflectionUtil.java:**1006)
>         at org.apache.xbean.recipe.**ObjectRecipe.internalCreate(**
> ObjectRecipe.java:276)
>         at org.apache.xbean.recipe.**AbstractRecipe.create(**
> AbstractRecipe.java:96)
>         at org.apache.xbean.recipe.**AbstractRecipe.create(**
> AbstractRecipe.java:61)
>         at org.apache.xbean.recipe.**AbstractRecipe.create(**
> AbstractRecipe.java:49)
>         at org.apache.openejb.assembler.**classic.Assembler.**
> createResource(Assembler.java:**1660)
>         at org.apache.openejb.assembler.**classic.Assembler.**
> buildContainerSystem(**Assembler.java:422)
>         at org.apache.openejb.assembler.**classic.Assembler.build(**
> Assembler.java:341)
>         at org.apache.openejb.OpenEJB$**Instance.<init>(OpenEJB.java:**
> 144)
>         at org.apache.openejb.OpenEJB.**init(OpenEJB.java:290)
>         at org.apache.tomee.catalina.**TomcatLoader.initialize(**
> TomcatLoader.java:231)
>         at org.apache.tomee.catalina.**TomcatLoader.init(**
> TomcatLoader.java:131)
>         at sun.reflect.**NativeMethodAccessorImpl.**invoke0(Native Method)
>         at sun.reflect.**NativeMethodAccessorImpl.**invoke(**
> NativeMethodAccessorImpl.java:**57)
>         at sun.reflect.**DelegatingMethodAccessorImpl.**invoke(**
> DelegatingMethodAccessorImpl.**java:43)
>         at java.lang.reflect.Method.**invoke(Method.java:616)
>         at org.apache.openejb.loader.**Embedder.init(Embedder.java:**77)
>         at org.apache.tomee.loader.**TomcatHook.hook(TomcatHook.**
> java:173)
>         at sun.reflect.**NativeMethodAccessorImpl.**invoke0(Native Method)
>         at sun.reflect.**NativeMethodAccessorImpl.**invoke(**
> NativeMethodAccessorImpl.java:**57)
>         at sun.reflect.**DelegatingMethodAccessorImpl.**invoke(**
> DelegatingMethodAccessorImpl.**java:43)
>         at java.lang.reflect.Method.**invoke(Method.java:616)
>         at org.apache.tomee.loader.**TomcatEmbedder.embed(**
> TomcatEmbedder.java:100)
>         at org.apache.tomee.loader.**LoaderServlet.init(**
> LoaderServlet.java:66)
>         at org.apache.catalina.core.**StandardWrapper.initServlet(**
> StandardWrapper.java:1266)
>         at org.apache.catalina.core.**StandardWrapper.loadServlet(**
> StandardWrapper.java:1185)
>         at org.apache.catalina.core.**StandardWrapper.load(**
> StandardWrapper.java:1080)
>         at org.apache.catalina.core.**StandardContext.loadOnStartup(**
> StandardContext.java:5026)
>         at org.apache.catalina.core.**StandardContext.startInternal(**
> StandardContext.java:5313)
>         at org.apache.catalina.util.**LifecycleBase.start(**
> LifecycleBase.java:150)
>         at org.apache.catalina.core.**ContainerBase.**addChildInternal(**
> ContainerBase.java:899)
>         at org.apache.catalina.core.**ContainerBase.addChild(**
> ContainerBase.java:875)
>         at org.apache.catalina.core.**StandardHost.addChild(**
> StandardHost.java:618)
>         at org.apache.catalina.startup.**HostConfig.deployWAR(**
> HostConfig.java:963)
>         at org.apache.catalina.startup.**HostConfig$DeployWar.run(**
> HostConfig.java:1600)
>         at java.util.concurrent.**Executors$RunnableAdapter.**
> call(Executors.java:471)
>         at java.util.concurrent.**FutureTask$Sync.innerRun(**
> FutureTask.java:334)
>         at java.util.concurrent.**FutureTask.run(FutureTask.**java:166)
>         at java.util.concurrent.**ThreadPoolExecutor.runWorker(**
> ThreadPoolExecutor.java:1110)
>         at java.util.concurrent.**ThreadPoolExecutor$Worker.run(**
> ThreadPoolExecutor.java:603)
>         at java.lang.Thread.run(Thread.**java:636)
> Caused by: java.lang.**NoClassDefFoundError: org/apache/tomcat/jdbc/pool/*
> *PoolProperties
>         at org.apache.tomee.jdbc.**TomEEDataSourceCreator.pool(**
> TomEEDataSourceCreator.java:**79)
>         at org.apache.openejb.resource.**jdbc.pool.**
> PoolDataSourceCreator.**poolManaged(**PoolDataSourceCreator.java:64)
>         at org.apache.openejb.resource.**jdbc.DataSourceFactory.create(**
> DataSourceFactory.java:115)
>         at sun.reflect.**NativeMethodAccessorImpl.**invoke0(Native Method)
>         at sun.reflect.**NativeMethodAccessorImpl.**invoke(**
> NativeMethodAccessorImpl.java:**57)
>         at sun.reflect.**DelegatingMethodAccessorImpl.**invoke(**
> DelegatingMethodAccessorImpl.**java:43)
>         at java.lang.reflect.Method.**invoke(Method.java:616)
>         at org.apache.xbean.recipe.**ReflectionUtil$StaticFactory.**
> create(ReflectionUtil.java:**996)
>         ... 40 more
> Caused by: java.lang.**ClassNotFoundException:
> org.apache.tomcat.jdbc.pool.**PoolProperties
>         at java.net.URLClassLoader$1.run(**URLClassLoader.java:217)
>         at java.security.**AccessController.doPrivileged(**Native Method)
>         at java.net.URLClassLoader.**findClass(URLClassLoader.java:**205)
>         at java.lang.ClassLoader.**loadClass(ClassLoader.java:**321)
>         at java.lang.ClassLoader.**loadClass(ClassLoader.java:**266)
>         at java.lang.ClassLoader.**loadClassInternal(ClassLoader.**
> java:334)
>         ... 48 more
>
> Is this a bug or did I forget to do something or did something wrong? When
> I have it working the same way with apache-tomee-1.5.0-plus.tar.gz on
> another server (I added the datasources in the tomee.xml file).
>
> Regards,
>
> Marco
>