[ 
http://jira.codehaus.org/browse/MRMIC-19?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_124280
 ] 

zwets edited comment on MRMIC-19 at 2/19/08 8:33 AM:
--------------------------------------------------------------------

I've run into this same bug, but don't understand what the original reporter 
means by "it works fine if I define my stub classes within the includes and 
exclude all others". 

My use case is to generate IIOP stubs for the remote and home interfaces of an 
EJB, so I have this in my project dependencies:
{code:xml}
<dependency>
    <groupId>javax.j2ee</groupId>
    <artifactId>j2ee</artifactId>
    <version>1.4</version>
    <scope>provided</scope>
</dependency>
{code}

Then get the following build error:
{noformat}
[INFO] [rmic:rmic {execution: RMI compilation}]
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] javax/ejb/EJBHome
[INFO] ------------------------------------------------------------------------
[DEBUG] Trace
java.lang.NoClassDefFoundError: javax/ejb/EJBHome
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
        at 
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
        at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at 
org.codehaus.mojo.rmic.RmicMojo.scanForRemoteClasses(RmicMojo.java:181)
        at org.codehaus.mojo.rmic.RmicMojo.execute(RmicMojo.java:139)
        ...
{noformat}

The NoClassDefFoundError problem disappears when I change the dependency scope 
from 'provided' to 'compile'.

Note: I then get the message "No out of date rmi classes to process", but that 
is caused by another bug which I have just submitted a patch for. See 
[MRMIC-20].


      was (Author: zwets):
    I've run into this same bug, but don't understand what the original 
reporter means by "it works fine if I define my stub classes within the 
includes and exclude all others". 

My use case is to generate IIOP stubs for the remote and home interfaces of an 
EJB, so I have this in my project dependencies:
{code:xml}
<dependency>
    <groupId>javax.j2ee</groupId>
    <artifactId>j2ee</artifactId>
    <version>1.4</version>
    <scope>provided</scope>
</dependency>
{code}

Then get the following build error:
{noformat}
[INFO] [rmic:rmic {execution: RMI compilation}]
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] javax/ejb/EJBHome
[INFO] ------------------------------------------------------------------------
[DEBUG] Trace
java.lang.NoClassDefFoundError: javax/ejb/EJBHome
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
        at 
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
        at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at 
org.codehaus.mojo.rmic.RmicMojo.scanForRemoteClasses(RmicMojo.java:181)
        at org.codehaus.mojo.rmic.RmicMojo.execute(RmicMojo.java:139)
        ...
{noformat}

The NoClassDefFoundError problem disappears when I change the dependency scope 
from 'provided' to 'compile'.
Note: I then get the message "No out of date rmi classes to process", but that 
may well for a different reason.


  
> dependencies with scope provided are not considered within rmic
> ---------------------------------------------------------------
>
>                 Key: MRMIC-19
>                 URL: http://jira.codehaus.org/browse/MRMIC-19
>             Project: Maven 2.x RMIC Plugin
>          Issue Type: Bug
>            Reporter: Marc Brugger
>
> In my project i use the following dependency.
>               <dependency>
>                       <groupId>org.apache.geronimo.specs</groupId>
>                       <artifactId>geronimo-j2ee_1.4_spec</artifactId>
>                       <scope>provided</scope>
>               </dependency>
> since I configured the rmic plugin to run in phase compile i get a class not 
> found exception of a class that is within the provided plugin. 
> It should be possible that provided dependencies could also be accessed from 
> the plugin.
> it works fine if I define my stub classes within the includes and exclude all 
> others.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to