buildbot success in on tomee-trunk-ubuntu-jvm8

2019-01-24 Thread buildbot
The Buildbot has detected a restored build on builder tomee-trunk-ubuntu-jvm8 
while building tomee. Full details are available at:
https://ci.apache.org/builders/tomee-trunk-ubuntu-jvm8/builds/1008

Buildbot URL: https://ci.apache.org/

Buildslave for this Build: bb_qnode7_ubuntu

Build Reason: The SingleBranchScheduler scheduler named 
'on-tomee-trunk-ubuntu-jvm8-commit' triggered this build
Build Source Stamp: [branch master] f5fd26ec101f775e00dcba9bf4652f4b9adbda6a
Blamelist: Jean-Louis Monteiro 

Build succeeded!

Sincerely,
 -The Buildbot





[tomee] branch master updated: checkstyle

2019-01-24 Thread jlmonteiro
This is an automated email from the ASF dual-hosted git repository.

jlmonteiro pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomee.git


The following commit(s) were added to refs/heads/master by this push:
 new f5fd26e  checkstyle
f5fd26e is described below

commit f5fd26ec101f775e00dcba9bf4652f4b9adbda6a
Author: Jean-Louis Monteiro 
AuthorDate: Thu Jan 24 22:12:54 2019 +0100

checkstyle
---
 .../src/main/java/org/apache/openejb/config/CmpJpaConversion.java| 1 -
 examples/mp-rest-jwt-jwk/src/test/resources/arquillian.xml   | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/container/openejb-core/src/main/java/org/apache/openejb/config/CmpJpaConversion.java
 
b/container/openejb-core/src/main/java/org/apache/openejb/config/CmpJpaConversion.java
index 3f0a90e..73fefe6 100644
--- 
a/container/openejb-core/src/main/java/org/apache/openejb/config/CmpJpaConversion.java
+++ 
b/container/openejb-core/src/main/java/org/apache/openejb/config/CmpJpaConversion.java
@@ -64,7 +64,6 @@ import org.apache.openejb.loader.SystemInstance;
 import org.apache.openejb.util.LogCategory;
 import org.apache.openejb.util.Logger;
 import org.apache.openejb.util.Strings;
-import org.apache.xbean.finder.ResourceFinder;
 
 import javax.ejb.EJBLocalObject;
 import java.lang.reflect.Field;
diff --git a/examples/mp-rest-jwt-jwk/src/test/resources/arquillian.xml 
b/examples/mp-rest-jwt-jwk/src/test/resources/arquillian.xml
index 31daf70..8473e1e 100644
--- a/examples/mp-rest-jwt-jwk/src/test/resources/arquillian.xml
+++ b/examples/mp-rest-jwt-jwk/src/test/resources/arquillian.xml
@@ -27,6 +27,7 @@
 -1
 microprofile
 true
+false
 true
 target/server
 target/arquillian



[tomee] branch tomee-8.0.0-M2-prepare created (now d18948b)

2019-01-24 Thread dblevins
This is an automated email from the ASF dual-hosted git repository.

dblevins pushed a change to branch tomee-8.0.0-M2-prepare
in repository https://gitbox.apache.org/repos/asf/tomee.git.


  at d18948b  Merge pull request #374 from otaviojava/orm_xml_ear

No new revisions were added by this update.



buildbot failure in on tomee-trunk-ubuntu-jvm8

2019-01-24 Thread buildbot
The Buildbot has detected a new failure on builder tomee-trunk-ubuntu-jvm8 
while building tomee. Full details are available at:
https://ci.apache.org/builders/tomee-trunk-ubuntu-jvm8/builds/1007

Buildbot URL: https://ci.apache.org/

Buildslave for this Build: bb_qnode7_ubuntu

Build Reason: The SingleBranchScheduler scheduler named 
'on-tomee-trunk-ubuntu-jvm8-commit' triggered this build
Build Source Stamp: [branch master] d18948b5948e261737afc8fc6e3a77ee882c4d08
Blamelist: Jonathan Gallimore ,Otavio Santana 


BUILD FAILED: failed check-formatting

Sincerely,
 -The Buildbot





[tomee] branch master updated (138993f -> d18948b)

2019-01-24 Thread jgallimore
This is an automated email from the ASF dual-hosted git repository.

jgallimore pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/tomee.git.


