You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Fabian Panthen <fp...@unitb-consulting.de> on 2010/02/08 14:29:30 UTC

jsp compilation fails depending on how WEB-INF classes are build

Hello,

not sure whether here is the right place to post, but i give it a shot...

I have a webapp with JSP's using some classes from WEB-INF/classes in a 
declaration block (<%!%>),
running in tomcat 6 on jdk1.6.0_14.

The problem is such,

if I compile the classes in WEB-INF/classes using eclipse Galileo 
everything runs fine.
But if I compile those same classes using ANT, jsp comilation in tomcat 
fails with the following stack trace:

org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException
      at 
org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader.<init>(ClassFileReader.java:342) 

      at 
org.apache.jasper.compiler.JDTCompiler$1.findType(JDTCompiler.java:206)
      at 
org.apache.jasper.compiler.JDTCompiler$1.findType(JDTCompiler.java:178)
      at 
org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType(LookupEnvironment.java:122) 

      at 
org.eclipse.jdt.internal.compiler.lookup.PackageBinding.getTypeOrPackage(PackageBinding.java:178) 

      at 
org.eclipse.jdt.internal.compiler.lookup.Scope.getPackage(Scope.java:2101)
      at 
org.eclipse.jdt.internal.compiler.ast.QualifiedTypeReference.getTypeBinding(QualifiedTypeReference.java:69) 

      at 
org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveType(TypeReference.java:134) 

      at 
org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.resolveTypeFor(SourceTypeBinding.java:1273) 

      at 
org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.fields(SourceTypeBinding.java:604) 

      at 
org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.faultInTypesForFieldsAndMethods(SourceTypeBinding.java:582) 

      at 
org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.faultInTypes(CompilationUnitScope.java:431) 

      at 
org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:616)
      at 
org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:392)
      at 
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:429)
      at org.apache.jasper.compiler.Compiler.compile(Compiler.java:334)
      at org.apache.jasper.compiler.Compiler.compile(Compiler.java:312)
      at org.apache.jasper.compiler.Compiler.compile(Compiler.java:299)
      at 
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:589) 

      at 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317) 

      at 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) 

      at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 

      at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) 

      at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) 

      at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) 

      at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) 

      at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) 

      at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
      at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
      at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) 

      at 
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
      at java.lang.Thread.run(Thread.java:619)

This happens as well under tomcat 5.5.
Changing the ANT build to use the same JDT compiler as eclipse did not 
change the problem.
Using javap I checked both compiled versions of the classes and they do 
have the same major version.

Any hint towards what might be the problem here is greatly appreciated.

Thanks a lot,

fabian

-- 

____________________________________________

u n i t b  c o n s u l t i n g



Brunnenstr. 156

10115 Berlin



Tel:    +49 [0]30 44 31 92 00

Fax:    +49 [0]30 44 31 92 29

Mail:   office@unitb-consulting.de

Web:    http://www.unitb-consulting.de



Geschäftsführer: Nico Adam, Thomas Timm

Registergericht: AG Berlin-Charlottenburg - HRB 113607

Steuernummer: 37/249/21073

Ust-IdNr.: DE814984825



Diese E-Mail könnte vertrauliche und/oder rechtlich geschützte Informationen

enthalten. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail

irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und

vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte

Weitergabe dieser Mail sind nicht gestattet.



This e-mail may contain confidential and/or privileged information. If you

are not the intended recipient (or have received this e-mail in error)

please notify the sender immediately and destroy this e-mail. Any

unauthorised copying, disclosure or distribution of the material in this

e-mail is strictly forbidden.





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


Re: jsp compilation fails depending on how WEB-INF classes are build

Posted by Fabian Panthen <fp...@unitb-consulting.de>.
> Has Eclipse (outside of Tomcat) been configured to emit .class files in
> a certain format? I'm guessing this hasn't been done for 'ant', so maybe
> they need to match each other.
>
>   
that was one of my guesses, but apart from the compliance level i dont 
know of any-
>> This happens as well under tomcat 5.5.
>> Changing the ANT build to use the same JDT compiler as eclipse did not
>> change the problem.
>> Using javap I checked both compiled versions of the classes and they do
>> have the same major version.
>>     
>
> Really? Hmm. Could you double-check that and post what you get?
>
> It's possible that there's a bug in the compiler that can't read some
> particular thing in the class file.
>
>   

please find javap - verbose output attached. major and minor versions 
are the same.
there are differences though. Eclipse sems to include a SourceFile 
reference plus Linenumber and LocalVariable Tables.
I wouldn't know how to trigger that in ant though..


