You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Justin Larose <Ju...@nexweb.org> on 2012/01/11 14:53:01 UTC

Error: Unable to compile class for JSP

Well now that I got the certificate setup and users login to the 
application they are not seeing all content...
When they login to the application (Tomcat version 7.0.23) they get the 
error below in the initial splash window. (there should be a menu instead)

If I switch back to the Tomcat 6.0 version it runs fine. I checked the 
.jps files and are identical between the version 6 and version 7 
application.

_______________________

Jan 11, 2012 8:28:23 AM org.apache.catalina.core.ApplicationDispatcher 
invoke
SEVERE: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: Unable to compile class for JSP: 

An error occurred at line: 230 in the jsp file: /object_table.jsp
The type Part is ambiguous
227:            {
228:         //do nothing here - we don't want the filter to be displayed 
for lifecycles
229:     }
230:     else if (objType.equals(Part.class))
231:     {
232:            ObjectTablePagelet.addButton(Pagelet.EDIT_BUTTON, 
"edit_design_part_master", BarAdapterItem.MODE_ENABLE_ON_ONE, "Edit Design 
Part", 530, 550);
233:     }

Thanks,
Justin LaRose
******************************************************************************
This email and any files transmitted with it are intended solely for 
the use of the individual or agency to whom they are addressed. 
If you have received this email in error please notify the Navy 
Exchange Service Command e-mail administrator. This footnote 
also confirms that this email message has been scanned for the
presence of computer viruses.

Thank You!            
******************************************************************************


Re: Error: Unable to compile class for JSP

Posted by Pid <pi...@pidster.com>.
On 11/01/2012 20:44, Justin Larose wrote:
> markt@apache.org wrote on 01/11/2012 01:19:17 PM:
> 
>> From: markt@apache.org
>> To: Tomcat Users List <us...@tomcat.apache.org>
>> Date: 01/11/2012 01:20 PM
>> Subject: Re: Error: Unable to compile class for JSP
>>
>> Justin Larose <Ju...@nexweb.org> wrote:
> 
>>>>> An error occurred at line: 230 in the jsp file: /object_table.jsp
>>>>> The type Part is ambiguous
>>>>> 227:            {
>>>>> 228:         //do nothing here - we don't want the filter to be
>>> displayed
>>>>> for lifecycles
>>>>> 229:     }
>>>>> 230:     else if (objType.equals(Part.class))
>>>>> 231:     {
>>>
>>>> Have you imported more than one Part.class by accident, via a
>>> wildcard
>>>> import perhaps?
>>>
>>> I did not import any classes.
> 
>> You must have at least one import to resolve the class Part. Since 
>> I'm pretty sure a class with that name was added in servlet 3, 
>> wildcard imports are very likely the problem.
> 
> I downgraded the Tomcat to Version 6.0.35 and looks to be working 
> correctly now.
> Maybe Serena Dimensions cannot work with that higher version of Tomcat 
> (version 7.0.23)? 
> 
> The only files I copied over from the 6.0 version to the 6.0.35 version 
> were the "webapps" directory the web.xml file and the server.xml file.
> The only difference in the server.xml file between the 2 versions is this:
> 
> <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" 
> />
>  <Listener className="org.apache.catalina.core.AprLifecycleListener" 
> SSLEngine="on" />

So what Mark & are both saying is this: in the JSP there is some code
which imports, via a wildcard, two packages that both contains a Part class.

We are not talking about importing things on the file system.  We are
talking about a specific Java command which is part of the code.  E.g.

If both of the packages below contain a class called "Part", then the
compiler can't tell which one you are trying to use.

 import com.examples.stuff.*
 import com.examples.other.*


You can use an editor to look in the the JSP file in question for the
word "import" somewhere near the top of the file and the '*' character.

If there is more than one '*', you can report the error to Serena
Dimensions or try to fix it yourself.


p


> - Thanks, Justin
> ******************************************************************************
> This email and any files transmitted with it are intended solely for 
> the use of the individual or agency to whom they are addressed. 
> If you have received this email in error please notify the Navy 
> Exchange Service Command e-mail administrator. This footnote 
> also confirms that this email message has been scanned for the
> presence of computer viruses.
> 
> Thank You!            
> ******************************************************************************
> 
> 


-- 

[key:62590808]


Re: Error: Unable to compile class for JSP

Posted by Justin Larose <Ju...@nexweb.org>.
markt@apache.org wrote on 01/11/2012 01:19:17 PM:

> From: markt@apache.org
> To: Tomcat Users List <us...@tomcat.apache.org>
> Date: 01/11/2012 01:20 PM
> Subject: Re: Error: Unable to compile class for JSP
> 
> Justin Larose <Ju...@nexweb.org> wrote:

> >> > An error occurred at line: 230 in the jsp file: /object_table.jsp
> >> > The type Part is ambiguous
> >> > 227:            {
> >> > 228:         //do nothing here - we don't want the filter to be
> >displayed
> >> > for lifecycles
> >> > 229:     }
> >> > 230:     else if (objType.equals(Part.class))
> >> > 231:     {
> >
> >> Have you imported more than one Part.class by accident, via a
> >wildcard
> >> import perhaps?
> >
> >I did not import any classes.

> You must have at least one import to resolve the class Part. Since 
> I'm pretty sure a class with that name was added in servlet 3, 
> wildcard imports are very likely the problem.

I downgraded the Tomcat to Version 6.0.35 and looks to be working 
correctly now.
Maybe Serena Dimensions cannot work with that higher version of Tomcat 
(version 7.0.23)? 

The only files I copied over from the 6.0 version to the 6.0.35 version 
were the "webapps" directory the web.xml file and the server.xml file.
The only difference in the server.xml file between the 2 versions is this:

<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" 
/>
 <Listener className="org.apache.catalina.core.AprLifecycleListener" 
SSLEngine="on" />


- Thanks, Justin
******************************************************************************
This email and any files transmitted with it are intended solely for 
the use of the individual or agency to whom they are addressed. 
If you have received this email in error please notify the Navy 
Exchange Service Command e-mail administrator. This footnote 
also confirms that this email message has been scanned for the
presence of computer viruses.

Thank You!            
******************************************************************************


Re: Error: Unable to compile class for JSP

Posted by ma...@apache.org.
Justin Larose <Ju...@nexweb.org> wrote:

>> > An error occurred at line: 230 in the jsp file: /object_table.jsp
>> > The type Part is ambiguous
>> > 227:            {
>> > 228:         //do nothing here - we don't want the filter to be 
>displayed
>> > for lifecycles
>> > 229:     }
>> > 230:     else if (objType.equals(Part.class))
>> > 231:     {
>
>> Have you imported more than one Part.class by accident, via a
>wildcard
>> import perhaps?
>
>I did not import any classes.

You must have at least one import to resolve the class Part. Since I'm pretty sure a class with that name was added in servlet 3, wildcard imports are very likely the problem.

Mark


> I installed Tomcat 7 in a different 
>directory and copied all the webapp directories to the new location.
>
>- Justin
>******************************************************************************
>This email and any files transmitted with it are intended solely for 
>the use of the individual or agency to whom they are addressed. 
>If you have received this email in error please notify the Navy 
>Exchange Service Command e-mail administrator. This footnote 
>also confirms that this email message has been scanned for the
>presence of computer viruses.
>
>Thank You!            
>******************************************************************************



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Error: Unable to compile class for JSP

Posted by Pid <pi...@pidster.com>.
On 11/01/2012 16:56, Justin Larose wrote:
>>> An error occurred at line: 230 in the jsp file: /object_table.jsp
>>> The type Part is ambiguous
>>> 227:            {
>>> 228:         //do nothing here - we don't want the filter to be 
> displayed
>>> for lifecycles
>>> 229:     }
>>> 230:     else if (objType.equals(Part.class))
>>> 231:     {
> 
>> Have you imported more than one Part.class by accident, via a wildcard
>> import perhaps?
> 
> I did not import any classes. I installed Tomcat 7 in a different 
> directory and copied all the webapp directories to the new location.

The error message says you have a bug in the JSP.

The bug appears to be that the "Part.class" reference is ambiguous.

This means that more than one Part.class reference is visible in the
scope of the JSP, possibly via an import statement inside the JSP.

Can you examine the JSP code?


p



> - Justin
> ******************************************************************************
> This email and any files transmitted with it are intended solely for 
> the use of the individual or agency to whom they are addressed. 
> If you have received this email in error please notify the Navy 
> Exchange Service Command e-mail administrator. This footnote 
> also confirms that this email message has been scanned for the
> presence of computer viruses.
> 
> Thank You!            
> ******************************************************************************
> 
> 


-- 

[key:62590808]


Re: Error: Unable to compile class for JSP

Posted by Justin Larose <Ju...@nexweb.org>.
> > An error occurred at line: 230 in the jsp file: /object_table.jsp
> > The type Part is ambiguous
> > 227:            {
> > 228:         //do nothing here - we don't want the filter to be 
displayed
> > for lifecycles
> > 229:     }
> > 230:     else if (objType.equals(Part.class))
> > 231:     {

> Have you imported more than one Part.class by accident, via a wildcard
> import perhaps?

I did not import any classes. I installed Tomcat 7 in a different 
directory and copied all the webapp directories to the new location.

- Justin
******************************************************************************
This email and any files transmitted with it are intended solely for 
the use of the individual or agency to whom they are addressed. 
If you have received this email in error please notify the Navy 
Exchange Service Command e-mail administrator. This footnote 
also confirms that this email message has been scanned for the
presence of computer viruses.

Thank You!            
******************************************************************************


Re: Error: Unable to compile class for JSP

Posted by Pid <pi...@pidster.com>.
On 11/01/2012 13:53, Justin Larose wrote:
> An error occurred at line: 230 in the jsp file: /object_table.jsp
> The type Part is ambiguous
> 227:            {
> 228:         //do nothing here - we don't want the filter to be displayed 
> for lifecycles
> 229:     }
> 230:     else if (objType.equals(Part.class))
> 231:     {

Have you imported more than one Part.class by accident, via a wildcard
import perhaps?


p

-- 

[key:62590808]