from 138993f  Merge pull request #379 from BogdanStirbat/TOMEE-2370
 new f5f1e48  creates new ear test
 new fa47396  fixes custom
 new cb1e66f  fixes aling
 new 7e194a1  fixes constant name
 new f33be90  Makes readEntityMapping private
 new af2e275  fixes constant name
 new bf2b944  creates entitymappingurl finder interface
 new d959af4  makes MEAT_INF visibla by package
 new 55dfeb4  defines url
 new 40b5311  define log as info
 new 602d1f5  defines EntityMappingURLfinder
 new 6e6fa22  fixes log
 new 25a59c6  comments the test
 new 48a0230  reverts to the master
 new 2f4a230  returns messages to master
 new b131d64  adds application xml
 new bf0eac9  changes test
 new 64d743f  fixes the archive names
 new aab400d  fixes application.xml
 new 90f56dc  improves log
 new 576275e  moves servelet to the war archive
 new b287dc4  "Mostly" working test
 new d18948b  Merge pull request #374 from otaviojava/orm_xml_ear

The 12030 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 ...tomOrmXmlTest.java => CustomOrmXmlEarTest.java} |  36 +--
 .../arquillian/tests/cmp/sample/application.xml|  12 +++
 .../apache/openejb/config/CmpJpaConversion.java|  69 ++---
 .../openejb/config/ConfigurationFactory.java   |   2 +-
 .../apache/openejb/config/DeploymentLoader.java|  82 +++
 .../apache/openejb/config/DeploymentsResolver.java |   2 +-
 .../openejb/config/EntityMappingURLFinder.java | 112 +
 .../org/apache/openejb/config/NewLoaderLogic.java  |   2 +-
 .../org/apache/openejb/config/ReadDescriptors.java |  12 +--
 .../java/org/apache/openejb/config/TldScanner.java |  14 +--
 10 files changed, 237 insertions(+), 106 deletions(-)
 copy 
arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/cmp/sample/{CustomOrmXmlTest.java
 => CustomOrmXmlEarTest.java} (72%)
 create mode 100644 
arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/resources/org/apache/openejb/arquillian/tests/cmp/sample/application.xml
 create mode 100644 
container/openejb-core/src/main/java/org/apache/openejb/config/EntityMappingURLFinder.java



[jira] [Commented] (TOMEE-2260) TomEE should support library asm7 (xbean 4.11 or higher) to support fully Java 11

2019-01-24 Thread Jonas Wolf (JIRA)


[ 
https://issues.apache.org/jira/browse/TOMEE-2260?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16751204#comment-16751204
 ] 

Jonas Wolf commented on TOMEE-2260:
---

Seems like this may have been solved with TOMEE-2272.

