Discussion:
Static deployment/EAR with 2 WARs
awmurray
2017-12-06 15:49:35 UTC
Permalink
I'm converting from an old version of TomEE to the newest stable version of
TomEE+ and I think I have most of the problems resolved, except one.

I have been deploying statically with this in $CATALINA_HOME/conf/tomee.xml:

<Deployments jar="C:\app-pathl\myapp-ear\target\exploded-ear-with-2-wars" />

When I start TomEE, it doesn't deploy this app like it used to - previously
it would treat this as an exploded artifact and simply start and work. With
the new TomEE+, it ignores this completely so the app isn't processed by the
deployment process.

When I try to dynamically drop the myapp-ear.ear into
$CATALINA_HOME/webapps, it does this in webapps:

webapps
- myapp-ear.ear
- myapp-ear (exploded directory)
- myapp-ear-war1 (exploded directory)

And fails because of ClassNotFound exceptions in myapp-ear-war1. It should
leave the WARs under the EAR I would think??




--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
Jonathan Gallimore
2017-12-06 15:52:17 UTC
Permalink
Are you willing to try a 7.0.5-SNAPSHOT for us? I patched some issues with
deploying ears in the webapps folder a couple of weeks ago, so that aspect
at least might be fixed (and if you still have issues, I'd like to try and
resolve them).

Cheers

Jon
Post by awmurray
I'm converting from an old version of TomEE to the newest stable version of
TomEE+ and I think I have most of the problems resolved, except one.
I have been deploying statically with this in
<Deployments jar="C:\app-pathl\myapp-ear\target\exploded-ear-with-2-wars" />
When I start TomEE, it doesn't deploy this app like it used to - previously
it would treat this as an exploded artifact and simply start and work.
With
the new TomEE+, it ignores this completely so the app isn't processed by the
deployment process.
When I try to dynamically drop the myapp-ear.ear into
webapps
- myapp-ear.ear
- myapp-ear (exploded directory)
- myapp-ear-war1 (exploded directory)
And fails because of ClassNotFound exceptions in myapp-ear-war1. It should
leave the WARs under the EAR I would think??
--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-
f979441.html
awmurray
2017-12-06 16:02:03 UTC
Permalink
I'd love to- any help is appreciated... we are trying to jump ahead 4 years
worth of updates :).

How do I get it?




--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
Romain Manni-Bucau
2017-12-06 16:02:46 UTC
Permalink
Hi

don't drop an ear into webapps, you can drop it in folder
$CATALINA_BASE/apps if you add in tomee.xml the line <Deployments
dir="apps" />

that said your declaration should work if you have a META-INF/application.xml

Romain Manni-Bucau
@rmannibucau | Blog | Old Blog | Github | LinkedIn
Post by Jonathan Gallimore
Are you willing to try a 7.0.5-SNAPSHOT for us? I patched some issues with
deploying ears in the webapps folder a couple of weeks ago, so that aspect
at least might be fixed (and if you still have issues, I'd like to try and
resolve them).
Cheers
Jon
Post by awmurray
I'm converting from an old version of TomEE to the newest stable version of
TomEE+ and I think I have most of the problems resolved, except one.
I have been deploying statically with this in
<Deployments jar="C:\app-pathl\myapp-ear\target\exploded-ear-with-2-wars" />
When I start TomEE, it doesn't deploy this app like it used to - previously
it would treat this as an exploded artifact and simply start and work.
With
the new TomEE+, it ignores this completely so the app isn't processed by the
deployment process.
When I try to dynamically drop the myapp-ear.ear into
webapps
- myapp-ear.ear
- myapp-ear (exploded directory)
- myapp-ear-war1 (exploded directory)
And fails because of ClassNotFound exceptions in myapp-ear-war1. It should
leave the WARs under the EAR I would think??
--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-
f979441.html
awmurray
2017-12-06 16:22:36 UTC
Permalink
I'll try that, thanks.

How about other standard WARs? Do they also go into apps?

They'd look like this in tomee.xml:

<Deployments dir="C:\app-path\app\target\app" />

