You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by David Nordahl <da...@thinkology.org> on 2012/08/17 22:14:16 UTC

Exceptions in my deployed environment

I'm having trouble making TomEE happy on my deployed server and I'm not 
sure what is different from my dev environment.  Basically I have my EJB 
class files included in a jar in the lib folder of TomEE as well as in 
my deployed WAR web app.

When EJBs are invoked, I get exceptions like:

ClassCastException: cannot convert class A to class A.

I also get exceptions about duplicate NamedQuery's.

So I assume duplicate instances of class files present and TomEE is not 
able to sort this out for some reason.  So if I remove the EJB classes 
contained in the /lib folder jar of my class files, I get:

WARNING: Meta class "com.company.entities.Customer_" for entity class 
com.company.entities.Customer can not be registered with following 
exception "java.security.PrivilegedActionException: 
java.lang.ClassNotFoundException: com.company.entities.Customer_"
Aug 17, 2012 12:39:26 PM null

Any advice regarding what I might be doing wrong ?  2-1 seems to equal 0 
here :-)





Re: Random Exceptions

Posted by David Nordahl <da...@thinkology.org>.
Thank you.. Will get the new version if I have any more errors.  Dev and 
prod now working and entity beans in my jsps are persisting to DB now.

On 08/22/2012 05:26 PM, Romain Manni-Bucau wrote:
> was writing i redeployed a new snapshot to let you test with a fresh HEAD
> (you line numbers was no more up to date)
>
> nice if it works
>
> *Romain Manni-Bucau*
> *Twitter: @rmannibucau*
> *Blog: http://rmannibucau.wordpress.com*
>
>
>
>
> 2012/8/23 David Nordahl <da...@thinkology.org>
>
>> Got it working by reinstalling TomEE on the problematic environment.. must
>> have gotten a missing or damaged file.
>>
>>
>>
>> On 08/22/2012 05:00 PM, David Nordahl wrote:
>>
>>> Attached is the log file containing the exceptions and stack traces.  I
>>> am using 1.1 SNAPSHOT
>>>
>>>
>>> On 08/22/2012 04:40 PM, Romain Manni-Bucau wrote:
>>>
>>>> Hi,
>>>>
>>>> can you give us the version you are using (snapshot or not) and the full
>>>> stacktrace please?
>>>>
>>>> *Romain Manni-Bucau*
>>>> *Twitter: @rmannibucau*
>>>> *Blog: http://rmannibucau.wordpress.**com<http://rmannibucau.wordpress.com>
>>>> *
>>>>
>>>>
>>>>
>>>>
>>>> 2012/8/22 David Nordahl <da...@thinkology.org>
>>>>
>>>>   Now my dev environment is working fine, but production is giving these
>>>>> exceptions all over the place:
>>>>>
>>>>> java.lang.****IllegalStateException: ContainerBase.addChild: start:
>>>>> org.apache.catal
>>>>> ina.LifecycleException: Failed to start component
>>>>> [StandardEngine[Catalina].Stan
>>>>> dardHost[localhost].****StandardContext[]]
>>>>>
>>>>> plus a few about org.apache.http.HTTPEntity
>>>>>
>>>>> I'm using the same version of TomEE, same war, and no system classpath
>>>>> defined.  Some forums pinned these type of errors on servlet.jar
>>>>> libraries
>>>>> getting loaded, but I don't find any files by that name in the file
>>>>> system.
>>>>>    Just the servlet-api.jar, and if I remove that then TomEE doesn't
>>>>> work at
>>>>> all.
>>>>>
>>>>>
>>>>>
>>>>>


Re: Random Exceptions

Posted by Romain Manni-Bucau <rm...@gmail.com>.
was writing i redeployed a new snapshot to let you test with a fresh HEAD
(you line numbers was no more up to date)

nice if it works

*Romain Manni-Bucau*
*Twitter: @rmannibucau*
*Blog: http://rmannibucau.wordpress.com*