> TomEE should support library asm7 (xbean 4.11 or higher) to support fully 
> Java 11
> -
>
> Key: TOMEE-2260
> URL: https://issues.apache.org/jira/browse/TOMEE-2260
> Project: TomEE
>  Issue Type: Dependency upgrade
>  Components: TomEE Core Server
>Affects Versions: 7.0.5, 7.1.0, 8.0.0-M1
> Environment: Java 11
>Reporter: Artur Linhart
>Priority: Major
>
> Because the TomEE server uses for the analysis of the deployed classes the 
> asm library, there should be included the library asm7, which does officially 
> support all of the features from java 11. It is especially important because 
> Java 11 is the LTS Version from Oracle, so very much suitable for the 
> development of production stable applications. Todays asm6 library used in 
> versions 7.1.0 and 8.0.0-M1 does not support java 11 officially and fully, 
> asm6 in versions 6.2 and 6.2.1 (in xbeans 4.9 and 4.10) supports java 11 only 
> in experimental way. See
> [https://asm.ow2.io/versions.html]
> +Depends on:+
> TOMEE-2272



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


[jira] [Commented] (TOMEE-2260) TomEE should support library asm7 (xbean 4.11 or higher) to support fully Java 11

2019-01-24 Thread Jonas Wolf (JIRA)


[ 
https://issues.apache.org/jira/browse/TOMEE-2260?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16751118#comment-16751118
 ] 

Jonas Wolf commented on TOMEE-2260:
---

We are trying to upgrade our existing stack TomEE+ 1.7.4/Java 8 to TomEE+ 
7.1.0/Java 11. When starting the app, we run into the following error:
{noformat}
24-Jan-2019 14:20:31.446 SEVERE [localhost-startStop-1] 
org.apache.tomee.loader.log.Slf4jLog.error ContainerBase.addChild: start: 
 org.apache.catalina.LifecycleException: Failed to start component 
[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/foobar]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:754)
at 
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:730)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:985)
at 
org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1857)
at 
java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at 
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at 
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: org.apache.tomee.catalina.TomEERuntimeException: 
org.apache.openejb.OpenEJBException: Unable to create annotation scanner for 
web module foobar: null
at 
org.apache.tomee.catalina.TomcatWebAppBuilder.loadApplication(TomcatWebAppBuilder.java:2336)
at 
org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1192)
at 
org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:1125)
at 
org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:133)
at 
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)
at 
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5154)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 10 more
Caused by: org.apache.openejb.OpenEJBException: Unable to create annotation 
scanner for web module foobar: null
at 
org.apache.openejb.config.DeploymentLoader.addWebModule(DeploymentLoader.java:890)
at 
org.apache.openejb.config.DeploymentLoader.load(DeploymentLoader.java:237)
at 
org.apache.tomee.catalina.TomcatWebAppBuilder.loadApplication(TomcatWebAppBuilder.java:2334)
... 16 more
Caused by: java.lang.UnsupportedOperationException
at 
org.apache.xbean.asm6.ClassVisitor.visitNestMemberExperimental(ClassVisitor.java:248)
at org.apache.xbean.asm6.ClassReader.accept(ClassReader.java:651)
at org.apache.xbean.asm6.ClassReader.accept(ClassReader.java:391)
at 
org.apache.xbean.finder.AnnotationFinder.readClassDef(AnnotationFinder.java:1168)
at 
org.apache.xbean.finder.AnnotationFinder.(AnnotationFinder.java:145)
at 
org.apache.xbean.finder.AnnotationFinder.(AnnotationFinder.java:158)
at 
org.apache.openejb.config.FinderFactory$OpenEJBAnnotationFinder.(FinderFactory.java:546)
at 
org.apache.openejb.config.FinderFactory.newFinder(FinderFactory.java:267)
at org.apache.openejb.config.FinderFactory.create(FinderFactory.java:80)
at 
org.apache.openejb.config.FinderFactory.createFinder(FinderFactory.java:69)
at 
org.apache.openejb.config.DeploymentLoader.addWebModule(DeploymentLoader.java:882)
{noformat}
As far as I can see, this is because asm6 is not compatible with Java 11.

When will TomEE fully support Java 11?

> TomEE should support library asm7 (xbean 4.11 or higher) to support fully 
> Java 11
> -
>
> Key: TOMEE-2260
> URL: https://issues.apache.org/jira/browse/TOMEE-2260
> Project: TomEE
>  Issue Type: Dependency upgrade
>  Components: TomEE Core Server
>Affects Versions: 7.0.5, 7.1.0, 8.0.0-M1
> Environment: Java 11
>Reporter: Artur Linhart
>Priority: Major
>
> Because the TomEE server uses for the analysis of the deployed classes the 
> asm library, there should be included the library asm7, which does officially 
> support all of the features from java 11. It is especially important because 
> Java 11 is the LTS Version from Oracle, so very much suitable for the 
> development of production stable applications. Todays asm6 library used in 
> versions 7.1.0 and 8.0.0-M1 does not support 

[jira] [Commented] (TOMEE-2458) Loading Beans causes ClassNotFoundException when using custom context classloader

2019-01-24 Thread Romain Manni-Bucau (JIRA)


[ 
https://issues.apache.org/jira/browse/TOMEE-2458?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16751105#comment-16751105
 ] 

Romain Manni-Bucau commented on TOMEE-2458:
---

[~dkwakkel] this extension 
https://github.com/apache/tomee/blob/master/container/openejb-core/src/main/java/org/apache/openejb/classloader/ClassLoaderConfigurer.java

