Hi
I've spent 5 days googling, reading forum threads, release notes, tutorials: to no avail. I still cannot work this out. Your help would be greatly appreciated.
Following JAXB tutorial chapter 11 with the unmarshal-read example, I get following message at step 3:
[WARNING] Unable to validate your schema. Most likely, the JVM has loaded an incompatible XML parser implementation. You should fix this before relying on the generated code. Please see the release notes for details.
unknown location
I have the same result using ant under Eclipse.
Release Notes mention an issue with versions of xercesImpl.jar. I modified my classpath to make sure I used the good one but I still get the Warning.
NB: I copied xjc.bat at the end of this post.
Although there is a warning, the classes from the example are generated and I can import them in eclipse and build my project.
But I cannot compile them in the cmd line following step 5 of the tutorial: I get 100 errors - with and without copying the .jars to %JAVA_HOME%\jre\lib\endorsed.
I modified xjc.bat as follows:
********************************
@echo off
if "%OS%" == "Windows_NT" setlocal
rem ---------------------------------------------------------------------------
rem Script for launching xjc usng the Launcher
rem
rem Environment Variable Prequisites
rem
rem JAVA_HOME Must point at your Java Development Kit installation.
rem
rem $Id: xjc.bat,v 1.9 2003/04/17 07:18:06 mode Exp $
rem ---------------------------------------------------------------------------
rem Get standard environment variables
set PRG=%0
set READ_EX=%JWSDP_HOME%\..\jwstutorial13\examples\jaxb\unmarshal-read
set SETENVPATH=%JWSDP_HOME%\jwsdp-shared\bin
if exist %SETENVPATH%\setenv.bat goto gotCmdPath
rem %0 must have been found by DOS using the %PATH% so we assume that setenv.bat
rem will also be found in the %PATH%
call setenv.bat
goto doneSetenv
:gotCmdPath
call %SETENVPATH%\setenv.bat
:doneSetenv
rem Set JAXB_HOME variable
set JAXB_HOME=%JWSDP_HOME%\jaxb
set JAXP_HOME=%JWSDP_HOME%\jaxp
set JWSHARED_HOME=%JWSDP_HOME%\jwsdp-shared
rem Make sure prerequisite environment variables are set
if not "%JAVA_HOME%" == "" goto gotJavaHome
echo The JAVA_HOME environment variable is not defined.
echo This environment variable is needed to run this program.
goto end
:gotJavaHome
rem Capture options
rem ===============
set xOpts=
:addOption
if "%1x"=="x" goto endOptions
set xOpts=%xOpts% %1
shift
goto addOption
:endOptions
set CLASSPATH=%JAXP_HOME%\lib\endorsed;%READ_EX%;%JWSHARED_HOME%\bin;%JAXP_HOME%\lib;%JAXB_HOME%\lib;%JWSHARED_HOME%\lib;%JAVA_HOME%\jre\lib
rem Execute the Launcher using the "xjc" target
%JAVA_HOME%\bin\java.exe LauncherBootstrap -classpath %CLASSPATH% -verbose xjc -DJAXB_HOME="%JAXB_HOME%" -DJAVA_HOME="%JAVA_HOME%" %xOpts%
:end
*********************************
PS: setenv.bat is correct
Many thanks for your help
Cheers
JCarmel