0

I am trying to integrate spring saml extension with our JSF 2.0 web application. I get this strange error.

I was able to deploy the sample application thats at https://github.com/SpringSource/spring-security-saml which is Spring mvc app " java.lang.VerifyError"

Now I am trying to plugin the changes to my JSF app and all i can see is during application startup.

 java.lang.VerifyError: org/springframework/beans/factory/xml/XmlBeanDefinitionReader.setEntityResolver(Lorg/xml/sax/EntityResolver;)V
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:88)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:282)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:204)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:1667)
Vladimír Schäfer
  • 15,375
  • 2
  • 51
  • 71
Reddymails
  • 793
  • 1
  • 10
  • 24

1 Answers1

1

java.lang.VerifyError can be the result when you have compiled against a different library than you are using at runtime.

Usually compiler will flag problems where method signatures do not match. The JVM will verify the bytecode again when the class is loaded, and throws VerifyError when the bytecode is trying to do something that should not be allowed -- e.g. calling a method that returns String and then stores that return value in a field that holds a List.

Travis G
  • 1,592
  • 1
  • 13
  • 18
  • Travis, Thanks. This seems similar the question that was answered earlier. http://stackoverflow.com/questions/100107/reasons-of-getting-a-java-lang-verifyerror – Reddymails Mar 08 '13 at 22:54
  • I was deploying the app on websphere and since it was a JSF2 app I had set parent last (Else the default JSF jars from websphere will be loaded). In my WEB-INF/ Lib I had 'xalan-2.7.1.jar' 'xercesImpl-2.10.0.jar' 'xml-apis-2.10.0.jar' Since it was parent last these jars were getting picked which websphere did not like as it has its own implementation. I deleted the above jars in my war lib and now the "java.lang.verifyError" as disappeared. Its pain to identify which all jars need to be removed though. – Reddymails Mar 12 '13 at 13:48