Trouble loading custom resource within WAR embedded within EAR

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Trouble loading custom resource within WAR embedded within EAR

ptie-2
Hi all,

We 're having trouble loading a custom resource within a WAR with TomEE
7.1.0

Basically, we have the following structure within our EAR:

EAR
--web-app.war
----WEB-INF
------classes
--------com
----------example
------------CustomResource.class
      resources.xml
         
The resources.xml is as follows:

<resources>
  <Resource id="customResource" class-name="com.example.CustomResource">
    property value
  </Resource>
</resources>

We get the following message:

org.apache.openejb.OpenEJBException: Unable to load type
'com.example.CustomResource' for
comp/env/openejb/Resource/app/customResource

Why is this not working?

Thanks!
Peter



--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
Reply | Threaded
Open this post in threaded view
|

Re: Trouble loading custom resource within WAR embedded within EAR

ptie-2
Reply | Threaded
Open this post in threaded view
|

Re: Trouble loading custom resource within WAR embedded within EAR

jgallimore
How are you using that resource - are you using @Resource or a JNDI lookup
or similar?

Thanks

Jon

On Mon, Jan 6, 2020 at 2:32 PM ptie <[hidden email]> wrote:

> Anybody?
>
> Regards,
> Peter
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
>
Reply | Threaded
Open this post in threaded view
|

Re: Trouble loading custom resource within WAR embedded within EAR

ptie-2
Hi Jon,

Thanks for the quick reply!

We are using @Resource.

But the error (that it cannot find com.example.CustomResource) is thrown
while TomEE is processing the resources.xml, it does not even get to
injecting the CustomResource.

Thanks,
Peter



--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html