where C:\app-path\app\target\app is an exploded war directory.




--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
Romain Manni-Bucau
2017-12-06 16:33:00 UTC
Permalink
yep, should work as well

Romain Manni-Bucau
@rmannibucau | Blog | Old Blog | Github | LinkedIn
Post by awmurray
I'll try that, thanks.
How about other standard WARs? Do they also go into apps?
<Deployments dir="C:\app-path\app\target\app" />
where C:\app-path\app\target\app is an exploded war directory.
--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
awmurray
2017-12-07 20:42:14 UTC
Permalink
I put the EAR in the /apps folder and made the fix in tomee.xml:
<Deployments dir="apps" />

It deployed OK.

Now I'm having a mystery error when trying to use the app.

I'm getting killed in the EEFilter class:
javax.servlet.ServletException: Filter execution threw an exception
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:199)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
at org.apache.openejb.server.httpd.EEFilter.doFilter(EEFilter.java:65)

The exception i'm seeing in the debugger is:

java.lang.AbstractMethodError:
javax.ws.rs.core.Response.getStatusInfo()Ljavax/ws/rs/core/Response$StatusType;

That's a dead end in the JVM in my head - what's up?




--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
Jonathan Gallimore
2017-12-06 16:35:22 UTC
Permalink
Hi

Latest snapshots are here:
https://repository.apache.org/content/groups/snapshots/org/apache/tomee/apache-tomee/7.0.5-SNAPSHOT/

If dropping your EAR in apps/ is an option, that is ideal, as Romain points
out. I have been looking at the code for handling EARs in webapps, and
forgot about just sticking them in apps (sorry). Standard WARs can go in
webapps/ as usual.

The deployment path between the two is slightly different as Tomcat picks
up apps from webapps, whereas deployments in apps are come through a
different route in OpenEJB/TomEE. In theory, dropping an EAR file in
webapps _should_ work, but there may still be some issues with that. If
you're able to try it in the latest snapshot and report any issues, that
would be a very useful contribution, and I'd very much appreciate the
feedback. :-)

Cheers
Jon
Post by awmurray
I'll try that, thanks.
How about other standard WARs? Do they also go into apps?
<Deployments dir="C:\app-path\app\target\app" />
where C:\app-path\app\target\app is an exploded war directory.
--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-
f979441.html
awmurray
2017-12-06 18:55:17 UTC
Permalink
I will try the dropping them in webapps (only the EAR didn't work right).

But ideally this is a development environment so static deployment is
perfect since I can check it into SVN and share it - that's how the current
one works.

I'll try everything and update.




--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
awmurray
2017-12-07 20:46:57 UTC
Permalink
I put the EAR in the /apps folder and made the fix in tomee.xml:
<Deployments dir="apps" />

It deployed OK.

Now I'm having a mystery error when trying to use the app.

I'm getting killed in the EEFilter class:
javax.servlet.ServletException: Filter execution threw an exception
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:199)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
at
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
at
org.apache.openejb.server.httpd.EEFilter.doFilter(EEFilter.java:65)

The exception i'm seeing in the debugger is:

java.lang.AbstractMethodError:
javax.ws.rs.core.Response.getStatusInfo()Ljavax/ws/rs/core/Response$StatusType;

That's a dead end in the JVM in my head - what's up?



--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
Romain Manni-Bucau
2017-12-08 05:56:26 UTC
Permalink
You have jaxrs api in your app. Just remove it.
Post by awmurray
<Deployments dir="apps" />
It deployed OK.
Now I'm having a mystery error when trying to use the app.
javax.servlet.ServletException: Filter execution threw an exception
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
ApplicationFilterChain.java:199)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(
ApplicationFilterChain.java:165)
at
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
ApplicationFilterChain.java:192)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(
ApplicationFilterChain.java:165)
at
org.apache.openejb.server.httpd.EEFilter.doFilter(EEFilter.java:65)
javax.ws.rs.core.Response.getStatusInfo()Ljavax/ws/rs/
core/Response$StatusType;
That's a dead end in the JVM in my head - what's up?
--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-
f979441.html
awmurray
2017-12-08 18:22:22 UTC
Permalink
I think I found it, but I can't get rid of it :)