2012/8/23 David Nordahl <da...@thinkology.org>

> Got it working by reinstalling TomEE on the problematic environment.. must
> have gotten a missing or damaged file.
>
>
>
> On 08/22/2012 05:00 PM, David Nordahl wrote:
>
>> Attached is the log file containing the exceptions and stack traces.  I
>> am using 1.1 SNAPSHOT
>>
>>
>> On 08/22/2012 04:40 PM, Romain Manni-Bucau wrote:
>>
>>> Hi,
>>>
>>> can you give us the version you are using (snapshot or not) and the full
>>> stacktrace please?
>>>
>>> *Romain Manni-Bucau*
>>> *Twitter: @rmannibucau*
>>> *Blog: http://rmannibucau.wordpress.**com<http://rmannibucau.wordpress.com>
>>> *
>>>
>>>
>>>
>>>
>>> 2012/8/22 David Nordahl <da...@thinkology.org>
>>>
>>>  Now my dev environment is working fine, but production is giving these
>>>> exceptions all over the place:
>>>>
>>>> java.lang.****IllegalStateException: ContainerBase.addChild: start:
>>>> org.apache.catal
>>>> ina.LifecycleException: Failed to start component
>>>> [StandardEngine[Catalina].Stan
>>>> dardHost[localhost].****StandardContext[]]
>>>>
>>>> plus a few about org.apache.http.HTTPEntity
>>>>
>>>> I'm using the same version of TomEE, same war, and no system classpath
>>>> defined.  Some forums pinned these type of errors on servlet.jar
>>>> libraries
>>>> getting loaded, but I don't find any files by that name in the file
>>>> system.
>>>>   Just the servlet-api.jar, and if I remove that then TomEE doesn't
>>>> work at
>>>> all.
>>>>
>>>>
>>>>
>>>>
>>
>

Re: Random Exceptions

Posted by David Nordahl <da...@thinkology.org>.
Got it working by reinstalling TomEE on the problematic environment.. 
must have gotten a missing or damaged file.


On 08/22/2012 05:00 PM, David Nordahl wrote:
> Attached is the log file containing the exceptions and stack traces.  
> I am using 1.1 SNAPSHOT
>
>
> On 08/22/2012 04:40 PM, Romain Manni-Bucau wrote:
>> Hi,
>>
>> can you give us the version you are using (snapshot or not) and the full
>> stacktrace please?
>>
>> *Romain Manni-Bucau*
>> *Twitter: @rmannibucau*
>> *Blog: http://rmannibucau.wordpress.com*
>>
>>
>>
>>
>> 2012/8/22 David Nordahl <da...@thinkology.org>
>>
>>> Now my dev environment is working fine, but production is giving these
>>> exceptions all over the place:
>>>
>>> java.lang.**IllegalStateException: ContainerBase.addChild: start:
>>> org.apache.catal
>>> ina.LifecycleException: Failed to start component
>>> [StandardEngine[Catalina].Stan
>>> dardHost[localhost].**StandardContext[]]
>>>
>>> plus a few about org.apache.http.HTTPEntity
>>>
>>> I'm using the same version of TomEE, same war, and no system classpath
>>> defined.  Some forums pinned these type of errors on servlet.jar 
>>> libraries
>>> getting loaded, but I don't find any files by that name in the file 
>>> system.
>>>   Just the servlet-api.jar, and if I remove that then TomEE doesn't 
>>> work at
>>> all.
>>>
>>>
>>>
>


Re: Random Exceptions

Posted by David Nordahl <da...@thinkology.org>.
Attached is the log file containing the exceptions and stack traces.  I 
am using 1.1 SNAPSHOT