> Loading Beans causes ClassNotFoundException when using custom context 
> classloader
> -
>
> Key: TOMEE-2458
> URL: https://issues.apache.org/jira/browse/TOMEE-2458
> Project: TomEE
>  Issue Type: Bug
>  Components: TomEE Core Server
>Affects Versions: 8.0.0-M1
>Reporter: Gerwin
>Priority: Major
> Attachments: myclassloader.jar, myclassloader.jar.withtccl, 
> myexception.jar, myexception.jar.withbean, repro.war
>
>
> h4. Steps to reproduce
> # Create a custom Exception and put it in {{CATALINA_HOME/myexception.jar}}
> {code:java}
> public class MyException extends Exception {
> }
> {code}
> # Create a custom ClassLoader and put it in 
> {{CATALINA_HOME/myclassloader.jar}}
> {code:java}
> public class MyClassLoader extends WebappClassLoader {
>   public MyClassLoader(ClassLoader parent)throws MalformedURLException {
>   super(parent);
>   addURL(Paths.get(System.getProperty("catalina.home"), 
> "myexception.jar").toUri().toURL());
>   }
> }
> {code}
> # Put the classloader on the classpath
> {code:none|title=CATALINA_HOME/conf/catalina.properties}
> common.loader="${catalina.base}/lib","${catalina.base}/lib/*.jar","${catalina.home}/lib","${catalina.home}/lib/*.jar","${catalina.home}/myclassloader.jar"
> {code}
> # Use the classloader in the context
> {code:xml|title=CATALINA_HOME/webapps/repro/META-INF/context.xml}
> 
> 
> 
> {code}
> # Create a bean with the {{MyException}} in the method signature
> {code:java|title=CATALINA_HOME/webapps/repro/WEB-INF/classes/MyBean.class}
> @Stateless(name = "MyBeanEJB")
> public class MyBean {
>   public String hello() throws MyException {
>   return "hello";
>   }
> }
> {code}
> # Use the bean
> {code:java|title=CATALINA_HOME/webapps/repro/index.jsp}
> <%@ page import="MyBean" %>
> <%@ page contentType="text/html;charset=UTF-8" language="java" %>
> 
>   
>   <%
> MyBean myBean = new MyBean();
> out.println(myBean.hello());
>   %>
>   
> 
> {code}
> h4. Actual result
> {code:none|title=CATALINA_HOME/logs/catalina.0.log}
> jan 23, 2019 4:37:17 PM sun.reflect.DelegatingMethodAccessorImpl invoke
> INFO: Starting Servlet Engine: Apache Tomcat (TomEE)/9.0.12 (8.0.0-SNAPSHOT)
> jan 23, 2019 4:37:17 PM sun.reflect.DelegatingMethodAccessorImpl invoke
> INFO: Deploying web application archive [C:\Program 
> Files\TomEE\webapps\repro.war]
> jan 23, 2019 4:37:17 PM org.apache.tomee.catalina.TomcatWebAppBuilder init
> INFO: - localhost -> /repro
> jan 23, 2019 4:37:17 PM org.apache.openejb.config.ConfigurationFactory 
> configureApplication
> INFO: Configuring enterprise application: C:\Program Files\TomEE\webapps\repro
> jan 23, 2019 4:37:17 PM sun.reflect.NativeMethodAccessorImpl invoke
> SEVERE: ContainerBase.addChild: start: 
> org.apache.catalina.LifecycleException: Failed to start component 
> [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/repro]]
>   at 
> org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:441)
>   at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
>   at 
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:743)
>   at 
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:719)
>   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:703)
>   at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:986)
>   at 
> org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1858)
>   at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>   at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>   at 
> org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
>   at 
> java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
>   at 
> org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:772)
>   at 
> org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:426)
>   at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1585)
>   at 
> org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:308)
>   at 
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
>   at 
> 

[jira] [Commented] (TOMEE-2458) Loading Beans causes ClassNotFoundException when using custom context classloader

2019-01-24 Thread Donald Kwakkel (JIRA)


[ 
https://issues.apache.org/jira/browse/TOMEE-2458?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16751078#comment-16751078
 ] 

Donald Kwakkel commented on TOMEE-2458:
---

[~romain.manni-bucau]: What do you mean with ' openejb classloader customizer'?

