7.0.4 context reload affects resource

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

7.0.4 context reload affects resource

chongma
hi,
in src/main/webapp/META-INF/context.xml i have defined
<Resource id="mailResource" name="mailResource" auth="Container"
         type="javax.mail.Session" mail.smtp.host="mail.domain.tld"
         mail.smtp.port="465" mail.smtp.auth="true"
mail.smtp.user="[hidden email]"
         mail.smtp.password="password" password="password"
         mail.transport.protocol="smtp" mail.smtp.ssl.enable="true" />
it worked fine in 7.0.3 and works fine on startup of 7.0.4 but it seems
that now if the context reloads during development i get
SEVERE: Can't create resource null
javax.naming.NameNotFoundException: Name "Resource/mailResource" not found.
     at
org.apache.openejb.core.ivm.naming.IvmContext.federate(IvmContext.java:207)
     at
org.apache.openejb.core.ivm.naming.IvmContext.lookup(IvmContext.java:159)
     at
org.apache.openejb.core.ivm.naming.IvmContext.lookup(IvmContext.java:131)
     at
org.apache.tomee.common.AbstractObjectFactory.lookup(AbstractObjectFactory.java:102)
     at
org.apache.tomee.common.AbstractObjectFactory.getObjectInstance(AbstractObjectFactory.java:51)
     at
org.apache.tomee.common.ResourceFactory.getObjectInstance(ResourceFactory.java:49)
     at
org.apache.tomee.catalina.TomcatResourceFactory.create(TomcatResourceFactory.java:80)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
     at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     at java.lang.reflect.Method.invoke(Method.java:498)
     at
org.apache.xbean.recipe.ObjectRecipe.internalCreate(ObjectRecipe.java:298)
     at
org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:96)
     at
org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:61)
     at
org.apache.openejb.assembler.classic.Assembler.doCreateResource(Assembler.java:3072)
     at
org.apache.openejb.assembler.classic.Assembler.createResource(Assembler.java:2907)
     at
org.apache.openejb.config.ConfigurationFactory.doInstall(ConfigurationFactory.java:466)
     at
org.apache.openejb.config.ConfigurationFactory.install(ConfigurationFactory.java:459)
     at
org.apache.openejb.config.AutoConfig.installResource(AutoConfig.java:2193)
     at
org.apache.openejb.config.AutoConfig.processApplicationResources(AutoConfig.java:1026)
     at org.apache.openejb.config.AutoConfig.deploy(AutoConfig.java:190)
     at
org.apache.openejb.config.ConfigurationFactory$Chain.deploy(ConfigurationFactory.java:420)
     at
org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:1037)
     at
org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1277)
     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:5105)
     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
     at
org.apache.catalina.core.StandardContext.reload(StandardContext.java:3800)
     at
org.apache.catalina.loader.WebappLoader.backgroundProcess(WebappLoader.java:292)
     at
org.apache.tomee.catalina.TomEEWebappLoader.backgroundProcess(TomEEWebappLoader.java:61)
     at
org.apache.tomee.catalina.LazyStopLoader.backgroundProcess(LazyStopLoader.java:105)
     at
org.apache.catalina.core.StandardContext.backgroundProcess(StandardContext.java:5563)
     at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1388)
     at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1392)
     at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1392)
     at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1360)
     at java.lang.Thread.run(Thread.java:748)
Reply | Threaded
Open this post in threaded view
|

Re: 7.0.4 context reload affects resource

agumbrecht
Hi Matthew,

The users list is not the ideal place to post stacktraces or bugs.

Can you please file this in a JIRA ticket so we can track it better
here: https://issues.apache.org/jira/projects/TOMEE

Thanks,

Andy.

On 11/10/17 03:36, Matthew Broadhead wrote:

> hi,
> in src/main/webapp/META-INF/context.xml i have defined
> <Resource id="mailResource" name="mailResource" auth="Container"
>         type="javax.mail.Session" mail.smtp.host="mail.domain.tld"
>         mail.smtp.port="465" mail.smtp.auth="true"
> mail.smtp.user="[hidden email]"
>         mail.smtp.password="password" password="password"
>         mail.transport.protocol="smtp" mail.smtp.ssl.enable="true" />
> it worked fine in 7.0.3 and works fine on startup of 7.0.4 but it
> seems that now if the context reloads during development i get
> SEVERE: Can't create resource null
> javax.naming.NameNotFoundException: Name "Resource/mailResource" not
> found.
>     at
> org.apache.openejb.core.ivm.naming.IvmContext.federate(IvmContext.java:207)
>     at
> org.apache.openejb.core.ivm.naming.IvmContext.lookup(IvmContext.java:159)
>     at
> org.apache.openejb.core.ivm.naming.IvmContext.lookup(IvmContext.java:131)
>     at
> org.apache.tomee.common.AbstractObjectFactory.lookup(AbstractObjectFactory.java:102)
>     at
> org.apache.tomee.common.AbstractObjectFactory.getObjectInstance(AbstractObjectFactory.java:51)
>     at
> org.apache.tomee.common.ResourceFactory.getObjectInstance(ResourceFactory.java:49)
>     at
> org.apache.tomee.catalina.TomcatResourceFactory.create(TomcatResourceFactory.java:80)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>     at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>     at java.lang.reflect.Method.invoke(Method.java:498)
>     at
> org.apache.xbean.recipe.ObjectRecipe.internalCreate(ObjectRecipe.java:298)
>     at
> org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:96)
>     at
> org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:61)
>     at
> org.apache.openejb.assembler.classic.Assembler.doCreateResource(Assembler.java:3072)
>     at
> org.apache.openejb.assembler.classic.Assembler.createResource(Assembler.java:2907)
>     at
> org.apache.openejb.config.ConfigurationFactory.doInstall(ConfigurationFactory.java:466)
>     at
> org.apache.openejb.config.ConfigurationFactory.install(ConfigurationFactory.java:459)
>     at
> org.apache.openejb.config.AutoConfig.installResource(AutoConfig.java:2193)
>     at
> org.apache.openejb.config.AutoConfig.processApplicationResources(AutoConfig.java:1026)
>     at org.apache.openejb.config.AutoConfig.deploy(AutoConfig.java:190)
>     at
> org.apache.openejb.config.ConfigurationFactory$Chain.deploy(ConfigurationFactory.java:420)
>     at
> org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:1037)
>     at
> org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1277)
>     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:5105)
>     at
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
>     at
> org.apache.catalina.core.StandardContext.reload(StandardContext.java:3800)
>     at
> org.apache.catalina.loader.WebappLoader.backgroundProcess(WebappLoader.java:292)
>     at
> org.apache.tomee.catalina.TomEEWebappLoader.backgroundProcess(TomEEWebappLoader.java:61)
>     at
> org.apache.tomee.catalina.LazyStopLoader.backgroundProcess(LazyStopLoader.java:105)
>     at
> org.apache.catalina.core.StandardContext.backgroundProcess(StandardContext.java:5563)
>     at
> org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1388)
>     at
> org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1392)
>     at
> org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1392)
>     at
> org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1360)
>     at java.lang.Thread.run(Thread.java:748)
>

--
Andy Gumbrecht
https://twitter.com/AndyGeeDe
http://www.tomitribe.com
https://www.tomitribe.io

    --
    Andy Gumbrecht

    http://www.tomitribe.com
    agumbrecht@tomitribe.com
    https://twitter.com/AndyGeeDe

    TomEE treibt Tomitribe ! | http://tomee.apache.org