You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by Monteiro Jean-Louis <je...@atosorigin.com> on 2009/08/26 10:17:32 UTC

TR: [jira] Created: (OPENEJB-1063) Main-Class containing "/" instead of "." fails java.lang.NoClassDefFoundError: IllegalName:

Any thoughts?
Jean-Louis

-----Message d'origine-----
De : Jean-Louis MONTEIRO (JIRA) [mailto:jira@apache.org]
Envoyé : mercredi 26 août 2009 10:16
À : Monteiro Jean-Louis
Objet : [jira] Created: (OPENEJB-1063) Main-Class containing "/" instead of "." fails java.lang.NoClassDefFoundError: IllegalName:

Main-Class containing "/" instead of "." fails java.lang.NoClassDefFoundError: IllegalName:
--------------------------------------------------------------------------------------------

                 Key: OPENEJB-1063
                 URL: https://issues.apache.org/jira/browse/OPENEJB-1063
             Project: OpenEJB
          Issue Type: Sub-task
    Affects Versions: 3.1.1
         Environment: XP + Tomcat + OpenEJB 3.1.1
            Reporter: Jean-Louis MONTEIRO
             Fix For: 3.1.2


The JAR specification isn't clear and AFAIK does not define if the main class must use "." instead of "/".

But, since jdk 5, Classloader seems to explicitly check if the name contains a "/". Here is an interesting link http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4986512

Even if it's definitely an error from the jar provider, you are sometimes required to use old jars (< jdk 5) with this kind of format.
Since last release (3.1.1) David has changed app client deployment rules and OpenEJB doesn't fail anymore if a NoClassDefFoundError occurs without an application-client.xml descriptor.

May be we can provide a warn if an app client module contains a bad Main-Class format and try to replace "/" by "."


--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.




Ce message et les pièces jointes sont confidentiels et réservés à l'usage exclusif de ses destinataires. Il peut également être protégé par le secret professionnel. Si vous recevez ce message par erreur, merci d'en avertir immédiatement l'expéditeur et de le détruire. L'intégrité du message ne pouvant être assurée sur Internet, la responsabilité du groupe Atos Origin ne pourra être recherchée quant au contenu de ce message. Bien que les meilleurs efforts soient faits pour maintenir cette transmission exempte de tout virus, l'expéditeur ne donne aucune garantie à cet égard et sa responsabilité ne saurait être recherchée pour tout dommage résultant d'un virus transmis.

This e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the Internet, the Atos Origin group liability cannot be triggered for the message content. Although the sender endeavours to maintain a computer virus-free network, the sender does not warrant that this transmission is virus-free and will not be liable for any damages resulting from any virus transmitted.

Re: TR: [jira] Created: (OPENEJB-1063) Main-Class containing "/" instead of "." fails java.lang.NoClassDefFoundError: IllegalName:

Posted by David Blevins <da...@visi.com>.
On Aug 26, 2009, at 1:17 AM, Monteiro Jean-Louis wrote:

> The JAR specification isn't clear and AFAIK does not define if the  
> main class must use "." instead of "/".
>
> But, since jdk 5, Classloader seems to explicitly check if the name  
> contains a "/". Here is an interesting link http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4986512
>
> Even if it's definitely an error from the jar provider, you are  
> sometimes required to use old jars (< jdk 5) with this kind of format.
> Since last release (3.1.1) David has changed app client deployment  
> rules and OpenEJB doesn't fail anymore if a NoClassDefFoundError  
> occurs without an application-client.xml descriptor.
>
> May be we can provide a warn if an app client module contains a bad  
> Main-Class format and try to replace "/" by "."

We should definitely do a "/" to "." conversion before trying the  
class name if it this is the case -- we probably can do that the first  
time around as slashes aren't legal class names anyway.

I forget how the warning logic goes for bad app client classes.  I  
think the logic is that an error or validation failure is issued for a  
bad Main-Class if you have a META-INF/application-client.xml file as  
then we know for sure your jar is an app client.  If it doesn't have a  
META-INF/application-client.xml then we log on debug if we can't load  
the Main-Class.  Should be that if it isn't -- seems like a nice  
middle ground anyway.


-David