> Loading Beans causes ClassNotFoundException when using custom context 
> classloader
> -
>
> Key: TOMEE-2458
> URL: https://issues.apache.org/jira/browse/TOMEE-2458
> Project: TomEE
>  Issue Type: Bug
>  Components: TomEE Core Server
>Affects Versions: 8.0.0-M1
>Reporter: Gerwin
>Priority: Major
> Attachments: myclassloader.jar, myclassloader.jar.withtccl, 
> myexception.jar, myexception.jar.withbean, repro.war
>
>
> h4. Steps to reproduce
> # Create a custom Exception and put it in {{CATALINA_HOME/myexception.jar}}
> {code:java}
> public class MyException extends Exception {
> }
> {code}
> # Create a custom ClassLoader and put it in 
> {{CATALINA_HOME/myclassloader.jar}}
> {code:java}
> public class MyClassLoader extends WebappClassLoader {
>   public MyClassLoader(ClassLoader parent)throws MalformedURLException {
>   super(parent);
>   addURL(Paths.get(System.getProperty("catalina.home"), 
> "myexception.jar").toUri().toURL());
>   }
> }
> {code}
> # Put the classloader on the classpath
> {code:none|title=CATALINA_HOME/conf/catalina.properties}
> common.loader="${catalina.base}/lib","${catalina.base}/lib/*.jar","${catalina.home}/lib","${catalina.home}/lib/*.jar","${catalina.home}/myclassloader.jar"
> {code}
> # Use the classloader in the context
> {code:xml|title=CATALINA_HOME/webapps/repro/META-INF/context.xml}
> 
> 
> 
> {code}
> # Create a bean with the {{MyException}} in the method signature
> {code:java|title=CATALINA_HOME/webapps/repro/WEB-INF/classes/MyBean.class}
> @Stateless(name = "MyBeanEJB")
> public class MyBean {
>   public String hello() throws MyException {
>   return "hello";
>   }
> }
> {code}
> # Use the bean
> {code:java|title=CATALINA_HOME/webapps/repro/index.jsp}
> <%@ page import="MyBean" %>
> <%@ page contentType="text/html;charset=UTF-8" language="java" %>
> 
>   
>   <%
> MyBean myBean = new MyBean();
> out.println(myBean.hello());
>   %>
>   
> 
> {code}
> h4. Actual result
> {code:none|title=CATALINA_HOME/logs/catalina.0.log}
> jan 23, 2019 4:37:17 PM sun.reflect.DelegatingMethodAccessorImpl invoke
> INFO: Starting Servlet Engine: Apache Tomcat (TomEE)/9.0.12 (8.0.0-SNAPSHOT)
> jan 23, 2019 4:37:17 PM sun.reflect.DelegatingMethodAccessorImpl invoke
> INFO: Deploying web application archive [C:\Program 
> Files\TomEE\webapps\repro.war]
> jan 23, 2019 4:37:17 PM org.apache.tomee.catalina.TomcatWebAppBuilder init
> INFO: - localhost -> /repro
> jan 23, 2019 4:37:17 PM org.apache.openejb.config.ConfigurationFactory 
> configureApplication
> INFO: Configuring enterprise application: C:\Program Files\TomEE\webapps\repro
> jan 23, 2019 4:37:17 PM sun.reflect.NativeMethodAccessorImpl invoke
> SEVERE: ContainerBase.addChild: start: 
> org.apache.catalina.LifecycleException: Failed to start component 
> [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/repro]]
>   at 
> org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:441)
>   at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
>   at 
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:743)
>   at 
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:719)
>   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:703)
>   at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:986)
>   at 
> org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1858)
>   at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>   at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>   at 
> org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
>   at 
> java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
>   at 
> org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:772)
>   at 
> org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:426)
>   at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1585)
>   at 
> org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:308)
>   at 
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
>   at 
> org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:424)
>   at 
> 

[jira] [Commented] (TOMEE-2458) Loading Beans causes ClassNotFoundException when using custom context classloader

2019-01-24 Thread Roberto Cortez (JIRA)


[ 
https://issues.apache.org/jira/browse/TOMEE-2458?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16750973#comment-16750973
 ] 

Roberto Cortez commented on TOMEE-2458:
---

[~dkwakkel] I believe [~romain.manni-bucau] is right.

The problem here is that some of the MP libs require Bean injection on their 
Extensions. So, the Extension is loading, but their CDI beans are not, hence 
you get that weird NPE.

Most likely, the CDI Extensions are being loaded by one class loader and their 
beans scanning by another loader, or not even scanned at all.

