NullPointerException when calling webservice in Weblogic 9.2
I am trying to call a webservice. The client was generated with weblogic's ant task clientgen. But when I use the client, following exception happens:
java.lang.ExceptionInInitializerError
at com.bea.xbean.xb.xsdschema.SchemaDocument$Factory.parse(SchemaDocument.java:799)
at weblogic.wsee.wsdl.WsdlSchema.parse(WsdlSchema.java:104)
at weblogic.wsee.wsdl.WsdlSchema.parse(WsdlSchema.java:73)
at weblogic.wsee.wsdl.WsdlTypes.parse(WsdlTypes.java:165)
at weblogic.wsee.wsdl.WsdlDefinitions.parseChild(WsdlDefinitions.java:480)
at weblogic.wsee.wsdl.WsdlExtensible.parse(WsdlExtensible.java:98)
at weblogic.wsee.wsdl.WsdlDefinitions.parse(WsdlDefinitions.java:428)
at weblogic.wsee.wsdl.WsdlDefinitions.parse(WsdlDefinitions.java:385)
at weblogic.wsee.wsdl.WsdlFactory.parse(WsdlFactory.java:78)
at weblogic.wsee.wsdl.WsdlFactory.parse(WsdlFactory.java:65)
at weblogic.wsee.jaxrpc.ServiceImpl.loadWsdlDefinition(ServiceImpl.java:437)
at weblogic.wsee.jaxrpc.ServiceImpl.<init>(ServiceImpl.java:108)
[...]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)开发者_运维知识库
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.NullPointerException
at com.bea.xml.XmlBeans.typeSystemForClassLoader(XmlBeans.java:769)
at com.bea.xbean.xb.xsdschema.SchemaDocument.<clinit>(SchemaDocument.java:19)
... 36 more
Does anybody know what could be the problem?
I found the solution. It was a classpath problem. I needed the following jars on my classpath:
- weblogic.jar
- weblogic-container-binding.jar
- xbean.jar
- stax-api-1.0.1.jar
- webservices.jar
- ant.jar
There is one more way to fix this issue.
Include under and add all weblogic server library jars in build.xml Run setDomainEnv of your domain directory. Now build webserivces.
精彩评论