Hi Can this section help:
http://cxf.apache.org/docs/jax-rs.html#JAX-RS-SecureJAXRSservices ? See the SecurityManager related example. I'm looking at the code and I'm seeing that the field injection is done properly, as a PrivilegedAction, but the type instantiation is done in a few places directly so configuring the SecurityManager may not help. Give it a try please anyway and disable the security manager just to confirm the application is working. In meantime, I'll need to try and run a demo in a SecurityManager enabled environment... Cheers, Sergey On Tue, Mar 1, 2011 at 9:25 PM, Nishant Ranjan < nishant_kaunve_ran...@yahoo.com> wrote: > Hi, > > The stack trace: > > Mar 1, 2011 9:04:07 PM > org.springframework.context.support.AbstractApplicationContext > prepareRefresh > INFO: Refreshing org.apache.cxf.bus.spring.BusApplicationContext@89cf1e: > startup > date [Tue Mar 01 21:04:07 GMT 2011]; root of context hierarchy > Mar 1, 2011 9:04:07 PM > org.springframework.beans.factory.xml.XmlBeanDefinitionReader > loadBeanDefinitions > INFO: Loading XML bean definitions from class path resource > [META-INF/cxf/cxf.xml] > Mar 1, 2011 9:04:07 PM > org.springframework.beans.factory.xml.XmlBeanDefinitionReader > loadBeanDefinitions > INFO: Loading XML bean definitions from class path resource > [META-INF/cxf/cxf-extension-xml.xml] > Mar 1, 2011 9:04:07 PM > org.springframework.beans.factory.xml.XmlBeanDefinitionReader > loadBeanDefinitions > INFO: Loading XML bean definitions from class path resource > [META-INF/cxf/cxf-extension-jaxrs-binding.xml] > Mar 1, 2011 9:04:07 PM > org.springframework.beans.factory.xml.XmlBeanDefinitionReader > loadBeanDefinitions > INFO: Loading XML bean definitions from class path resource > [META-INF/cxf/cxf-extension-http.xml] > Mar 1, 2011 9:04:07 PM > org.springframework.beans.factory.xml.XmlBeanDefinitionReader > loadBeanDefinitions > INFO: Loading XML bean definitions from class path resource > [META-INF/cxf/cxf-extension-http-jetty.xml] > Mar 1, 2011 9:04:07 PM > org.springframework.beans.factory.xml.XmlBeanDefinitionReader > loadBeanDefinitions > INFO: Loading XML bean definitions from class path resource > [META-INF/cxf/cxf-extension-http.xml] > Mar 1, 2011 9:04:07 PM > org.springframework.beans.factory.support.DefaultListableBeanFactory > registerBeanDefinition > INFO: Overriding bean definition for bean > 'org.apache.cxf.transport.http.policy.HTTPClientAssertionBuilder': > replacing > [Generic bean: class > [org.apache.cxf.transport.http.policy.HTTPClientAssertionBuilder]; scope=; > abstract=false; lazyInit=true; autowireMode=0; dependencyCheck=0; > autowireCandidate=true; primary=false; factoryBeanName=null; > factoryMethodName=null; initMethodName=null; destroyMethodName=null; > defined in > class path resource [META-INF/cxf/cxf-extension-http.xml]] with [Generic > bean: > class [org.apache.cxf.transport.http.policy.HTTPClientAssertionBuilder]; > scope=; > abstract=false; lazyInit=true; autowireMode=0; dependencyCheck=0; > autowireCandidate=true; primary=false; factoryBeanName=null; > factoryMethodName=null; initMethodName=null; destroyMethodName=null; > defined in > class path resource [META-INF/cxf/cxf-extension-http.xml]] > Mar 1, 2011 9:04:07 PM > org.springframework.beans.factory.support.DefaultListableBeanFactory > registerBeanDefinition > INFO: Overriding bean definition for bean > 'org.apache.cxf.transport.http.policy.HTTPServerAssertionBuilder': > replacing > [Generic bean: class > [org.apache.cxf.transport.http.policy.HTTPServerAssertionBuilder]; scope=; > abstract=false; lazyInit=true; autowireMode=0; dependencyCheck=0; > autowireCandidate=true; primary=false; factoryBeanName=null; > factoryMethodName=null; initMethodName=null; destroyMethodName=null; > defined in > class path resource [META-INF/cxf/cxf-extension-http.xml]] with [Generic > bean: > class [org.apache.cxf.transport.http.policy.HTTPServerAssertionBuilder]; > scope=; > abstract=false; lazyInit=true; autowireMode=0; dependencyCheck=0; > autowireCandidate=true; primary=false; factoryBeanName=null; > factoryMethodName=null; initMethodName=null; destroyMethodName=null; > defined in > class path resource [META-INF/cxf/cxf-extension-http.xml]] > Mar 1, 2011 9:04:07 PM > org.springframework.beans.factory.support.DefaultListableBeanFactory > registerBeanDefinition > INFO: Overriding bean definition for bean > 'org.apache.cxf.transport.http.policy.NoOpPolicyInterceptorProvider': > replacing > [Generic bean: class > [org.apache.cxf.transport.http.policy.NoOpPolicyInterceptorProvider]; > scope=; > abstract=false; lazyInit=true; autowireMode=0; dependencyCheck=0; > autowireCandidate=true; primary=false; factoryBeanName=null; > factoryMethodName=null; initMethodName=null; destroyMethodName=null; > defined in > class path resource [META-INF/cxf/cxf-extension-http.xml]] with [Generic > bean: > class [org.apache.cxf.transport.http.policy.NoOpPolicyInterceptorProvider]; > scope=; abstract=false; lazyInit=true; autowireMode=0; dependencyCheck=0; > autowireCandidate=true; primary=false; factoryBeanName=null; > factoryMethodName=null; initMethodName=null; destroyMethodName=null; > defined in > class path resource [META-INF/cxf/cxf-extension-http.xml]] > Mar 1, 2011 9:04:07 PM > org.springframework.beans.factory.support.DefaultListableBeanFactory > registerBeanDefinition > INFO: Overriding bean definition for bean > 'org.apache.cxf.transport.http.ClientOnlyHTTPTransportFactory': replacing > [Generic bean: class > [org.apache.cxf.transport.http.ClientOnlyHTTPTransportFactory]; scope=; > abstract=false; lazyInit=true; autowireMode=0; dependencyCheck=0; > autowireCandidate=true; primary=false; factoryBeanName=null; > factoryMethodName=null; initMethodName=null; destroyMethodName=null; > defined in > class path resource [META-INF/cxf/cxf-extension-http.xml]] with [Generic > bean: > class [org.apache.cxf.transport.http.ClientOnlyHTTPTransportFactory]; > scope=; > abstract=false; lazyInit=true; autowireMode=0; dependencyCheck=0; > autowireCandidate=true; primary=false; factoryBeanName=null; > factoryMethodName=null; initMethodName=null; destroyMethodName=null; > defined in > class path resource [META-INF/cxf/cxf-extension-http.xml]] > Mar 1, 2011 9:04:08 PM > org.springframework.beans.factory.support.DefaultListableBeanFactory > preInstantiateSingletons > INFO: Pre-instantiating singletons in > > org.springframework.beans.factory.support.DefaultListableBeanFactory@1e232b5 > : > defining beans > > [cxf,org.apache.cxf.bus.spring.BusApplicationListener,org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,org.apache.cxf.resource.ResourceManager,org.apache.cxf.configuration.Configurer,org.apache.cxf.binding.BindingFactoryManager,org.apache.cxf.transport.DestinationFactoryManager,org.apache.cxf.transport.ConduitInitiatorManager,org.apache.cxf.wsdl.WSDLManager,org.apache.cxf.phase.PhaseManager,org.apache.cxf.workqueue.WorkQueueManager,org.apache.cxf.buslifecycle.BusLifeCycleManager,org.apache.cxf.endpoint.ServerRegistry,org.apache.cxf.endpoint.ServerLifeCycleManager,org.apache.cxf.endpoint.ClientLifeCycleManager,org.apache.cxf.transports.http.QueryHandlerRegistry,org.apache.cxf.endpoint.EndpointResolverRegistry,org.apache.cxf.headers.HeaderManager,org.apache.cxf.catalog.OASISCatalogManager,org.apache.cxf.service.factory.FactoryBeanListenerManage > > r,org.apache.cxf.endpoint.ServiceContractResolverRegistry,org.apache.cxf.binding.xml.XMLBindingFactory,org.apache.cxf.transport.http.policy.HTTPClientAssertionBuilder,org.apache.cxf.transport.http.policy.HTTPServerAssertionBuilder,org.apache.cxf.transport.http.policy.NoOpPolicyInterceptorProvider,org.apache.cxf.transport.http.ClientOnlyHTTPTransportFactory,org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory]; > root of factory hierarchy > Mar 1, 2011 9:04:08 PM org.apache.cxf.endpoint.ServerImpl initDestination > INFO: Setting the server's publish address to be http://localhost:9001/ > SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". > SLF4J: Defaulting to no-operation (NOP) logger implementation > SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further > details. > Mar 1, 2011 9:04:13 PM org.apache.cxf.jaxrs.utils.InjectionUtils > reportServerError > SEVERE: Class com.happenings.ws.AuthBean can not be instantiated due to > security > manager restrictions > Mar 1, 2011 9:04:13 PM > org.apache.cxf.jaxrs.impl.WebApplicationExceptionMapper > toResponse > WARNING: WebApplicationException has been caught : no cause is available > > Regards, > Nishant Ranjan > > > > > ________________________________ > From: Sergey Beryozkin <sberyoz...@gmail.com> > To: users@cxf.apache.org > Sent: Tuesday, March 1, 2011 21:13:57 > Subject: Re: Class {0} can not be instantiated due to security manager > restrictions > > Hi > > Can you post a complete stack trace please ? > > thanks, Sergey > > On Tue, Mar 1, 2011 at 8:18 PM, Nishant Ranjan < > nishant_kaunve_ran...@yahoo.com> wrote: > > > Hi, > > > > I am new to CXF. > > I am trying to run a JAX-RS service using a resource class > > com.happenings.ws.AuthBean. > > > > All is fine when i start the server but then when i try to access the > > service > > through a browser, I get the following error. > > > > > > Class com.happenings.ws.AuthBean can not be instantiated due to security > > manager > > restrictionsI understand that i need to a security policy but am not sure > > what? > > And where? (as in does CXF have a reommendation other than to add a > policy > > file as a a java property)? > > Regards, > > Nishant Ranjan > > > > > > > -- > Sergey Beryozkin > > Application Integration Division of Talend <http://www.talend.com> > http://sberyozkin.blogspot.com > > > -- Sergey Beryozkin Application Integration Division of Talend <http://www.talend.com> http://sberyozkin.blogspot.com