cancel
Showing results for 
Search instead for 
Did you mean: 

Jibx Compilation Error

steel
Champ in-the-making
Champ in-the-making
I'm gettingg the following Jibx Compilation Error when trying to compile with Ant. Any ideas?

init:
     [echo] Starting build for repository at 09:20

compile-jibx:
     [bind] Error running binding compiler
     [bind] java.lang.NoSuchFieldError: SYSTEM_CLASS_PATH
     [bind]     at org.jibx.binding.classes.ClassFile.<init>(ClassFile.java:224)

     [bind]     at org.jibx.binding.classes.ClassCache.getClassFileImpl(ClassCac
he.java:139)
     [bind]     at org.jibx.binding.classes.ClassCache.getClassFile(ClassCache.j
ava:179)
     [bind]     at org.jibx.binding.classes.ClassItem.findStaticMethod(ClassItem
.java:479)
     [bind]     at org.jibx.binding.def.StringConversion.setSerializer(StringCon
version.java:378)
     [bind]     at org.jibx.binding.def.PrimitiveStringConversion.setSerializer(
PrimitiveStringConversion.java:465)
     [bind]     at org.jibx.binding.def.StringConversion.<init>(StringConversion
.java:145)
     [bind]     at org.jibx.binding.def.PrimitiveStringConversion.<init>(Primiti
veStringConversion.java:152)
     [bind]     at org.jibx.binding.def.BindingDefinition.<clinit>(BindingDefini
tion.java:80)
     [bind]     at org.jibx.binding.Compile.compile(Compile.java:287)
     [bind]     at org.jibx.binding.ant.CompileTask.execute(CompileTask.java:248
)
     [bind]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.ja
va:275)
     [bind]     at org.apache.tools.ant.Task.perform(Task.java:364)
     [bind]     at org.apache.tools.ant.Target.execute(Target.java:341)
     [bind]     at org.apache.tools.ant.Target.performTasks(Target.java:369)
     [bind]     at org.apache.tools.ant.Project.executeSortedTargets(Project.jav
a:1216)
     [bind]     at org.apache.tools.ant.helper.SingleCheckExecutor.executeTarget
s(SingleCheckExecutor.java:37)
     [bind]     at org.apache.tools.ant.Project.executeTargets(Project.java:1068
)
     [bind]     at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:382)
     [bind]     at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.j
ava:107)
     [bind]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.ja
va:275)
     [bind]     at org.apache.tools.ant.Task.perform(Task.java:364)
     [bind]     at org.apache.tools.ant.Target.execute(Target.java:341)
     [bind]     at org.apache.tools.ant.Target.performTasks(Target.java:369)
     [bind]     at org.apache.tools.ant.Project.executeSortedTargets(Project.jav
a:1216)
     [bind]     at org.apache.tools.ant.helper.SingleCheckExecutor.executeTarget
s(SingleCheckExecutor.java:37)
     [bind]     at org.apache.tools.ant.Project.executeTargets(Project.java:1068
)
     [bind]     at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:382)
     [bind]     at org.apache.tools.ant.taskdefs.SubAnt.execute(SubAnt.java:277)

     [bind]     at org.apache.tools.ant.taskdefs.SubAnt.execute(SubAnt.java:201)

     [bind]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.ja
va:275)
     [bind]     at org.apache.tools.ant.Task.perform(Task.java:364)
     [bind]     at org.apache.tools.ant.Target.execute(Target.java:341)
     [bind]     at org.apache.tools.ant.Target.performTasks(Target.java:369)
     [bind]     at org.apache.tools.ant.Project.executeSortedTargets(Project.jav
a:1216)
     [bind]     at org.apache.tools.ant.Project.executeTarget(Project.java:1185)

     [bind]     at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(De
faultExecutor.java:40)
     [bind]     at org.apache.tools.ant.Project.executeTargets(Project.java:1068
)
     [bind]     at org.apache.tools.ant.Main.runBuild(Main.java:668)
     [bind]     at org.apache.tools.ant.Main.startAnt(Main.java:187)
     [bind]     at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
     [bind]     at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)


BUILD FAILED
C:\Documents and Settings\Steel\My Documents\My Projects\Alfresco 1.2\common\bui
ld.xml:42: The following error occurred while executing this line:
C:\Documents and Settings\Steel\My Documents\My Projects\Alfresco 1.2\projects\r
epository\project-build.xml:8: The following error occurred while executing this
line:
C:\Documents and Settings\Steel\My Documents\My Projects\Alfresco 1.2\projects\r
epository\project-build.xml:12: JiBXException in JiBX binding compilation
8 REPLIES 8

steel
Champ in-the-making
Champ in-the-making
It compiles fine in my IDE but when I run Ant from the commandline I get the error. There is a conflict in my classpath or something. Can anyone shed some light on this?

marcus
Champ in-the-making
Champ in-the-making
Bumping this one because I'm getting the exact same error using ant Smiley Happy

jenglert
Champ in-the-making
Champ in-the-making
Bump.


I'm experiencing this problem also.  If I do find a solution, I'll be sure to share it.  If anyone else happens to have a solution, some help would be much appreciated.

jenglert
Champ in-the-making
Champ in-the-making
Problem Solved!

There was a conflicting jar on the classpath.  Investigate the possibility of this  using a classpath searcher.  I recommend http://www.fullspan.com/proj/jwhich/index.html

Execute the command:

java com.fullspan.jwhich.JWhich org/apache/bcel/util/ClassPath.class


It should return not found indicating that there is no conflict.

marcus
Champ in-the-making
Champ in-the-making
It should return not found indicating that there is no conflict.

Unfortunately for me, it is returning not found, but I'm still getting the error 😕

bgl
Champ on-the-rise
Champ on-the-rise
I have encountered the problem. But it seems that I was using a modified ant.

Downloading 1.6.5 from apache repository and using this version has fixed the problem for me.

zmicer
Champ in-the-making
Champ in-the-making
Hello, All!

I came across the same problem as pointed below.

First of all I tried JWhich - thanks for information on it. Just addition is to use -cp option to be able using it at the same dir where it is placed without modifying classpath

java -cp jwhich.jar com.fullspan.jwhich.JWhich org/apache/bcel/util/ClassPath.class

Still this software provided to me this info:
org/apache/bcel/util/ClassPath.class: jar:file:/C:/Program%20Files/Java/jre1.5.0
_13/lib/endorsed/xalan-2.7.0.jar!/org/apache/bcel/util/ClassPath.class

When playing with changing different versions of ant as it was advices, I found it doesn't help me, and then decided to check pathes one more time.

So my JAVA_PATH pointed not to program files installation but to separated directory. Appropriate bin was in path.

And finally the picture is: java.exe of JSDK installed at the E:\program_files\isdk_1_5\ folder was in path, still E:\program_files\isdk_1_5\ was not in classpath, as well as c:\Program Files\Java\jre1.5.0_13\. As I know for windows java checks the following rehistry key to get the current JRE installation, and also seems to be java.exe checks current jre of its folder HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment.

As a solution I removed E:\program_files\isdk_1_5\jre\lib\endorsed\xalan-2.7.0.jar and problem was solved.

This also shows JWhich doesn't show the whole picture for windows (for sure I may wrong, please check it and provide your vision).

Dzmitry [Zmicer] Harachka,
http://www.zmicer.com

gabriela
Champ in-the-making
Champ in-the-making
Hi,

I was getting the same error, and I tried zmicer's solution. I removed xalan.jar from C:\Program Files\Java\jdk1.6.0_06\jre\lib\endorsed\ folder, and now it's building successfully Smiley Happy
Thank you zmicer!