|
| Problem | Error returned:
The source file encoding may be different with this platform encoding.
Please use -encoding option to adjust file encoding, or apply native2ascii utility to make source file ASCII encoding. | | | | Solution | Error returned:
The source file encoding may be different with this platform encoding. Please use -encoding option to adjust file encoding, or apply native2ascii utility to make source file ASCII encoding. When javabean source files reside in the same directory as the javabean class file, the above exception may occur if the source file is newer than the class file and non- utf-8 characters are contained in the javabean source.
Eliminating WebSphere from the equation, it is important to understand that, when a bean source file is present, if code which references the bean is compiled(i.e. servlet or jsp) then there is an attempt to compile the bean if the bean source is newer than the bean class. This is fine for javac because it adopts the platform encoding. When the compilation of the bean is forced via the jsp compiler, the jsp compiler will use utf-8 encoding and any non utf-8
characters in the bean will cause the jsp compilation to fail. It is important not to include the source files on the classpath because there is a risk that compilation will be forced by the JSP compiler and this encoding failure will result.
In our tests we notice that the order in which files are ftp-ed to the classpath is important. If the bean class ftps before the java file, then recompile of the bean is initiated. Net result is that storing java files on the classpath is prone to problems. The work around is not to store java files on the classpath.
Error returned: The source file encoding may be different with this platform encoding. Please use -encoding option to adjust file encoding, or apply native2ascii utility to make source file ASCII encoding. | | | | |
| |
|
Product categories: Software, Application Servers, Distributed Application & Web Servers, WebSphere Application Server, Servlet Engine/Web Container Operating system(s): Multi-Platform Software version: 3.5, 4.0 Software edition: Edition Independent Reference #: 1109285 IBM Group: Software Group Modified date: 2003-12-15
(C) Copyright IBM Corporation 2000, 2004. All Rights Reserved.
|