You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by Jukkales <sh...@nodch.de> on 2013/03/19 09:59:11 UTC

TomEE - CDI Extension - ClassNotFoundException because WEB-INF/classes is ignored

Hi there,

I have a problem with a CDI extension. I created on, put everything in the
services files and now im trying to deploy it at tomee, but it says:

*java.util.ServiceConfigurationError: javax.enterprise.inject.spi.Extension:
Provider test.extensions.ScanAllClassesExtension not found*

My structure:

- file.ear
  - META-INF
  - file.war
    - META-INF
      - services
        - javax.enterprise.inject.spi.Extension
    - WEB-INF
      - classes
      - lib


After trying and searching for hours and after debugging a bit i found the
following problem:

in /org.apache.openejb.assembler.classic.Assembler#createAppClassLoader()/ a
url classloader will be build using the path to the war file. But the
classes are in WEB-INF/classes. If i add this manually, everything works
fine.

I want to ask is this a bug or is there a feature to add the WEB-INF/classes
folder to the classpath?

Thank you!



--
View this message in context: http://openejb.979440.n4.nabble.com/TomEE-CDI-Extension-ClassNotFoundException-because-WEB-INF-classes-is-ignored-tp4661619.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.

Re: TomEE - CDI Extension - ClassNotFoundException because WEB-INF/classes is ignored

Posted by Jukkales <sh...@nodch.de>.
I can't get the snapshots running, 1.6.0 and 1.5.2 will give me this error:

Mrz 19, 2013 11:48:38 AM org.apache.openejb.config.DeploymentLoader
discoverModuleType
Information: type for
'/d:/framework/server/tomee/1.6.0-20130312.041113-27-plus/lib' was not
found, defaulting to WebModule
Mrz 19, 2013 11:48:38 AM org.apache.openejb.config.ConfigurationFactory
configureApplication
Information: Configuring enterprise application:
D:\Framework\svn\trunk\statistik\ear\target\statistik_statistik_1.0.0
Mrz 19, 2013 11:48:39 AM org.apache.openejb.assembler.DeployerEjb deploy
Schwerwiegend: Can't deploy
D:\Framework\svn\trunk\statistik\ear\target\statistik_statistik_1.0.0.ear
java.lang.IllegalArgumentException: URI is not absolute

Is this a configuration issue?

2013/3/19 Romain Manni-Bucau [via OpenEJB] <
ml-node+s979440n4661620h63@n4.nabble.com>

> Hi,
>
> did you check with the snapshot (1.6.0-SNAPSHOT)?
>
> *Romain Manni-Bucau*
> *Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
> *Blog: **http://rmannibucau.wordpress.com/*<
> http://rmannibucau.wordpress.com/>
> *LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
> *Github: https://github.com/rmannibucau*
>
>
>
> 2013/3/19 Jukkales <[hidden email]<http://user/SendEmail.jtp?type=node&node=4661620&i=0>>
>
>
> > Hi there,
> >
> > I have a problem with a CDI extension. I created on, put everything in
> the
> > services files and now im trying to deploy it at tomee, but it says:
> >
> > *java.util.ServiceConfigurationError:
> > javax.enterprise.inject.spi.Extension:
> > Provider test.extensions.ScanAllClassesExtension not found*
> >
> > My structure:
> >
> > - file.ear
> >   - META-INF
> >   - file.war
> >     - META-INF
> >       - services
> >         - javax.enterprise.inject.spi.Extension
> >     - WEB-INF
> >       - classes
> >       - lib
> >
> >
> > After trying and searching for hours and after debugging a bit i found
> the
> > following problem:
> >
> > in
> /org.apache.openejb.assembler.classic.Assembler#createAppClassLoader()/
> > a
> > url classloader will be build using the path to the war file. But the
> > classes are in WEB-INF/classes. If i add this manually, everything works
> > fine.
> >
> > I want to ask is this a bug or is there a feature to add the
> > WEB-INF/classes
> > folder to the classpath?
> >
> > Thank you!
> >
> >
> >
> > --
> > View this message in context:
> >
> http://openejb.979440.n4.nabble.com/TomEE-CDI-Extension-ClassNotFoundException-because-WEB-INF-classes-is-ignored-tp4661619.html
> > Sent from the OpenEJB Dev mailing list archive at Nabble.com.
> >
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://openejb.979440.n4.nabble.com/TomEE-CDI-Extension-ClassNotFoundException-because-WEB-INF-classes-is-ignored-tp4661619p4661620.html
>  To unsubscribe from TomEE - CDI Extension - ClassNotFoundException
> because WEB-INF/classes is ignored, click here<http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4661619&code=c2hAbm9kY2guZGV8NDY2MTYxOXw3NjUyNzE0Ng==>
> .
> NAML<http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://openejb.979440.n4.nabble.com/TomEE-CDI-Extension-ClassNotFoundException-because-WEB-INF-classes-is-ignored-tp4661619p4661661.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.