This looks like it is pulling in jaxrs-api-2.3.6.Final.jar as part of
resteasy-jaxrs-2.3.6.Final.jar.

In the pom:
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
<exclusions>
<exclusion>
<artifactId>slf4j-simple</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
<exclusion>
<artifactId>jcl-over-slf4j</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
<exclusion>
<artifactId>commons-codec</artifactId>
<groupId>commons-codec</groupId>
</exclusion>
<exclusion>
<artifactId>org.scannotation</artifactId>
<groupId>scannotation</groupId>
</exclusion>
</exclusions>
</dependency>


I tried to exclude jaxrs-api, but I might not have done it correctly. Do I
need to upgrade resteasy?

Thanks!



--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
Romain Manni-Bucau
2017-12-08 20:11:10 UTC
Permalink
Or downgrade to latch tomee jaxrs 2.0 target.
Post by awmurray
I think I found it, but I can't get rid of it :)
This looks like it is pulling in jaxrs-api-2.3.6.Final.jar as part of
resteasy-jaxrs-2.3.6.Final.jar.
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
<exclusions>
<exclusion>
<artifactId>slf4j-simple</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
<exclusion>
<artifactId>jcl-over-slf4j</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
<exclusion>
<artifactId>commons-codec</artifactId>
<groupId>commons-codec</groupId>
</exclusion>
<exclusion>
<artifactId>org.scannotation</artifactId>
<groupId>scannotation</groupId>
</exclusion>
</exclusions>
</dependency>
I tried to exclude jaxrs-api, but I might not have done it correctly. Do I
need to upgrade resteasy?
Thanks!
--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-
f979441.html
awmurray
2017-12-11 19:41:46 UTC
Permalink
Thanks. I was able to exclude the jaxrs-api in the pom.

I think I have a class loader problem now with the EAR/WARs. This used to
work under the older TomEE so it must be a change in the way class loaders
work.

I have this in tomee/apps/myappEAR/webModuleOne/WEB-INF/web/xml:

<display-name>webModuleOne</display-name>
<context-param>
<param-name>resteasy.providers</param-name>
<param-value>com.widgets.CustomThrowableMapper</param-value>
</context-param>
<context-param>
<param-name>resteasy.resources</param-name>
<param-value>
[a comma separated list of classes omitted]
</param-value>
</context-param>

The exception is can't find com.widgets.CustomThrowableMapper:

java.lang.ClassNotFoundException: com.widgets.CustomThrowableMapper
at
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1285)
at
org.apache.tomee.catalina.TomEEWebappClassLoader.loadWithDelegate(TomEEWebappClassLoader.java:211)
at
org.apache.tomee.catalina.TomEEWebappClassLoader.loadClass(TomEEWebappClassLoader.java:201)
at
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)
at
org.apache.openejb.server.rest.RESTService.appProviders(RESTService.java:567)
at
org.apache.openejb.server.rest.RESTService.addAppProvidersIfNeeded(RESTService.java:296)
at
org.apache.openejb.server.rest.RESTService.afterApplicationCreated(RESTService.java:132)
at
org.apache.tomee.webservices.TomeeJaxRsService.afterApplicationCreated(TomeeJaxRsService.java:53)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)





--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
awmurray
2017-12-06 16:36:06 UTC
Permalink
Is this the right one?

https://repository.apache.org/content/groups/snapshots/org/apache/tomee/apache-tomee/7.0.5-SNAPSHOT/apache-tomee-7.0.5-20171206.041044-73-plus.zip





--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
Jonathan Gallimore
2017-12-06 16:38:11 UTC
Permalink
That should be good.

Cheers

Jon
Post by awmurray
Is this the right one?
https://repository.apache.org/content/groups/snapshots/org/
apache/tomee/apache-tomee/7.0.5-SNAPSHOT/apache-tomee-7.0.5-
20171206.041044-73-plus.zip
--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-
f979441.html
Loading...