You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "McNeil, Shane" <Sh...@standards.com.au> on 2002/11/14 01:53:35 UTC

bad class file exception

Hi,

I am attempting to call a custom Java API from an XSP document as follows
(simplified)...

    <?xml version="1.0" encoding="UTF-8"?>
    <xsp:page language="java" xmlns:xsp="http://apache.org/xsp">
        <xsp:structure>
            <xsp:include>SIM.Zapi.*</xsp:include>
        </xsp:structure>
        <xsp:logic>
    public String getSimDoc()
    {
        ZAssociation za  = new ZAssociation("localhost:7810");
        return "OK";
    }
        </xsp:logic>
        <document>
            <xsp:expr>getSimDoc()</xsp:expr>
        </document>
    </xsp:page>


Can anyone tell me why I am getting the following error...

    Language Exception
    
    More precisely:
    
    org.apache.cocoon.ProcessingException: Language Exception:
org.apache.cocoon.components.language.LanguageException: Error compiling
getsimdoc_xsp:
    Line 66, column 4: cannot access class ZAssociation; bad class file
(java.lang.RuntimeException: class file: SIM.Zapi.ZAssociation contains
wrong class: SIM.ZApi.ZAssociation)
    Line 66, column 27: constructor ZAssociation(java.lang.String) not found
in class SIM.Zapi.ZAssociation
    Line 0, column 0:
    2 errors


I can call the API from a standard Java application successfully.

Regards,

Shane McNeil

Analyst Programmer
Corporate Document Technologies
STANDARDS AUSTRALIA

Re: bad class file exception

Posted by Bobby Mitchell <bm...@niac.usra.edu>.
McNeil, Shane wrote:

> Hi,
>
> I am attempting to call a custom Java API from an XSP document as 
> follows (simplified)...
>
>     <?xml version="1.0" encoding="UTF-8"?>
>     <xsp:page language="java" xmlns:xsp="http://apache.org/xsp">
>         <xsp:structure>
>             <xsp:include>SIM.Zapi.*</xsp:include>
>
              Should this line be

                    <xsp:include>SIM.ZApi.*</xsp:include>

                instead? It looks like a naming conflict of some kind 
based on the error message below.

>
>         </xsp:structure>
>         <xsp:logic>
>     public String getSimDoc()
>     {
>         ZAssociation za  = new ZAssociation("localhost:7810");
>         return "OK";
>     }
>         </xsp:logic>
>         <document>
>             <xsp:expr>getSimDoc()</xsp:expr>
>         </document>
>     </xsp:page>
>
>
> Can anyone tell me why I am getting the following error...
>
>     Language Exception
>    
>     More precisely:
>    
>     org.apache.cocoon.ProcessingException: Language Exception: 
> org.apache.cocoon.components.language.LanguageException: Error 
> compiling getsimdoc_xsp:
>
>     Line 66, column 4: cannot access class ZAssociation; bad class 
> file (java.lang.RuntimeException: class file: SIM.Zapi.ZAssociation 
> contains wrong class: SIM.ZApi.ZAssociation)
>
>     Line 66, column 27: constructor ZAssociation(java.lang.String) not 
> found in class SIM.Zapi.ZAssociation
>     Line 0, column 0:
>     2 errors
>
>
> I can call the API from a standard Java application successfully.
>
> Regards,
>
> Shane McNeil
>
> Analyst Programmer
> Corporate Document Technologies
> STANDARDS AUSTRALIA
>
>------------------------------------------------------------------------
>
>---------------------------------------------------------------------
>Please check that your question  has not already been answered in the
>FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
>To unsubscribe, e-mail:     <co...@xml.apache.org>
>For additional commands, e-mail:   <co...@xml.apache.org>
>



---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: bad class file exception

Posted by Charles Brewster <ch...@shaw.ca>.
McNeil, Shane wrote:

> Hi,
>
> I am attempting to call a custom Java API from an XSP document as 
> follows (simplified)...
>
>     <?xml version="1.0" encoding="UTF-8"?>
>     <xsp:page language="java" xmlns:xsp="http://apache.org/xsp">
>         <xsp:structure>
>             <xsp:include>SIM.Zapi.*</xsp:include>
>         </xsp:structure>
>         <xsp:logic>
>     public String getSimDoc()
>     {
>         ZAssociation za  = new ZAssociation("localhost:7810");
>         return "OK";
>     }
>         </xsp:logic>
>         <document>
>             <xsp:expr>getSimDoc()</xsp:expr>
>         </document>
>     </xsp:page>
>
>
> Can anyone tell me why I am getting the following error...
>
>     Language Exception
>     Line 66, column 4: cannot access class ZAssociation; bad class 
> file (java.lang.RuntimeException: class file: SIM.Zapi.ZAssociation 
> contains wrong class: SIM.ZApi.ZAssociation)
>
The upper case "A"  in the ZApi does not agree with thw lower case in 
Zapi earlier.
It appears to find the jar file or class file it is just a disagreement 
between the class name inside the code and the file name.

>     Line 66, column 27: constructor ZAssociation(java.lang.String) not 
> found in class SIM.Zapi.ZAssociation
>     Line 0, column 0:
>     2 errors
>
>
> I can call the API from a standard Java application successfully.
>
> Regards,
>
> Shane McNeil
>
> Analyst Programmer
> Corporate Document Technologies
> STANDARDS AUSTRALIA
>
>------------------------------------------------------------------------
>
>---------------------------------------------------------------------
>Please check that your question  has not already been answered in the
>FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
>To unsubscribe, e-mail:     <co...@xml.apache.org>
>For additional commands, e-mail:   <co...@xml.apache.org>
>