Re: TomEE - CDI Extension - ClassNotFoundException because WEB-INF/classes is ignored

Posted by Romain Manni-Bucau <rm...@gmail.com>.
think it is hidden behind "service provider" semantic which indirectly
reference Java 6 ServiceLoader which uses the classloader to find
implementations.

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*



2013/3/19 Jukkales <sh...@nodch.de>

> It's funny, i did this before to test, but i as i saw now, the old files
> are
> stil there .. so this can't work.
>
> Thanks a lot, its working. The specs are not really clear on this point.
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/TomEE-CDI-Extension-ClassNotFoundException-because-WEB-INF-classes-is-ignored-tp4661619p4661626.html
> Sent from the OpenEJB Dev mailing list archive at Nabble.com.
>

Re: TomEE - CDI Extension - ClassNotFoundException because WEB-INF/classes is ignored

Posted by Jukkales <sh...@nodch.de>.
It's funny, i did this before to test, but i as i saw now, the old files are
stil there .. so this can't work.

Thanks a lot, its working. The specs are not really clear on this point.



--
View this message in context: http://openejb.979440.n4.nabble.com/TomEE-CDI-Extension-ClassNotFoundException-because-WEB-INF-classes-is-ignored-tp4661619p4661626.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.

Re: TomEE - CDI Extension - ClassNotFoundException because WEB-INF/classes is ignored

Posted by Romain Manni-Bucau <rm...@gmail.com>.
META-INF/services/... should be in WEB-INF/classes not in / of the war

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*



2013/3/19 Jukkales <sh...@nodch.de>

> The error with 1.5.2 and 1.6.0 was my fault, but its still not working.
> I have created a minimal project which can reproduce the error.
>
> Attached is a file with the maven project. Just run mvn install and deploy
> the ear file.
>
> cdi-extensiontest-tomee.7z
> <
> http://openejb.979440.n4.nabble.com/file/n4661624/cdi-extensiontest-tomee.7z
> >
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/TomEE-CDI-Extension-ClassNotFoundException-because-WEB-INF-classes-is-ignored-tp4661619p4661624.html
> Sent from the OpenEJB Dev mailing list archive at Nabble.com.
>

Re: TomEE - CDI Extension - ClassNotFoundException because WEB-INF/classes is ignored

Posted by Jukkales <sh...@nodch.de>.
The error with 1.5.2 and 1.6.0 was my fault, but its still not working. 
I have created a minimal project which can reproduce the error.

Attached is a file with the maven project. Just run mvn install and deploy
the ear file.

cdi-extensiontest-tomee.7z
<http://openejb.979440.n4.nabble.com/file/n4661624/cdi-extensiontest-tomee.7z>  



--
View this message in context: http://openejb.979440.n4.nabble.com/TomEE-CDI-Extension-ClassNotFoundException-because-WEB-INF-classes-is-ignored-tp4661619p4661624.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.

Re: TomEE - CDI Extension - ClassNotFoundException because WEB-INF/classes is ignored

Posted by Romain Manni-Bucau <rm...@gmail.com>.
BTW how do you deploy? i didn't get any issue deploying an ear under win
either manually (in apps) or through the DeployerEjb

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*



2013/3/19 Romain Manni-Bucau <rm...@gmail.com>

> can you share the app?
>
> *Romain Manni-Bucau*
> *Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
> *Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
> *LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
> *Github: https://github.com/rmannibucau*
>
>
>
> 2013/3/19 Jukkales <sh...@nodch.de>
>
>> I can't get the snapshots running, 1.6.0 and 1.5.2 will give me this
>> error:
>>
>> Mrz 19, 2013 11:48:38 AM org.apache.openejb.config.DeploymentLoader
>> discoverModuleType
>> Information: type for
>> '/d:/framework/server/tomee/1.6.0-20130312.041113-27-plus/lib' was not
>> found, defaulting to WebModule
>> Mrz 19, 2013 11:48:38 AM org.apache.openejb.config.ConfigurationFactory
>> configureApplication
>> Information: Configuring enterprise application:
>> D:\Framework\svn\trunk\statistik\ear\target\statistik_statistik_1.0.0
>> Mrz 19, 2013 11:48:39 AM org.apache.openejb.assembler.DeployerEjb deploy
>> Schwerwiegend: Can't deploy
>> D:\Framework\svn\trunk\statistik\ear\target\statistik_statistik_1.0.0.ear
>> java.lang.IllegalArgumentException: URI is not absolute
>>
>> Is this a configuration issue?
>>
>>
>>
>> --
>> View this message in context:
>> http://openejb.979440.n4.nabble.com/TomEE-CDI-Extension-ClassNotFoundException-because-WEB-INF-classes-is-ignored-tp4661619p4661621.html
>> Sent from the OpenEJB Dev mailing list archive at Nabble.com.
>>
>
>