Re: jsp compilation fails depending on how WEB-INF classes are build

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Fabian,

On 2/8/2010 8:29 AM, Fabian Panthen wrote:
> not sure whether here is the right place to post, but i give it a shot...

This is the right place.

I would have thought this was a simply "javac" compiler mismatch, but
that doesn't appear to be the case given the other posts in this thread.

> I have a webapp with JSP's using some classes from WEB-INF/classes in a
> declaration block (<%!%>),
> running in tomcat 6 on jdk1.6.0_14.
> 
> The problem is such,
> 
> if I compile the classes in WEB-INF/classes using eclipse Galileo
> everything runs fine.
> But if I compile those same classes using ANT, jsp compilation in tomcat
> fails with the following stack trace:
> 
> org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException
[snip]
>      at org.apache.jasper.compiler.Compiler.compile(Compiler.java:334)
[snip]
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
>      at java.lang.Thread.run(Thread.java:619)

Interesting that the JSP compiler uses the Eclipse compiler, here. :)

It's possible that the internal compiler requires a certain level of
class file. Were there any /other/ messages in your log files and/or
error report?

Has Eclipse (outside of Tomcat) been configured to emit .class files in
a certain format? I'm guessing this hasn't been done for 'ant', so maybe
they need to match each other.

> This happens as well under tomcat 5.5.
> Changing the ANT build to use the same JDT compiler as eclipse did not
> change the problem.
> Using javap I checked both compiled versions of the classes and they do
> have the same major version.

Really? Hmm. Could you double-check that and post what you get?

It's possible that there's a bug in the compiler that can't read some
particular thing in the class file.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAktwOHIACgkQ9CaO5/Lv0PDeaQCgp36obII5kqWa81eXQuIu6e75
YjUAoLqPJM2Bvn0IrBNEq89inOj9+Ylr
=D4EY
-----END PGP SIGNATURE-----

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


RE: jsp compilation fails depending on how WEB-INF classes are build

Posted by Joseph Morgan <jo...@ignitesales.com>.
I would think so, but there really has to be different versions somehow... I'm lost for ideas now.

-----Original Message-----
From: Fabian Panthen [mailto:fpa@unitb-consulting.de] 
Sent: Monday, February 08, 2010 9:00 AM
To: Tomcat Users List
Subject: Re: jsp compilation fails depending on how WEB-INF classes are build

Joseph Morgan schrieb:
> Fabian,
>
> This looks almost certainly like you are compiling with two different versions of the JDK.  Spit out the version from the OS and compare that to the version set for Eclipse and Ant.
>
> Joe
>
>   
I thougth so, too. But checked this...

 >java -version
java version "1.6.0_14"
Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
Java HotSpot(TM) Client VM (build 14.0-b16, mixed mode)

 >echo %JAVA_HOME%
C:\Program Files\Java\jdk1.6.0_14

 >ant -diagnostics
...
-------------------------------------------
 System properties
-------------------------------------------
java.runtime.name : Java(TM) SE Runtime Environment
sun.boot.library.path : C:\Program Files\Java\jdk1.6.0_14\jre\bin
java.vm.version : 14.0-b16
...

and eclipse is using that same jre6 for compilation so tomcat should 
einther have a problem with clase compiled by either one of them or with 
none, right?

-- 

____________________________________________

u n i t b  c o n s u l t i n g



Brunnenstr. 156

10115 Berlin



Tel:    +49 [0]30 44 31 92 00

Fax:    +49 [0]30 44 31 92 29

Mail:   office@unitb-consulting.de

Web:    http://www.unitb-consulting.de



Geschäftsführer: Nico Adam, Thomas Timm

Registergericht: AG Berlin-Charlottenburg - HRB 113607

Steuernummer: 37/249/21073

Ust-IdNr.: DE814984825



Diese E-Mail könnte vertrauliche und/oder rechtlich geschützte Informationen

enthalten. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail

irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und

vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte

Weitergabe dieser Mail sind nicht gestattet.



This e-mail may contain confidential and/or privileged information. If you

are not the intended recipient (or have received this e-mail in error)

please notify the sender immediately and destroy this e-mail. Any

unauthorised copying, disclosure or distribution of the material in this

e-mail is strictly forbidden.





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


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


Re: [OT] jsp compilation fails depending on how WEB-INF classes are build

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Joseph,