On 08/22/2012 04:40 PM, Romain Manni-Bucau wrote:
> Hi,
>
> can you give us the version you are using (snapshot or not) and the full
> stacktrace please?
>
> *Romain Manni-Bucau*
> *Twitter: @rmannibucau*
> *Blog: http://rmannibucau.wordpress.com*
>
>
>
>
> 2012/8/22 David Nordahl <da...@thinkology.org>
>
>> Now my dev environment is working fine, but production is giving these
>> exceptions all over the place:
>>
>> java.lang.**IllegalStateException: ContainerBase.addChild: start:
>> org.apache.catal
>> ina.LifecycleException: Failed to start component
>> [StandardEngine[Catalina].Stan
>> dardHost[localhost].**StandardContext[]]
>>
>> plus a few about org.apache.http.HTTPEntity
>>
>> I'm using the same version of TomEE, same war, and no system classpath
>> defined.  Some forums pinned these type of errors on servlet.jar libraries
>> getting loaded, but I don't find any files by that name in the file system.
>>   Just the servlet-api.jar, and if I remove that then TomEE doesn't work at
>> all.
>>
>>
>>


Re: Random Exceptions

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi,

can you give us the version you are using (snapshot or not) and the full
stacktrace please?

*Romain Manni-Bucau*
*Twitter: @rmannibucau*
*Blog: http://rmannibucau.wordpress.com*




2012/8/22 David Nordahl <da...@thinkology.org>

> Now my dev environment is working fine, but production is giving these
> exceptions all over the place:
>
> java.lang.**IllegalStateException: ContainerBase.addChild: start:
> org.apache.catal
> ina.LifecycleException: Failed to start component
> [StandardEngine[Catalina].Stan
> dardHost[localhost].**StandardContext[]]
>
> plus a few about org.apache.http.HTTPEntity
>
> I'm using the same version of TomEE, same war, and no system classpath
> defined.  Some forums pinned these type of errors on servlet.jar libraries
> getting loaded, but I don't find any files by that name in the file system.
>  Just the servlet-api.jar, and if I remove that then TomEE doesn't work at
> all.
>
>
>

Random Exceptions

Posted by David Nordahl <da...@thinkology.org>.
Now my dev environment is working fine, but production is giving these 
exceptions all over the place:

java.lang.IllegalStateException: ContainerBase.addChild: start: 
org.apache.catal
ina.LifecycleException: Failed to start component 
[StandardEngine[Catalina].Stan
dardHost[localhost].StandardContext[]]

plus a few about org.apache.http.HTTPEntity

I'm using the same version of TomEE, same war, and no system classpath 
defined.  Some forums pinned these type of errors on servlet.jar 
libraries getting loaded, but I don't find any files by that name in the 
file system.  Just the servlet-api.jar, and if I remove that then TomEE 
doesn't work at all.



Re: Exceptions in my deployed environment

Posted by David Nordahl <da...@thinkology.org>.
To update this thread, the way I got this working when building the 
project in Netbeans 7.2 was to add OpenJPA as a persistence provider by 
using the jar files contained in the OpenJPA bin release. Netbeans then 
automatically adds the correct <provider> entry in the persistence.xml 
file for OpenJPA.  Under additional compiler options in the project 
settings I added -Aopenjpa.metamodel=true

The meta classes were then compiled to 
<project-home>/build/generated-sources/ap-source-output and were 
included in the /dist war file for deployment.

On 08/17/2012 03:55 PM, Romain Manni-Bucau wrote:
> Did you generate jpa meta classes?
> Le 17 août 2012 22:14, "David Nordahl" <da...@thinkology.org> a écrit :
>
>> I'm having trouble making TomEE happy on my deployed server and I'm not
>> sure what is different from my dev environment.  Basically I have my EJB
>> class files included in a jar in the lib folder of TomEE as well as in my
>> deployed WAR web app.
>>
>> When EJBs are invoked, I get exceptions like:
>>
>> ClassCastException: cannot convert class A to class A.
>>
>> I also get exceptions about duplicate NamedQuery's.
>>
>> So I assume duplicate instances of class files present and TomEE is not
>> able to sort this out for some reason.  So if I remove the EJB classes
>> contained in the /lib folder jar of my class files, I get:
>>
>> WARNING: Meta class "com.company.entities.**Customer_" for entity class
>> com.company.entities.Customer can not be registered with following
>> exception "java.security.**PrivilegedActionException: java.lang.**ClassNotFoundException:
>> com.company.entities.Customer_**"
>> Aug 17, 2012 12:39:26 PM null
>>
>> Any advice regarding what I might be doing wrong ?  2-1 seems to equal 0
>> here :-)
>>
>>
>>
>>
>>


