[GLASSFISH-16507] Servlet 2.3 test case compile error with JDK7 - missing package com.sun.image.codec.jpeg Created: 30/Apr/11  Updated: 28/Jan/12

Status: Open
Project: glassfish
Component/s: test
Affects Version/s: 3.1.1_b03
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Alex Pineda Assignee: sb110099
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

System running RHEL 5 with JDK7 build136 acquired at http://jre.us.oracle.com/java/re/jdk/7/promoted/ea/b136/bundles/ and Glassfish 3.1.1 build3


Tags: 3_1-next, 3_1_1-scrubbed

 Description   

When compiling our Servlet 2.3 test cases, it fails due error: package com.sun.image.codec.jpeg does not exist

In researching through Google, found several references that in OpenJDK this package has been removed and in the Java Advance Imaging Home page (http://java.sun.com/products/java-media/jai/iio.html), under the JPEG section, it mentions that some of the classes are unofficially implemented in the com.sun.image.codec.jpeg package.

What is not clear is what is the story with JDK7 and whether this is a JDK or an implementation issue that needs to be solved in our test case, thus, the reason for the bug report. We hope to get clarity on this point and perhaps instructions on how to replace these classes with a supported type in JDK7.

To see the problem, please follow the following example, but please adjust the glassfish3, jdk, ant location and your id in CVSROOT

% setenv CVSROOT :pserver:cvsguest@sunsw.us.oracle.com:/m/jws
% setenv SPS_HOME /space/test1/ws/appserver-sqe
% setenv S1AS_HOME /space/test1/glassfish3/glassfish
% setenv JAVA_HOME /space/test1/tool/jdk1.7.0-b136
% setenv ANT_HOME /space/test1/tool/apache-ant-1.7.1
% setenv PATH $JAVA_HOME/bin:$ANT_HOME/bin:$S1AS_HOME/bin:$PATH

To check out test source

% cvs co appserver-sqe/bootstrap.xml
% cd appserver-sqe
% ant -f bootstrap.xml co-core

To run the test
% ant start-domain
% ant startDerby
% ant v3g-core-all
% ant v3g-tomcat-all

After the test fishines (or aborts), run the following to stop the server
% ant stopDerby
% ant stop-domain

The complete compile error is:
[javac] Compiling 18 source files to /export/hudson/workspace/alex-core-jdk7/appserver-sqe/build/pe/amd64_wolfrun.us.oracle.com_Linux/tomcat-servlets/classes/com/sun/s1aspesqe/product_test/servlet2_3/WEB-INF/classes
[javac] /export/hudson/workspace/alex-core-jdk7/appserver-sqe/pe/tomcat/servlet/product_test
/servlet2_3/src/filters/FilterImage.java:72: error: package com.sun.image.codec.jpeg does not ex
ist [javac] import com.sun.image.codec.jpeg.JPEGImageEncoder; [javac] ^
[javac] /export/hudson/workspace/alex-core-jdk7/appserver-sqe/pe/tomcat/servlet/product_test
/servlet2_3/src/filters/FilterWEG.java:73: error: package com.sun.image.codec.jpeg does not exis
t [javac] import com.sun.image.codec.jpeg.JPEGImageEncoder; [javac] ^
[javac] /export/hudson/workspace/alex-core-jdk7/appserver-sqe/pe/tomcat/servlet/product_test
/servlet2_3/src/filters/FilterWRES.java:72: error: package com.sun.image.codec.jpeg does not exi
st [javac] import com.sun.image.codec.jpeg.JPEGImageEncoder;
[javac] ^ [javac] /export/hudson/workspace/alex-core-jdk7/appserver-sqe/pe/tomcat/servlet/product_test
/servlet2_3/src/filters/ResponseWrapperNR.java:72: error: package com.sun.image.codec.jpeg does
not exist
[javac] import com.sun.image.codec.jpeg.JPEGImageEncoder;
[javac] ^ [javac] /export/hudson/workspace/alex-core-jdk7/appserver-sqe/pe/tomcat/servlet/product_test/servlet2_3/src/filters/FilterImage.java:144: error: cannot find symbol
[javac] JPEGImageEncoder encoder=com.sun.image.codec.jpeg.JPEGCodec.createJPEGEncoder(imageStream);
[javac] ^
[javac] symbol: class JPEGImageEncoder
[javac] location: class FilterImage
[javac] /export/hudson/workspace/alex-core-jdk7/appserver-sqe/pe/tomcat/servlet/product_test
/servlet2_3/src/filters/FilterImage.java:144: error: package com.sun.image.codec.jpeg does not e
xist
[javac] JPEGImageEncoder encoder=com.sun.image.codec.jpeg.JPEGCodec.createJPEGEncoder(imageStream);
[javac] ^ [javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details. [javac] 6 errors

BUILD FAILED



 Comments   
Comment by Shing Wai Chan [ 02/May/11 ]

According to the error message above, the test case java file, appserver-sqe/pe/tomcat/servlet/product_test/servlet2_3/src/filters/FilterImage.java, refers to the com.sun.image.codec.jpeg.JPEGCodec.

This is a test case class, not in the server code.

Comment by Alex Pineda [ 28/Oct/11 ]

Assigning Tomcat test issue to module owner.

Comment by sb110099 [ 23/Jan/12 ]

This issue is only seen on Windows 7 with jdk7u2.
Need further investigation to modify these tests with equivalent packages in jdk7.
For now , commenting out these tests for Win7 and jdk7 runs.

Thanks,
Sudipa

Comment by sb110099 [ 28/Jan/12 ]

The bug indicating removal of this package (com.sun.image.codec.jpeg) from JDK 7 is found as:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6527962

Have adjusted the tests with "import javax.imageio." instead of com.sun.image.codec. .

Sudipa





[GLASSFISH-15761] Webcontainer: 13 tests are failing in 3.1 , needs test modifications Created: 31/Jan/11  Updated: 31/Jan/11

Status: Open
Project: glassfish
Component/s: sqe-test
Affects Version/s: 3.1_b33
Fix Version/s: None

Type: Bug Priority: Trivial
Reporter: sb110099 Assignee: sb110099
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: 3_1-exclude

 Description   

There are 13 failing tests in webcontainer. Some are failing due to "server name" change , some are due to "build# in Server version."
Need to adjust tests . Plan to do that after 3.1 .






Generated at Tue Sep 01 09:32:12 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.