Can you have a look here 
org.apache.openejb.config.DeploymentLoader#addBeansXmls(org.apache.openejb.config.WebModule).
 This is where the url list of jars is obtained to perform CDI scanning for 
beans. So, it needs to return all the MP libs in here.

> Loading Beans causes ClassNotFoundException when using custom context 
> classloader
> -
>
> Key: TOMEE-2458
> URL: https://issues.apache.org/jira/browse/TOMEE-2458
> Project: TomEE
>  Issue Type: Bug
>  Components: TomEE Core Server
>Affects Versions: 8.0.0-M1
>Reporter: Gerwin
>Priority: Major
> Attachments: myclassloader.jar, myclassloader.jar.withtccl, 
> myexception.jar, myexception.jar.withbean, repro.war
>
>
> h4. Steps to reproduce
> # Create a custom Exception and put it in {{CATALINA_HOME/myexception.jar}}
> {code:java}
> public class MyException extends Exception {
> }
> {code}
> # Create a custom ClassLoader and put it in 
> {{CATALINA_HOME/myclassloader.jar}}
> {code:java}
> public class MyClassLoader extends WebappClassLoader {
>   public MyClassLoader(ClassLoader parent)throws MalformedURLException {
>   super(parent);
>   addURL(Paths.get(System.getProperty("catalina.home"), 
> "myexception.jar").toUri().toURL());
>   }
> }
> {code}
> # Put the classloader on the classpath
> {code:none|title=CATALINA_HOME/conf/catalina.properties}
> common.loader="${catalina.base}/lib","${catalina.base}/lib/*.jar","${catalina.home}/lib","${catalina.home}/lib/*.jar","${catalina.home}/myclassloader.jar"
> {code}
> # Use the classloader in the context
> {code:xml|title=CATALINA_HOME/webapps/repro/META-INF/context.xml}
> 
> 
> 
> {code}
> # Create a bean with the {{MyException}} in the method signature
> {code:java|title=CATALINA_HOME/webapps/repro/WEB-INF/classes/MyBean.class}
> @Stateless(name = "MyBeanEJB")
> public class MyBean {
>   public String hello() throws MyException {
>   return "hello";
>   }
> }
> {code}
> # Use the bean
> {code:java|title=CATALINA_HOME/webapps/repro/index.jsp}
> <%@ page import="MyBean" %>
> <%@ page contentType="text/html;charset=UTF-8" language="java" %>
> 
>   
>   <%
> MyBean myBean = new MyBean();
> out.println(myBean.hello());
>   %>
>   
> 
> {code}
> h4. Actual result
> {code:none|title=CATALINA_HOME/logs/catalina.0.log}
> jan 23, 2019 4:37:17 PM sun.reflect.DelegatingMethodAccessorImpl invoke
> INFO: Starting Servlet Engine: Apache Tomcat (TomEE)/9.0.12 (8.0.0-SNAPSHOT)
> jan 23, 2019 4:37:17 PM sun.reflect.DelegatingMethodAccessorImpl invoke
> INFO: Deploying web application archive [C:\Program 
> Files\TomEE\webapps\repro.war]
> jan 23, 2019 4:37:17 PM org.apache.tomee.catalina.TomcatWebAppBuilder init
> INFO: - localhost -> /repro
> jan 23, 2019 4:37:17 PM org.apache.openejb.config.ConfigurationFactory 
> configureApplication
> INFO: Configuring enterprise application: C:\Program Files\TomEE\webapps\repro
> jan 23, 2019 4:37:17 PM sun.reflect.NativeMethodAccessorImpl invoke
> SEVERE: ContainerBase.addChild: start: 
> org.apache.catalina.LifecycleException: Failed to start component 
> [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/repro]]
>   at 
> org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:441)
>   at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
>   at 
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:743)
>   at 
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:719)
>   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:703)
>   at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:986)
>   at 
> org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1858)
>   at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>   at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>   at 
> org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
>   at 
> java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
>   at 
> 

[jira] [Commented] (TOMEE-2458) Loading Beans causes ClassNotFoundException when using custom context classloader

2019-01-24 Thread Romain Manni-Bucau (JIRA)


[ 
https://issues.apache.org/jira/browse/TOMEE-2458?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16750877#comment-16750877
 ] 

Romain Manni-Bucau commented on TOMEE-2458:
---