Re: Deployment Folders / Subfolders

Posted by Romain Manni-Bucau <rm...@gmail.com>.
hmm,

subfolders should work out of the bow, if it is not the case maybe you
configured something wrong in your app

about ROOT you can use a META-INF/context.xml to define the context path to
/, that's the easier

*Romain Manni-Bucau*
*Twitter: @rmannibucau*
*Blog: http://rmannibucau.wordpress.com*




2012/8/22 David Nordahl <da...@thinkology.org>

> When I drag my foo.war file to be deployed in the webapps folder it
> deploys the app to localhost:8080/foo, but it doesn't seem to serve any
> jsp/jpeg/css files contained in any subfolders of the war.
>
> When I rename the .war file to ROOT.war it serves everything up fine.  So
> I was wondering, how to do you configure TomEE to either deploy a war file
> like foo.war to ROOT, and if you actually do want it to deploy to
> localhost:8080/foo, then how do I get all my subfolders to show up
> correctly?
>

Deployment Folders / Subfolders

Posted by David Nordahl <da...@thinkology.org>.
When I drag my foo.war file to be deployed in the webapps folder it 
deploys the app to localhost:8080/foo, but it doesn't seem to serve any 
jsp/jpeg/css files contained in any subfolders of the war.

When I rename the .war file to ROOT.war it serves everything up fine.  
So I was wondering, how to do you configure TomEE to either deploy a war 
file like foo.war to ROOT, and if you actually do want it to deploy to 
localhost:8080/foo, then how do I get all my subfolders to show up 
correctly?

Re: Exceptions in my deployed environment

Posted by Romain Manni-Bucau <rm...@gmail.com>.
put all you want in WEB-INF/classes (think descriptors go to WEB-INF
instead of META-INF) and it should be fine


about your port error it is that your java installation is not correct (you
probably get a java.exe wrapper with some environment not set)

*Romain Manni-Bucau*
*Twitter: @rmannibucau*
*Blog: http://rmannibucau.wordpress.com*




2012/8/20 David Nordahl <da...@thinkology.org>

> I discovered my ide started leaving out the class files for some reason..
> I think I've got that fixed.  But now starting up tomee I get the error:
>
> SEVERE: Failed to initialize end point associated with ProtocolHandler
> ["http-bio-8080"]
> java.net.SocketException: Unrecognized Windows Sockets error: 10106: create
>
> using netstat and other tools I don't see that port 10106 is in use and
> I'm not sure why it's trying to connect and open this port to begin with.
>
> Also I was wondering with a web app with EJB's if it is needed to build an
> EAR file, or if you can put the entity classes in the classes folder of
> WEB-INF in the WAR file?
>
>
>
>
> On 8/17/2012 3:55 PM, Romain Manni-Bucau wrote:
>
>> Did you generate jpa meta classes?
>> Le 17 août 2012 22:14, "David Nordahl"<da...@thinkology.org>  a écrit :
>>
>>  I'm having trouble making TomEE happy on my deployed server and I'm not
>>> sure what is different from my dev environment.  Basically I have my EJB
>>> class files included in a jar in the lib folder of TomEE as well as in my
>>> deployed WAR web app.
>>>
>>> When EJBs are invoked, I get exceptions like:
>>>
>>> ClassCastException: cannot convert class A to class A.
>>>
>>> I also get exceptions about duplicate NamedQuery's.
>>>
>>> So I assume duplicate instances of class files present and TomEE is not
>>> able to sort this out for some reason.  So if I remove the EJB classes
>>> contained in the /lib folder jar of my class files, I get:
>>>
>>> WARNING: Meta class "com.company.entities.****Customer_" for entity
>>> class
>>>
>>> com.company.entities.Customer can not be registered with following
>>> exception "java.security.****PrivilegedActionException: java.lang.****
>>> ClassNotFoundException:
>>> com.company.entities.Customer_****"
>>>
>>> Aug 17, 2012 12:39:26 PM null
>>>
>>> Any advice regarding what I might be doing wrong ?  2-1 seems to equal 0
>>> here :-)
>>>
>>>
>>>
>>>
>>>
>>>