On 2/8/2010 11:23 AM, Joseph Morgan wrote:
>>> There is an Ig-Nobel prize waiting to be atributed, 
>>> if one can ever identify the guy who came up with that idea first.
> 
> You mean it wasn't Bill??? :-)

Although the FAT filesystem (introduced in 1977/1980, the first
"Bill"-related fs) allowed spaces in filenames (a bit unclear to me, the
Wikipedia page for "FAT" says yes, the Wikipedia page for "Filename"
says no, and I don't have a FAT-12 system to play around with right
now), the earliest UNIX filesystems allowed spaces, as did VAX and a
handful of other file systems.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAktwRwcACgkQ9CaO5/Lv0PCyOACfQPr4LtOmIvjQQbVqbE9Ui13g
QFUAn1onxcX2RxKkQYDXyX0xIBQUSTKl
=Wnu6
-----END PGP SIGNATURE-----

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


RE: jsp compilation fails depending on how WEB-INF classes are build

Posted by Joseph Morgan <jo...@ignitesales.com>.
>> There is an Ig-Nobel prize waiting to be atributed, 
>> if one can ever identify the guy who came up with that idea first.

You mean it wasn't Bill??? :-)

-----Original Message-----
From: André Warnier [mailto:aw@ice-sa.com] 
Sent: Monday, February 08, 2010 10:20 AM
To: Tomcat Users List
Subject: Re: jsp compilation fails depending on how WEB-INF classes are build

Mikolaj Rydzewski wrote:
> Fabian Panthen wrote:
>> >echo %JAVA_HOME%
>> C:\Program Files\Java\jdk1.6.0_14
> I don't think that's the case, but...
> There're a lot howtos that encourage Windows users not to use 
> paths-with-spaces for Java programs (Tomcat, ant, JDK itself, etc.).
> 

+1.
I would even leave out the word "Windows" and anything after 
paths-with-spaces above.
There is an Ig-Nobel prize waiting to be atributed, if one can ever 
identify the guy who came up with that idea first.

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


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


RE: jsp compilation fails depending on how WEB-INF classes are build

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Fabian Panthen [mailto:fpa@unitb-consulting.de]
> Subject: Re: jsp compilation fails depending on how WEB-INF classes are
> build
> 
> Yes i will try to get round building a simple example.
> Until then - the only "exotic" thing is a varargs call to
> String.format.
> Both eclipse and ant build with 1.5 target and source level.

Is that true for the files in WEB-INF/classes?  Those are the ones of interest.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


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


Re: jsp compilation fails depending on how WEB-INF classes are build

Posted by Fabian Panthen <fp...@unitb-consulting.de>.
> We will now begin the grasping at straws phase: are there perhaps annotations or other esoterica in the class files that are allowed only in certain levels of the JSP spec?
>
> Can you create a relatively simple test case that exhibits the problem without exposing corporate secrets?
>   

Yes i will try to get round building a simple example.
Until then - the only "exotic" thing is a varargs call to String.format.
Both eclipse and ant build with 1.5 target and source level.

-- 

____________________________________________

u n i t b  c o n s u l t i n g



Brunnenstr. 156

10115 Berlin



Tel:    +49 [0]30 44 31 92 00

Fax:    +49 [0]30 44 31 92 29

Mail:   office@unitb-consulting.de

Web:    http://www.unitb-consulting.de



Geschäftsführer: Nico Adam, Thomas Timm

Registergericht: AG Berlin-Charlottenburg - HRB 113607

Steuernummer: 37/249/21073

Ust-IdNr.: DE814984825



Diese E-Mail könnte vertrauliche und/oder rechtlich geschützte Informationen

enthalten. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail

irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und

vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte

Weitergabe dieser Mail sind nicht gestattet.



This e-mail may contain confidential and/or privileged information. If you

are not the intended recipient (or have received this e-mail in error)

please notify the sender immediately and destroy this e-mail. Any

unauthorised copying, disclosure or distribution of the material in this

e-mail is strictly forbidden.





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


RE: jsp compilation fails depending on how WEB-INF classes are build

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Fabian Panthen [mailto:fpa@unitb-consulting.de]
> Subject: Re: jsp compilation fails depending on how WEB-INF classes are
> build
> 
> i agree, but, compiling the classes with the path with spaces works
> fine in eclipse or ant. the jsp compilation though fails even on the
> integration server, which is linux and has no spaces in any directory
> names

We will now begin the grasping at straws phase: are there perhaps annotations or other esoterica in the class files that are allowed only in certain levels of the JSP spec?

