[ 
https://issues.apache.org/jira/browse/TOMEE-2338?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Wooster updated TOMEE-2338:
---------------------------
    Description: 
I'm having some troubles converting an application to running under TomEE 
embedded.

The application is packaged as an EAR. It consists of an EJB JAR and a WAR. 
Previously it was deploying okay under Glassfish but now I'd like to run it on 
Heroku with TomEE embedded.

First I was wondering how to get the web.xml file picked up automatically. What 
folder does it need to live in? I tried every combination of webapp, WEB-INF 
and resources dir under the EAR and WAR and it never seemed like it was getting 
loaded. I am able to get it to load if I specify 
`appConfig.setWebXml("config/web.xml");` but I was wondering if it could be 
loaded.

I have similar but different issues with persistence. It seems that if I create 
a shaded EAR, persistence loads okay. If I don't shade everything together, 
then I get a zillion warnings about a PersistenceUnit being defined multiple 
times. Not sure what the difference is here.

Error message when running as standalone WAR (instead of shaded WAR) is:

 
{code:java}
SEVERE: FAIL ... : The reference @PersistenceUnit(name="emf", 
unitName="CRMServicePU") cannot be resolved as there are 2 units with the same 
name.  Update your unitName to one of the 
following:../CRMServicePU%201578812000null
../CRMServicePU%20557735991null
{code}
 

What I would imagine is that when I call `deployClasspathAsWebApp()` it would 
deploy the WAR inside my EAR. Instead it loads everything in the EJB JAR but 
doesn't try deploying the webapp. If I specify a web.xml as I mentioned above 
with references to servlets in the WAR, it is unable to locate the servlet 
classes. They are present inside the WAR WEB-INF/classes dir. Why does it not 
locate the classes? Why does it not pick up the web.xml in the WAR 
automatically?

 

  was:
I'm having some troubles converting an application to running under TomEE 
embedded.

The application is packaged as an EAR. It consists of an EJB JAR and a WAR. 
Previously it was deploying okay under Glassfish but now I'd like to run it on 
Heroku with TomEE embedded.

First I was wondering how to get the web.xml file picked up automatically. What 
folder does it need to live in? I tried every combination of webapp, WEB-INF 
and resources dir under the EAR and WAR and it never seemed like it was getting 
loaded. I am able to get it to load if I specify 
`appConfig.setWebXml("config/web.xml");` but I was wondering if it could be 
loaded.

I have similar but different issues with persistence. It seems that if I create 
a shaded EAR, persistence loads okay. If I don't shade everything together, 
then I get a zillion warnings about a PersistenceUnit being defined multiple 
times. Not sure what the difference is here.

What I would imagine is that when I call `deployClasspathAsWebApp()` it would 
deploy the WAR inside my EAR. Instead it loads everything in the EJB JAR but 
doesn't try deploying the webapp. If I specify a web.xml as I mentioned above 
with references to servlets in the WAR, it is unable to locate the servlet 
classes. They are present inside the WAR WEB-INF/classes dir. Why does it not 
locate the classes? Why does it not pick up the web.xml in the WAR 
automatically?

 


> Guidance required on TomEE embedded with EAR/WAR
> ------------------------------------------------
>
>                 Key: TOMEE-2338
>                 URL: https://issues.apache.org/jira/browse/TOMEE-2338
>             Project: TomEE
>          Issue Type: Bug
>          Components: TomEE Core Server
>            Reporter: Wooster
>            Priority: Minor
>
> I'm having some troubles converting an application to running under TomEE 
> embedded.
> The application is packaged as an EAR. It consists of an EJB JAR and a WAR. 
> Previously it was deploying okay under Glassfish but now I'd like to run it 
> on Heroku with TomEE embedded.
> First I was wondering how to get the web.xml file picked up automatically. 
> What folder does it need to live in? I tried every combination of webapp, 
> WEB-INF and resources dir under the EAR and WAR and it never seemed like it 
> was getting loaded. I am able to get it to load if I specify 
> `appConfig.setWebXml("config/web.xml");` but I was wondering if it could be 
> loaded.
> I have similar but different issues with persistence. It seems that if I 
> create a shaded EAR, persistence loads okay. If I don't shade everything 
> together, then I get a zillion warnings about a PersistenceUnit being defined 
> multiple times. Not sure what the difference is here.
> Error message when running as standalone WAR (instead of shaded WAR) is:
>  
> {code:java}
> SEVERE: FAIL ... : The reference @PersistenceUnit(name="emf", 
> unitName="CRMServicePU") cannot be resolved as there are 2 units with the 
> same name.  Update your unitName to one of the 
> following:../CRMServicePU%201578812000null
> ../CRMServicePU%20557735991null
> {code}
>  
> What I would imagine is that when I call `deployClasspathAsWebApp()` it would 
> deploy the WAR inside my EAR. Instead it loads everything in the EJB JAR but 
> doesn't try deploying the webapp. If I specify a web.xml as I mentioned above 
> with references to servlets in the WAR, it is unable to locate the servlet 
> classes. They are present inside the WAR WEB-INF/classes dir. Why does it not 
> locate the classes? Why does it not pick up the web.xml in the WAR 
> automatically?
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to