Re: Exceptions in my deployed environment

Posted by David Nordahl <da...@thinkology.org>.
I discovered my ide started leaving out the class files for some 
reason.. I think I've got that fixed.  But now starting up tomee I get 
the error:

SEVERE: Failed to initialize end point associated with ProtocolHandler 
["http-bio-8080"]
java.net.SocketException: Unrecognized Windows Sockets error: 10106: create

using netstat and other tools I don't see that port 10106 is in use and 
I'm not sure why it's trying to connect and open this port to begin with.

Also I was wondering with a web app with EJB's if it is needed to build 
an EAR file, or if you can put the entity classes in the classes folder 
of WEB-INF in the WAR file?



On 8/17/2012 3:55 PM, Romain Manni-Bucau wrote:
> Did you generate jpa meta classes?
> Le 17 août 2012 22:14, "David Nordahl"<da...@thinkology.org>  a écrit :
>
>> I'm having trouble making TomEE happy on my deployed server and I'm not
>> sure what is different from my dev environment.  Basically I have my EJB
>> class files included in a jar in the lib folder of TomEE as well as in my
>> deployed WAR web app.
>>
>> When EJBs are invoked, I get exceptions like:
>>
>> ClassCastException: cannot convert class A to class A.
>>
>> I also get exceptions about duplicate NamedQuery's.
>>
>> So I assume duplicate instances of class files present and TomEE is not
>> able to sort this out for some reason.  So if I remove the EJB classes
>> contained in the /lib folder jar of my class files, I get:
>>
>> WARNING: Meta class "com.company.entities.**Customer_" for entity class
>> com.company.entities.Customer can not be registered with following
>> exception "java.security.**PrivilegedActionException: java.lang.**ClassNotFoundException:
>> com.company.entities.Customer_**"
>> Aug 17, 2012 12:39:26 PM null
>>
>> Any advice regarding what I might be doing wrong ?  2-1 seems to equal 0
>> here :-)
>>
>>
>>
>>
>>

Re: Exceptions in my deployed environment

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Did you generate jpa meta classes?
Le 17 août 2012 22:14, "David Nordahl" <da...@thinkology.org> a écrit :

> I'm having trouble making TomEE happy on my deployed server and I'm not
> sure what is different from my dev environment.  Basically I have my EJB
> class files included in a jar in the lib folder of TomEE as well as in my
> deployed WAR web app.
>
> When EJBs are invoked, I get exceptions like:
>
> ClassCastException: cannot convert class A to class A.
>
> I also get exceptions about duplicate NamedQuery's.
>
> So I assume duplicate instances of class files present and TomEE is not
> able to sort this out for some reason.  So if I remove the EJB classes
> contained in the /lib folder jar of my class files, I get:
>
> WARNING: Meta class "com.company.entities.**Customer_" for entity class
> com.company.entities.Customer can not be registered with following
> exception "java.security.**PrivilegedActionException: java.lang.**ClassNotFoundException:
> com.company.entities.Customer_**"
> Aug 17, 2012 12:39:26 PM null
>
> Any advice regarding what I might be doing wrong ?  2-1 seems to equal 0
> here :-)
>
>
>
>
>