File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes problem with jaxws Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "problem with jaxws" Watch "problem with jaxws" New topic
Author

problem with jaxws

Yewint Ko
Ranch Hand

Joined: Aug 02, 2009
Posts: 90
Hi geeks
I am newto java web service. I have a web service client with JAXWS annotation. and i have tested the client app in my local tomcat server, it is running well. But after uploading to purchase java hosting, I got the following error message when i test the app. anyone help me solve the exception . I am very very new to java ws. thanks

org.apache.jasper.JasperException: javax.servlet.ServletException: java.lang.ExceptionInInitializerError
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:541)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:417)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:244)
java.security.AccessController.doPrivileged(Native Method)
javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:276)
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)

root cause

javax.servlet.ServletException: java.lang.ExceptionInInitializerError
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:850)
org.apache.jasper.runtime.PageContextImpl.access$1100(PageContextImpl.java:71)
org.apache.jasper.runtime.PageContextImpl$12.run(PageContextImpl.java:766)
java.security.AccessController.doPrivileged(Native Method)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:764)
org.apache.jsp.index_jsp._jspService(index_jsp.java:491)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:244)
java.security.AccessController.doPrivileged(Native Method)
javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:276)
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)

root cause

java.lang.ExceptionInInitializerError
java.lang.Class.forName0(Native Method)
java.lang.Class.forName(Class.java:169)
javax.xml.ws.spi.FactoryFinder.safeLoadClass(FactoryFinder.java:154)
javax.xml.ws.spi.FactoryFinder.newInstance(FactoryFinder.java:30)
javax.xml.ws.spi.FactoryFinder.find(FactoryFinder.java:128)
javax.xml.ws.spi.Provider.provider(Provider.java:83)
javax.xml.ws.Service.<init>(Service.java:56)
client.generate.SearcherService.<init>(SearcherService.java:42)
org.apache.jsp.index_jsp._jspService(index_jsp.java:201)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:244)
java.security.AccessController.doPrivileged(Native Method)
javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:276)
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)

root cause

java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.com.sun.xml.internal.ws.developer)
java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
java.security.AccessController.checkPermission(AccessController.java:546)
java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
java.lang.SecurityManager.checkPackageAccess(SecurityManager.java:1512)
java.lang.Class.checkMemberAccess(Class.java:2164)
java.lang.Class.getDeclaredConstructor(Class.java:1984)
com.sun.xml.bind.v2.model.nav.ReflectionNavigator.hasDefaultConstructor(ReflectionNavigator.java:468)
com.sun.xml.bind.v2.model.nav.ReflectionNavigator.hasDefaultConstructor(ReflectionNavigator.java:58)
com.sun.xml.bind.v2.model.impl.ClassInfoImpl.<init>(ClassInfoImpl.java:205)
com.sun.xml.bind.v2.model.impl.RuntimeClassInfoImpl.<init>(RuntimeClassInfoImpl.java:95)
com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createClassInfo(RuntimeModelBuilder.java:110)
com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createClassInfo(RuntimeModelBuilder.java:81)
com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:239)
com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:100)
com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:81)
com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:209)
com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:95)
com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:81)
com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:315)
com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:330)
com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:466)
com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:302)
com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1140)
com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:154)
com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:121)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:202)
javax.xml.bind.ContextFinder.find(ContextFinder.java:363)
javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574)
javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:522)
com.sun.xml.internal.ws.spi.ProviderImpl$2.run(ProviderImpl.java:199)
com.sun.xml.internal.ws.spi.ProviderImpl$2.run(ProviderImpl.java:196)
java.security.AccessController.doPrivileged(Native Method)
com.sun.xml.internal.ws.spi.ProviderImpl.getEPRJaxbContext(ProviderImpl.java:196)
com.sun.xml.internal.ws.spi.ProviderImpl.<clinit>(ProviderImpl.java:67)
java.lang.Class.forName0(Native Method)
java.lang.Class.forName(Class.java:169)
javax.xml.ws.spi.FactoryFinder.safeLoadClass(FactoryFinder.java:154)
javax.xml.ws.spi.FactoryFinder.newInstance(FactoryFinder.java:30)
javax.xml.ws.spi.FactoryFinder.find(FactoryFinder.java:128)
javax.xml.ws.spi.Provider.provider(Provider.java:83)
javax.xml.ws.Service.<init>(Service.java:56)
client.generate.SearcherService.<init>(SearcherService.java:42)
org.apache.jsp.index_jsp._jspService(index_jsp.java:201)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:244)
java.security.AccessController.doPrivileged(Native Method)
javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:276)
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)
Lester Burnham
Rancher

Joined: Oct 14, 2008
Posts: 1337
In a shared hosting environment, your web app will be run with a security manager - which will prevent certain operations from being carried out for security reasons (like java.lang.RuntimePermission accessClassInPackage.com.sun.xml.internal.ws.developer).

To get around this exception I think you'd need to install all the JAX-WS and JAXB libraries in one of Tomcat's shared directories (TOMCAT_HOME/lib or TOMCAT_HOME/shared) - but you won't be allowed to do that, either. Unless you can convince the admins to do that for you, or to run Tomcat with a less restrictive security manager, your only option is to upgrade your hosting account so that you have full control of the Tomcat instance.
Yewint Ko
Ranch Hand

Joined: Aug 02, 2009
Posts: 90
hello Lester
I have full control over my own tomcat instance. I can access via FTP. Can you please exactly tell me which libraries i need to add more . Currently I have following libs in WEB-INF/lib

activation.jar
webservices-extra-api.jar
webservices-rt.jar
webservices-api.jar
webservices-extra.jar
webservices-tools.jar

I also copy them to <tomcat instance>/lib .
The second way you said is to run tomcat with less restritive security manager. I am able to configure my private tomcat as i like and I just need to know how to do it.

thanks


Lester Burnham
Rancher

Joined: Oct 14, 2008
Posts: 1337
Yewint Ko wrote:Currently I have following libs in WEB-INF/lib ... I also copy them to <tomcat instance>/lib .

That may be the problem - you should have one copy of those, not multiple.
Yewint Ko
Ranch Hand

Joined: Aug 02, 2009
Posts: 90
i started with these libs in WEB-INF/lib. Then i copy them into tomcat shared lib as the exception occurs.
Lester Burnham
Rancher

Joined: Oct 14, 2008
Posts: 1337
Copying will result in those libraries existing in two places, but you need to make sure you only have them in one place - and that should be TOMCAT_HOME/lib.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem with jaxws