[~dkwakkel] nop, this does not look the same issue like that. ParentClassLoader 
must be openejb classloader and never the TCCL of an app (it must not be able 
to load any app class to be concrete but only server libs except when all are 
in the same flat classloader). Here the issue is that the scanned loader does 
not match your custom loader strategy since we just respect webapp strategies. 
Using WEB-INF/jars.txt or openejb classloader customizer would work since the 
scanning and runtime will them use the same list of jars.

> Loading Beans causes ClassNotFoundException when using custom context 
> classloader
> -
>
> Key: TOMEE-2458
> URL: https://issues.apache.org/jira/browse/TOMEE-2458
> Project: TomEE
>  Issue Type: Bug
>  Components: TomEE Core Server
>Affects Versions: 8.0.0-M1
>Reporter: Gerwin
>Priority: Major
> Attachments: myclassloader.jar, myclassloader.jar.withtccl, 
> myexception.jar, myexception.jar.withbean, repro.war
>
>
> h4. Steps to reproduce
> # Create a custom Exception and put it in {{CATALINA_HOME/myexception.jar}}
> {code:java}
> public class MyException extends Exception {
> }
> {code}
> # Create a custom ClassLoader and put it in 
> {{CATALINA_HOME/myclassloader.jar}}
> {code:java}
> public class MyClassLoader extends WebappClassLoader {
>   public MyClassLoader(ClassLoader parent)throws MalformedURLException {
>   super(parent);
>   addURL(Paths.get(System.getProperty("catalina.home"), 
> "myexception.jar").toUri().toURL());
>   }
> }
> {code}
> # Put the classloader on the classpath
> {code:none|title=CATALINA_HOME/conf/catalina.properties}
> common.loader="${catalina.base}/lib","${catalina.base}/lib/*.jar","${catalina.home}/lib","${catalina.home}/lib/*.jar","${catalina.home}/myclassloader.jar"
> {code}
> # Use the classloader in the context
> {code:xml|title=CATALINA_HOME/webapps/repro/META-INF/context.xml}
> 
> 
> 
> {code}
> # Create a bean with the {{MyException}} in the method signature
> {code:java|title=CATALINA_HOME/webapps/repro/WEB-INF/classes/MyBean.class}
> @Stateless(name = "MyBeanEJB")
> public class MyBean {
>   public String hello() throws MyException {
>   return "hello";
>   }
> }
> {code}
> # Use the bean
> {code:java|title=CATALINA_HOME/webapps/repro/index.jsp}
> <%@ page import="MyBean" %>
> <%@ page contentType="text/html;charset=UTF-8" language="java" %>
> 
>   
>   <%
> MyBean myBean = new MyBean();
> out.println(myBean.hello());
>   %>
>   
> 
> {code}
> h4. Actual result
> {code:none|title=CATALINA_HOME/logs/catalina.0.log}
> jan 23, 2019 4:37:17 PM sun.reflect.DelegatingMethodAccessorImpl invoke
> INFO: Starting Servlet Engine: Apache Tomcat (TomEE)/9.0.12 (8.0.0-SNAPSHOT)
> jan 23, 2019 4:37:17 PM sun.reflect.DelegatingMethodAccessorImpl invoke
> INFO: Deploying web application archive [C:\Program 
> Files\TomEE\webapps\repro.war]
> jan 23, 2019 4:37:17 PM org.apache.tomee.catalina.TomcatWebAppBuilder init
> INFO: - localhost -> /repro
> jan 23, 2019 4:37:17 PM org.apache.openejb.config.ConfigurationFactory 
> configureApplication
> INFO: Configuring enterprise application: C:\Program Files\TomEE\webapps\repro
> jan 23, 2019 4:37:17 PM sun.reflect.NativeMethodAccessorImpl invoke
> SEVERE: ContainerBase.addChild: start: 
> org.apache.catalina.LifecycleException: Failed to start component 
> [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/repro]]
>   at 
> org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:441)
>   at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
>   at 
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:743)
>   at 
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:719)
>   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:703)
>   at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:986)
>   at 
> org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1858)
>   at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>   at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>   at 
> org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
>   at 
> java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
>   at 
> org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:772)
>   at 
> 

[jira] [Comment Edited] (TOMEE-2458) Loading Beans causes ClassNotFoundException when using custom context classloader

2019-01-24 Thread Donald Kwakkel (JIRA)