Can you create a relatively simple test case that exhibits the problem without exposing corporate secrets?

- Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


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


Re: jsp compilation fails depending on how WEB-INF classes are build

Posted by Fabian Panthen <fp...@unitb-consulting.de>.
>
> +1.
> I would even leave out the word "Windows" and anything after 
> paths-with-spaces above.
> There is an Ig-Nobel prize waiting to be atributed, if one can ever 
> identify the guy who came up with that idea first.
>
> -
i agree, but, compiling the classes with the path with spaces works fine in eclipse or ant. the jsp compilation though fails even on the integration server, which is linux and has no spaces in any directory names


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


Re: jsp compilation fails depending on how WEB-INF classes are build

Posted by André Warnier <aw...@ice-sa.com>.
Mikolaj Rydzewski wrote:
> Fabian Panthen wrote:
>> >echo %JAVA_HOME%
>> C:\Program Files\Java\jdk1.6.0_14
> I don't think that's the case, but...
> There're a lot howtos that encourage Windows users not to use 
> paths-with-spaces for Java programs (Tomcat, ant, JDK itself, etc.).
> 

+1.
I would even leave out the word "Windows" and anything after 
paths-with-spaces above.
There is an Ig-Nobel prize waiting to be atributed, if one can ever 
identify the guy who came up with that idea first.

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


Re: jsp compilation fails depending on how WEB-INF classes are build

Posted by Mikolaj Rydzewski <mi...@ceti.pl>.
Fabian Panthen wrote:
> >echo %JAVA_HOME%
> C:\Program Files\Java\jdk1.6.0_14
I don't think that's the case, but...
There're a lot howtos that encourage Windows users not to use 
paths-with-spaces for Java programs (Tomcat, ant, JDK itself, etc.).

-- 
Mikolaj Rydzewski <mi...@ceti.pl>


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


Re: jsp compilation fails depending on how WEB-INF classes are build

Posted by Konstantin Kolinko <kn...@gmail.com>.
2010/2/8 Fabian Panthen <fp...@unitb-consulting.de>:
>
>>java -version
> java version "1.6.0_14"
> Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
> Java HotSpot(TM) Client VM (build 14.0-b16, mixed mode)
>
>>echo %JAVA_HOME%
> C:\Program Files\Java\jdk1.6.0_14
>
>>ant -diagnostics
> ...
> -------------------------------------------
> System properties
> -------------------------------------------
> java.runtime.name : Java(TM) SE Runtime Environment
> sun.boot.library.path : C:\Program Files\Java\jdk1.6.0_14\jre\bin
> java.vm.version : 14.0-b16
> ...
>
> and eclipse is using that same jre6 for compilation so tomcat should einther
> have a problem with clase compiled by either one of them or with none,
> right?
>

1. What exactly Tomcat versions are you using.
2. How do you deploy your application? There might be old class files
in the ${CATALINA_BASE}/work folder. Please remove them.
3. What were you trying to do, step by step, and at what step it fails?


Best regards,
Konstantin Kolinko

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


Re: jsp compilation fails depending on how WEB-INF classes are build

Posted by Fabian Panthen <fp...@unitb-consulting.de>.
Joseph Morgan schrieb:
> Fabian,
>
> This looks almost certainly like you are compiling with two different versions of the JDK.  Spit out the version from the OS and compare that to the version set for Eclipse and Ant.
>
> Joe
>
>   
I thougth so, too. But checked this...

 >java -version
java version "1.6.0_14"
Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
Java HotSpot(TM) Client VM (build 14.0-b16, mixed mode)

 >echo %JAVA_HOME%
C:\Program Files\Java\jdk1.6.0_14

 >ant -diagnostics
...
-------------------------------------------
 System properties
-------------------------------------------
java.runtime.name : Java(TM) SE Runtime Environment
sun.boot.library.path : C:\Program Files\Java\jdk1.6.0_14\jre\bin
java.vm.version : 14.0-b16
...

and eclipse is using that same jre6 for compilation so tomcat should 
einther have a problem with clase compiled by either one of them or with 
none, right?

-- 

____________________________________________

u n i t b  c o n s u l t i n g



Brunnenstr. 156

10115 Berlin



Tel:    +49 [0]30 44 31 92 00

Fax:    +49 [0]30 44 31 92 29

Mail:   office@unitb-consulting.de

Web:    http://www.unitb-consulting.de



Geschäftsführer: Nico Adam, Thomas Timm

Registergericht: AG Berlin-Charlottenburg - HRB 113607

