users@glassfish.java.net

Re: problems with Application Client Container and JAXB

From: <mark_at_javector.com>
Date: Thu, 26 Jan 2006 06:14:41 -0700

Where would I find the Application Client Container's log? There is no
error on
the Glassfish server.log. The main class running inside the ACC
invokes the web
service correctly. The AccessControlException occurs when it tries to creat a
JAXBContext and marshal out the returned value from the web service
invocation.

 From glassfish's server.log:

[#|2006-01-26T08:03:40.696-0500|INFO|sun-appserver-pe9.0|javax.enterprise.system.tools.deployment|_ThreadID=22;_ThreadName=httpWorkerThread-8080-1;Servlet;RequestOrderPort;http://soabookdev.scarsdale.javector.com:8080/oms/requestOrder;|DPL5306:Servlet
Web Service Endpoint [RequestOrderPort] listening at address
[http://soabookdev.scarsdale.javector.com:8080/oms/requestOrder]|#]

Quoting Tim Quinn <Timothy.Quinn_at_Sun.COM>:

> Mark,
>
> Is anything relevant in the server.log for this same time frame? - Tim
>
> mark_at_javector.com wrote:
>
>> I'm getting an AccessControlException when I try to create a
>> JAXBContext inside
>> a Main-Class executed within the Application Client Container.
>>
>> Perhaps this is a bug? I saw some other access control related bugs
>> related to
>> the appclient.
>>
>> Trace and client code:
>>
>> appclient-run:
>> [exec] Jan 25, 2006 11:32:45 PM com.sun.enterprise.appclient.Main <init>
>> [exec] WARNING: ACC003: Application threw an exception.
>> [exec] java.security.AccessControlException: access denied
>> (java.lang.RuntimePermission accessDeclaredMembers)
>> [exec] at
>> java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
>> [exec] at
>> java.security.AccessController.checkPermission(AccessController.java:427)
>> [exec] at
>> java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
>> [exec] at
>> java.lang.SecurityManager.checkMemberAccess(SecurityManager.java:1662)
>> [exec] at java.lang.Class.checkMemberAccess(Class.java:2125)
>> [exec] at java.lang.Class.getDeclaredConstructor(Class.java:1952)
>> [exec] at
>> com.sun.xml.bind.v2.model.nav.ReflectionNavigator.hasDefaultConstructor(ReflectionNavigator.java:417)
>> [exec] at
>> com.sun.xml.bind.v2.model.nav.ReflectionNavigator.hasDefaultConstructor(ReflectionNavigator.java:22)
>> [exec] at
>> com.sun.xml.bind.v2.model.impl.ClassInfoImpl.<init>(ClassInfoImpl.java:147)
>> [exec] at
>> com.sun.xml.bind.v2.model.impl.RuntimeClassInfoImpl.<init>(RuntimeClassInfoImpl.java:52)
>> [exec] at
>> com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createClassInfo(RuntimeModelBuilder.java:59)
>> [exec] at
>> com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createClassInfo(RuntimeModelBuilder.java:41)
>> [exec] at
>> com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:123)
>> [exec] at
>> com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:49)
>> [exec] at
>> com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:41)
>> [exec] at
>> com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:189)
>> [exec] at
>> com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:204)
>> [exec] at
>> com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:330)
>> [exec] at
>> com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:199)
>> [exec] at
>> com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:76)
>> [exec] at
>> com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:55)
>> [exec] at
>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> [exec] at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> [exec] at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>> [exec] at java.lang.reflect.Method.invoke(Method.java:585)
>> [exec] at
>> javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:210)
>> [exec] at javax.xml.bind.ContextFinder.find(ContextFinder.java:368)
>> [exec] at
>> javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:561)
>> [exec] at
>> javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:508)
>> [exec] at samples.Client.doTest(Client.java:64)
>> [exec] at samples.Client.main(Client.java:27)
>> [exec] at
>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> [exec] at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> [exec] at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>> [exec] at java.lang.reflect.Method.invoke(Method.java:585)
>> [exec] at
>> com.sun.enterprise.util.Utility.invokeApplicationMain(Utility.java:232)
>> [exec] at com.sun.enterprise.appclient.Main.<init>(Main.java:682)
>> [exec] at com.sun.enterprise.appclient.Main.main(Main.java:173)
>> [exec] [ERROR] Result: 1
>>
>> --------------------------
>>
>>
>> public static void main(String[] args) throws Exception {
>>
>> Client client = new Client();
>> client.doTest(args);
>>
>> }
>>
>> public void doTest(String[] args) throws Exception {
>>
>> // ..... snip .....
>>
>> RequestOrderService service = new RequestOrderService(
>> new URL("http://localhost:8080/oms/requestOrder?wsdl"),
>> new QName("http://www.example.com/req", "RequestOrderService"));
>> RequestOrderPort port = service.getRequestOrderPort();
>> JAXBContext jc = JAXBContext.newInstance(OrderType.class,
>> OrderRequestType.class);
>> Marshaller m = jc.createMarshaller();
>> m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
>> OrderType order = port.requestOrder(orderRequest);
>> JAXBElement<OrderType> orderElement = new JAXBElement<OrderType>(
>> new QName("","order"), OrderType.class, order);
>> m.marshal(orderElement, System.out);
>>
>> }
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>