[ 
https://issues.apache.org/jira/browse/TOMEE-2458?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16750833#comment-16750833
 ] 

Donald Kwakkel edited comment on TOMEE-2458 at 1/24/19 7:57 AM:


I found a similair issue about tccl not used here: TOMEE-877. 
[~romain.manni-bucau] is this the same issue? And if so how should we solve 
above problems?


was (Author: dkwakkel):
I found a similair issue about tccl not used here: TOMEE-877. 
[~romain.manni-bucau] is this the same issue?

> Loading Beans causes ClassNotFoundException when using custom context 
> classloader
> -
>
> Key: TOMEE-2458
> URL: https://issues.apache.org/jira/browse/TOMEE-2458
> Project: TomEE
>  Issue Type: Bug
>  Components: TomEE Core Server
>Affects Versions: 8.0.0-M1
>Reporter: Gerwin
>Priority: Major
> Attachments: myclassloader.jar, myclassloader.jar.withtccl, 
> myexception.jar, myexception.jar.withbean, repro.war
>
>
> h4. Steps to reproduce
> # Create a custom Exception and put it in {{CATALINA_HOME/myexception.jar}}
> {code:java}
> public class MyException extends Exception {
> }
> {code}
> # Create a custom ClassLoader and put it in 
> {{CATALINA_HOME/myclassloader.jar}}
> {code:java}
> public class MyClassLoader extends WebappClassLoader {
>   public MyClassLoader(ClassLoader parent)throws MalformedURLException {
>   super(parent);
>   addURL(Paths.get(System.getProperty("catalina.home"), 
> "myexception.jar").toUri().toURL());
>   }
> }
> {code}
> # Put the classloader on the classpath
> {code:none|title=CATALINA_HOME/conf/catalina.properties}
> common.loader="${catalina.base}/lib","${catalina.base}/lib/*.jar","${catalina.home}/lib","${catalina.home}/lib/*.jar","${catalina.home}/myclassloader.jar"
> {code}
> # Use the classloader in the context
> {code:xml|title=CATALINA_HOME/webapps/repro/META-INF/context.xml}
> 
> 
> 
> {code}
> # Create a bean with the {{MyException}} in the method signature
> {code:java|title=CATALINA_HOME/webapps/repro/WEB-INF/classes/MyBean.class}
> @Stateless(name = "MyBeanEJB")
> public class MyBean {
>   public String hello() throws MyException {
>   return "hello";
>   }
> }
> {code}
> # Use the bean
> {code:java|title=CATALINA_HOME/webapps/repro/index.jsp}
> <%@ page import="MyBean" %>
> <%@ page contentType="text/html;charset=UTF-8" language="java" %>
> 
>   
>   <%
> MyBean myBean = new MyBean();
> out.println(myBean.hello());
>   %>
>   
> 
> {code}
> h4. Actual result
> {code:none|title=CATALINA_HOME/logs/catalina.0.log}
> jan 23, 2019 4:37:17 PM sun.reflect.DelegatingMethodAccessorImpl invoke
> INFO: Starting Servlet Engine: Apache Tomcat (TomEE)/9.0.12 (8.0.0-SNAPSHOT)
> jan 23, 2019 4:37:17 PM sun.reflect.DelegatingMethodAccessorImpl invoke
> INFO: Deploying web application archive [C:\Program 
> Files\TomEE\webapps\repro.war]
> jan 23, 2019 4:37:17 PM org.apache.tomee.catalina.TomcatWebAppBuilder init
> INFO: - localhost -> /repro
> jan 23, 2019 4:37:17 PM org.apache.openejb.config.ConfigurationFactory 
> configureApplication
> INFO: Configuring enterprise application: C:\Program Files\TomEE\webapps\repro
> jan 23, 2019 4:37:17 PM sun.reflect.NativeMethodAccessorImpl invoke
> SEVERE: ContainerBase.addChild: start: 
> org.apache.catalina.LifecycleException: Failed to start component 
> [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/repro]]
>   at 
> org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:441)
>   at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
>   at 
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:743)
>   at 
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:719)
>   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:703)
>   at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:986)
>   at 
> org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1858)
>   at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>   at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>   at 
> org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
>   at 
> java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
>   at 
> org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:772)
>   at 
> org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:426)
>   at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1585)
>   at 
>