Steuernummer: 37/249/21073

Ust-IdNr.: DE814984825



Diese E-Mail könnte vertrauliche und/oder rechtlich geschützte Informationen

enthalten. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail

irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und

vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte

Weitergabe dieser Mail sind nicht gestattet.



This e-mail may contain confidential and/or privileged information. If you

are not the intended recipient (or have received this e-mail in error)

please notify the sender immediately and destroy this e-mail. Any

unauthorised copying, disclosure or distribution of the material in this

e-mail is strictly forbidden.





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


RE: jsp compilation fails depending on how WEB-INF classes are build

Posted by Joseph Morgan <jo...@ignitesales.com>.
Fabian,

This looks almost certainly like you are compiling with two different versions of the JDK.  Spit out the version from the OS and compare that to the version set for Eclipse and Ant.

Joe

-----Original Message-----
From: Fabian Panthen [mailto:fpa@unitb-consulting.de] 
Sent: Monday, February 08, 2010 7:30 AM
To: users@tomcat.apache.org
Subject: jsp compilation fails depending on how WEB-INF classes are build

Hello,

not sure whether here is the right place to post, but i give it a shot...

I have a webapp with JSP's using some classes from WEB-INF/classes in a 
declaration block (<%!%>),
running in tomcat 6 on jdk1.6.0_14.

The problem is such,

if I compile the classes in WEB-INF/classes using eclipse Galileo 
everything runs fine.
But if I compile those same classes using ANT, jsp comilation in tomcat 
fails with the following stack trace:

org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException
      at 
org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader.<init>(ClassFileReader.java:342) 

      at 
org.apache.jasper.compiler.JDTCompiler$1.findType(JDTCompiler.java:206)
      at 
org.apache.jasper.compiler.JDTCompiler$1.findType(JDTCompiler.java:178)
      at 
org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType(LookupEnvironment.java:122) 

      at 
org.eclipse.jdt.internal.compiler.lookup.PackageBinding.getTypeOrPackage(PackageBinding.java:178) 

      at 
org.eclipse.jdt.internal.compiler.lookup.Scope.getPackage(Scope.java:2101)
      at 
org.eclipse.jdt.internal.compiler.ast.QualifiedTypeReference.getTypeBinding(QualifiedTypeReference.java:69) 

      at 
org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveType(TypeReference.java:134) 

      at 
org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.resolveTypeFor(SourceTypeBinding.java:1273) 

      at 
org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.fields(SourceTypeBinding.java:604) 

      at 
org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.faultInTypesForFieldsAndMethods(SourceTypeBinding.java:582) 

      at 
org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.faultInTypes(CompilationUnitScope.java:431) 

      at 
org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:616)
      at 
org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:392)
      at 
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:429)
      at org.apache.jasper.compiler.Compiler.compile(Compiler.java:334)
      at org.apache.jasper.compiler.Compiler.compile(Compiler.java:312)
      at org.apache.jasper.compiler.Compiler.compile(Compiler.java:299)
      at 
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:589) 

      at 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317) 

      at 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) 

      at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 

      at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) 

      at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) 

      at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) 

      at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) 

      at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) 

      at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
      at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
      at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) 

      at 
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
      at java.lang.Thread.run(Thread.java:619)

This happens as well under tomcat 5.5.
Changing the ANT build to use the same JDT compiler as eclipse did not 
change the problem.
Using javap I checked both compiled versions of the classes and they do 
have the same major version.

Any hint towards what might be the problem here is greatly appreciated.

Thanks a lot,

fabian

-- 

____________________________________________

u n i t b  c o n s u l t i n g



Brunnenstr. 156

10115 Berlin



Tel:    +49 [0]30 44 31 92 00

Fax:    +49 [0]30 44 31 92 29

Mail:   office@unitb-consulting.de

Web:    http://www.unitb-consulting.de



Geschäftsführer: Nico Adam, Thomas Timm

Registergericht: AG Berlin-Charlottenburg - HRB 113607

Steuernummer: 37/249/21073

Ust-IdNr.: DE814984825



Diese E-Mail könnte vertrauliche und/oder rechtlich geschützte Informationen

enthalten. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail

irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und

vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte

Weitergabe dieser Mail sind nicht gestattet.



This e-mail may contain confidential and/or privileged information. If you

are not the intended recipient (or have received this e-mail in error)

please notify the sender immediately and destroy this e-mail. Any

unauthorised copying, disclosure or distribution of the material in this

e-mail is strictly forbidden.





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


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