0

I am deploying a WAR into a Tomcat 6 or Tomcat 7 server on a Windows 2003 Server box. The error looks something like

java.lang.Exception: Error initializing iSec web service proxy: Unable to create JAXBContext for generated packages: "com.integrity_apps" doesnt contain ObjectFactory.class or jaxb.index.

which I was getting previously when tools.jar was not in the classpath of my application. I was running the grails app from STS with the default web container, and I was able to fix this by re-installing JUST the JDK with tools.jar in the lib dir, and making sure JAVA_HOME was set correctly.

I have tried the same steps on the server - only installing the JDK, making sure JAVA_HOME is pointing to it, and dropping my WAR in the Tomcat container. I am still getting the error. Can anyone suggest why this may be happening?

As a further datapoint, I have noticed that if, on the server, I run the Tomcat7.exe from the command prompt directly (JAVA_HOME is set as a system variable), the error goes away. If I run it from the service manager, the error comes back. Thanks

Derek
  • 11,715
  • 32
  • 127
  • 228

1 Answers1

1

Looks like "com.integrity_apps" is your package containing your JAXB bean classes? I think it's missing ObjectFactory class within the package.

Check if there is a package called "com.integrity_apps" and if there is a class named ObjectFactory in that package. If not you may want to add it or use other ways to let JAXBContext know how to create your JAXB beans. This question on SO may be helpful: Do you always need an ObjectFactory class when using JAXB?

Community
  • 1
  • 1
Alvin
  • 10,308
  • 8
  • 37
  • 49
  • I think that is something from tools.jar or rt.jar, that is a JAXB dependency. I dont think I have written any code that explicitly requires ObjectFactory. I added a furthe datapoint about attempting to run this on the win2003 server – Derek Jan 12 '12 at 03:14
  • ObjectFactory is implicitly used by JAXB framework. Your new data point seems to suggest that different JVM installation are used when starting from command prompt and from service manager? I'm thinking maybe one installation of your JVM contains classes of "com.integrity_apps" package, while the other installation doesn't. – Alvin Jan 12 '12 at 03:25