Re: TomEE - CDI Extension - ClassNotFoundException because WEB-INF/classes is ignored

Posted by Romain Manni-Bucau <rm...@gmail.com>.
can you share the app?

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*



2013/3/19 Jukkales <sh...@nodch.de>

> I can't get the snapshots running, 1.6.0 and 1.5.2 will give me this error:
>
> Mrz 19, 2013 11:48:38 AM org.apache.openejb.config.DeploymentLoader
> discoverModuleType
> Information: type for
> '/d:/framework/server/tomee/1.6.0-20130312.041113-27-plus/lib' was not
> found, defaulting to WebModule
> Mrz 19, 2013 11:48:38 AM org.apache.openejb.config.ConfigurationFactory
> configureApplication
> Information: Configuring enterprise application:
> D:\Framework\svn\trunk\statistik\ear\target\statistik_statistik_1.0.0
> Mrz 19, 2013 11:48:39 AM org.apache.openejb.assembler.DeployerEjb deploy
> Schwerwiegend: Can't deploy
> D:\Framework\svn\trunk\statistik\ear\target\statistik_statistik_1.0.0.ear
> java.lang.IllegalArgumentException: URI is not absolute
>
> Is this a configuration issue?
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/TomEE-CDI-Extension-ClassNotFoundException-because-WEB-INF-classes-is-ignored-tp4661619p4661621.html
> Sent from the OpenEJB Dev mailing list archive at Nabble.com.
>

Re: TomEE - CDI Extension - ClassNotFoundException because WEB-INF/classes is ignored

Posted by Jukkales <sh...@nodch.de>.
I can't get the snapshots running, 1.6.0 and 1.5.2 will give me this error:

Mrz 19, 2013 11:48:38 AM org.apache.openejb.config.DeploymentLoader
discoverModuleType
Information: type for
'/d:/framework/server/tomee/1.6.0-20130312.041113-27-plus/lib' was not
found, defaulting to WebModule
Mrz 19, 2013 11:48:38 AM org.apache.openejb.config.ConfigurationFactory
configureApplication
Information: Configuring enterprise application:
D:\Framework\svn\trunk\statistik\ear\target\statistik_statistik_1.0.0
Mrz 19, 2013 11:48:39 AM org.apache.openejb.assembler.DeployerEjb deploy
Schwerwiegend: Can't deploy
D:\Framework\svn\trunk\statistik\ear\target\statistik_statistik_1.0.0.ear
java.lang.IllegalArgumentException: URI is not absolute

Is this a configuration issue?



--
View this message in context: http://openejb.979440.n4.nabble.com/TomEE-CDI-Extension-ClassNotFoundException-because-WEB-INF-classes-is-ignored-tp4661619p4661621.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.

Re: TomEE - CDI Extension - ClassNotFoundException because WEB-INF/classes is ignored

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi,

did you check with the snapshot (1.6.0-SNAPSHOT)?

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*



2013/3/19 Jukkales <sh...@nodch.de>

> Hi there,
>
> I have a problem with a CDI extension. I created on, put everything in the
> services files and now im trying to deploy it at tomee, but it says:
>
> *java.util.ServiceConfigurationError:
> javax.enterprise.inject.spi.Extension:
> Provider test.extensions.ScanAllClassesExtension not found*
>
> My structure:
>
> - file.ear
>   - META-INF
>   - file.war
>     - META-INF
>       - services
>         - javax.enterprise.inject.spi.Extension
>     - WEB-INF
>       - classes
>       - lib
>
>
> After trying and searching for hours and after debugging a bit i found the
> following problem:
>
> in /org.apache.openejb.assembler.classic.Assembler#createAppClassLoader()/
> a
> url classloader will be build using the path to the war file. But the
> classes are in WEB-INF/classes. If i add this manually, everything works
> fine.
>
> I want to ask is this a bug or is there a feature to add the
> WEB-INF/classes
> folder to the classpath?
>
> Thank you!
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/TomEE-CDI-Extension-ClassNotFoundException-because-WEB-INF-classes-is-ignored-tp4661619.html
> Sent from the OpenEJB Dev mailing list archive at Nabble.com.
>