wink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Harris, Christopher P" <chris_har...@baxter.com>
Subject Re: How to inject CDI beans into Wink Resource
Date Sun, 15 Dec 2013 23:29:08 GMT
I was using Wink v1.4 with the Classloader Policy set to PARENT_LAST, but I was getting the
stack traces that I posted earlier. There's an issue with OSGI loading IBM's modified Wink
v1.1 library. That library is still being exposed to my project, which causes the method signature
conflict surrounding CreationUtils.injectFields.

I would like to use v1.4 if possible.

 - Chris

Sent from my iPad

On Dec 15, 2013, at 6:07 AM, "Luciano Resende" <luckbr1975@gmail.com<mailto:luckbr1975@gmail.com>>
wrote:




On Sat, Dec 14, 2013 at 9:45 PM, Harris, Christopher P <chris_harris@baxter.com<mailto:chris_harris@baxter.com>>
wrote:
I forgot to add that I’ve tried, unsuccessfully, using wink-jcdi-server v1.1.2-incubating.

That’s why I’m suggesting adding wink-jcdi-server to the wink v1.1 tag code base.


-        Chris


You should really move to latest wink release, and try PARENT_LAST classloader option in your
Was 8 webapp.


From: Harris, Christopher P
Sent: Saturday, December 14, 2013 10:17 PM
To: user@wink.apache.org<mailto:user@wink.apache.org>
Subject: RE: How to inject CDI beans into Wink Resource

I’ve been looking into the problem some more.  I tried changing WAS 8’s Classloader Policy
from PARENT_FIRST to PARENT_LAST.  That didn’t resolve the classloader conflict.

Upon further digging into IBM’s documentation, WAS 8 employs Wink 1.1:
“The IBM implementation of JAX-RS is an extension of the base Wink 1.1 runtime environment.”

Source: http://pic.dhe.ibm.com/infocenter/rsahelp/v8/index.jsp?topic=%2Fcom.ibm.webservice.doc%2Ftopics%2Fcore%2Fcjaxrs.html

Inspecting your tags, I see that 1.1-incubating has no wink-jcdi-server project:
http://svn.apache.org/repos/asf/wink/tags/wink-1.1-incubating/

wink-jcdi-server didn’t appear until 1.1.2-incubating:
http://svn.apache.org/repos/asf/wink/tags/wink-1.1.2-incubating/

So…do I need to download the tag’s source, add the wink-jcdi-server project, and then
downgrade the project to work with wink-server and wink-common?

It seems like that’s what I’ll have to do.

I didn’t add wink-server as a dependency, but it seems that WAS 8’s admin console is using
the com.ibm.websphere.jaxrs.server.IBMRestServlet class.  At least…I think that the admin
console is responsible for using that class in its OSGI environment.


-        Chris

From: Harris, Christopher P
Sent: Saturday, December 14, 2013 5:21 PM
To: user@wink.apache.org<mailto:user@wink.apache.org>
Subject: RE: How to inject CDI beans into Wink Resource

Hi, Gerhard.

It’s taken me a while, but it turns out that I’ve encountered 2 issues (a major/critical
and a blocker) using wink-jcdi-server v1.4 in WAS 8.0.0.7.

Here’s issue #1 (the major/critical issue):

Using the following:
<servlet-name>restSdkService</servlet-name>
       <servlet-class>org.apache.wink.server.internal.servlet.RestServlet</servlet-class>
       <init-param>
             <param-name>javax.ws.rs.Application</param-name>
             <param-valuecom.blah.group.project.webservices.config.FunApplication</param-value>
       </init-param>

…with the wink-server dependency works with no issues, however, using the following:
<servlet-name>restSdkService</servlet-name>
       <servlet-class>org.apache.wink.jcdi.server.internal.servlet.CdiRestServlet</servlet-class>
       <init-param>
             <param-name>javax.ws.rs.Application</param-name>
             <param-value>com.blah.group.project.webservices.config.FunApplication</param-value>
       </init-param>

…does not work.

I get the following stack trace:
[12/14/13 16:32:02:274 CST] 000000b8 ServletWrappe I com.ibm.ws.webcontainer.servlet.ServletWrapper
init SRVE0242I: [fun-ear] [/fun] [Faces Servlet]: Initialization successful.
[12/14/13 16:32:02:277 CST] 000000b8 RestServlet   I org.apache.wink.server.internal.servlet.RestServlet
getApplication The system is using the com.blah.group.project.webservices.config.FunApplication
JAX-RS application class that is named in the javax.ws.rs.Application init-param initialization
parameter.
[12/14/13 16:32:02:289 CST] 000000b8 ServletWrappe E com.ibm.ws.webcontainer.servlet.ServletWrapper
init Uncaught.init.exception.thrown.by.servlet
[12/14/13 16:32:02:290 CST] 000000b8 webapp        E com.ibm.ws.webcontainer.webapp.WebApp
commonInitializationFinally SRVE0266E: Error occured while initializing servlets: {0}
                                 javax.servlet.ServletException: SRVE0207E: Uncaught initialization
exception created by servlet
         at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:404)
         at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.init(ServletWrapperImpl.java:168)
         at com.ibm.ws.webcontainer.servlet.ServletWrapper.loadOnStartupCheck(ServletWrapper.java:1366)
         at com.ibm.ws.webcontainer.webapp.WebApp.doLoadOnStartupActions(WebApp.java:611)
         at com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinally(WebApp.java:580)
         at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:421)
         at com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:88)
         at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:169)
         at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:746)
         at com.ibm.ws.webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java:634)
         at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:422)
         at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:714)
         at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1163)
         at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1369)
         at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:639)
         at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:967)
         at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:769)
         at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplicationDynamically(ApplicationMgrImpl.java:1357)
         at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2154)
         at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:446)
         at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123)
         at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:389)
         at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access$500(CompositionUnitMgrImpl.java:117)
         at com.ibm.ws.runtime.component.CompositionUnitMgrImpl$1.run(CompositionUnitMgrImpl.java:664)
         at com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:5468)
         at com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:5594)
         at com.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:255)
         at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:678)
         at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:622)
         at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:1249)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
         at java.lang.reflect.Method.invoke(Method.java:611)
         at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:69)
         at sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
         at java.lang.reflect.Method.invoke(Method.java:611)
         at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:272)
         at javax.management.modelmbean.RequiredModelMBean$4.run(RequiredModelMBean.java:1148)
         at java.security.AccessController.doPrivileged(AccessController.java:298)
         at com.ibm.oti.security.CheckedAccessControlContext.securityCheck(CheckedAccessControlContext.java:30)
         at sun.misc.JavaSecurityAccessWrapper.doIntersectionPrivilege(JavaSecurityAccessWrapper.java:41)
         at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1142)
         at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:995)
         at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:847)
         at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:783)
         at com.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:1335)
         at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
         at com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:1228)
         at com.ibm.ws.management.application.sync.StartDeploymentTask.startDeployment(StartDeploymentTask.java:250)
         at com.ibm.ws.management.application.sync.StartDeploymentTask.fullAppUpdate(StartDeploymentTask.java:122)
         at com.ibm.ws.management.application.sync.StartDeploymentTask.performTask(StartDeploymentTask.java:110)
         at com.ibm.ws.management.application.sync.AppBinaryProcessor$ExpandApp.expand(AppBinaryProcessor.java:1709)
         at com.ibm.ws.management.application.sync.AppBinaryProcessor.postProcessSynchronousExt(AppBinaryProcessor.java:749)
         at com.ibm.ws.management.bla.sync.BLABinaryProcessor.postProcess(BLABinaryProcessor.java:590)
         at com.ibm.ws.management.bla.sync.BLABinaryProcessor.onChangeCompletion(BLABinaryProcessor.java:467)
         at com.ibm.ws.management.bla.sync.BinaryProcessorWrapper.onChangeCompletion(BinaryProcessorWrapper.java:109)
         at com.ibm.ws.management.repository.FileRepository.postNotify(FileRepository.java:1905)
         at com.ibm.ws.management.repository.FileRepository.update(FileRepository.java:1414)
         at com.ibm.ws.management.repository.client.LocalConfigRepositoryClient.update(LocalConfigRepositoryClient.java:189)
         at com.ibm.ws.sm.workspace.impl.WorkSpaceMasterRepositoryAdapter.update(WorkSpaceMasterRepositoryAdapter.java:665)
         at com.ibm.ws.sm.workspace.impl.RepositoryContextImpl.update(RepositoryContextImpl.java:1998)
         at com.ibm.ws.sm.workspace.impl.RepositoryContextImpl.synch(RepositoryContextImpl.java:1946)
         at com.ibm.ws.sm.workspace.impl.WorkSpaceImpl.synch(WorkSpaceImpl.java:549)
         at com.ibm.ws.management.configservice.ConfigServiceImpl.save(ConfigServiceImpl.java:719)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
         at java.lang.reflect.Method.invoke(Method.java:611)
         at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:69)
         at sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
         at java.lang.reflect.Method.invoke(Method.java:611)
         at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:272)
         at javax.management.modelmbean.RequiredModelMBean$4.run(RequiredModelMBean.java:1148)
         at java.security.AccessController.doPrivileged(AccessController.java:298)
         at com.ibm.oti.security.CheckedAccessControlContext.securityCheck(CheckedAccessControlContext.java:30)
         at sun.misc.JavaSecurityAccessWrapper.doIntersectionPrivilege(JavaSecurityAccessWrapper.java:41)
         at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1142)
         at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:995)
         at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:847)
         at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:783)
         at com.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:1335)
         at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
         at com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:1228)
         at com.ibm.ws.management.connector.AdminServiceDelegator.invoke(AdminServiceDelegator.java:181)
         at com.ibm.ws.management.connector.ipc.CallRouter.route(CallRouter.java:247)
         at com.ibm.ws.management.connector.ipc.IPCConnectorInboundLink.doWork(IPCConnectorInboundLink.java:360)
         at com.ibm.ws.management.connector.ipc.IPCConnectorInboundLink$IPCConnectorReadCallback.complete(IPCConnectorInboundLink.java:602)
         at com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCompletedCallback.complete(SSLReadServiceContext.java:1784)
         at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
         at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
         at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
         at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
         at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
         at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
         at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
         at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1700)
Caused by: java.lang.LinkageError: loading constraint violation when resolving method "org/apache/wink/common/internal/lifecycle/CreationUtils.injectFields(Ljava/lang/Object;Lorg/apache/wink/common/internal/registry/metadata/ClassMetadata;Lorg/apache/wink/common/RuntimeContext;)V"
: loader "com/ibm/ws/classloader/CompoundClassLoader@12fe909e" of class "org/apache/wink/jcdi/server/internal/extension/WinkInjectionTarget$1"
and loader "org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader@20dde9ee" of class "org/apache/wink/common/internal/lifecycle/CreationUtils"
have different types for the method signature
         at org.apache.wink.jcdi.server.internal.extension.WinkInjectionTarget$1.run(JAXRSJCDICustomInjectionTarget.java:65)
         at java.security.AccessController.doPrivileged(AccessController.java:327)
         at org.apache.wink.jcdi.server.internal.extension.WinkInjectionTarget.inject(JAXRSJCDICustomInjectionTarget.java:56)
         at org.apache.webbeans.component.InjectionTargetWrapper.inject(InjectionTargetWrapper.java:80)
         at org.apache.webbeans.component.AbstractOwbBean.create(AbstractOwbBean.java:175)
         at org.apache.webbeans.context.creational.BeanInstanceBag.create(BeanInstanceBag.java:80)
         at org.apache.webbeans.context.AbstractContext.getInstance(AbstractContext.java:226)
         at org.apache.webbeans.context.AbstractContext.get(AbstractContext.java:191)
         at org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler.getContextualInstance(NormalScopedBeanInterceptorHandler.java:135)
         at org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler.invoke(NormalScopedBeanInterceptorHandler.java:95)
         at com.blah.group.project.webservices.config.FunApplication_$$_javassist_68.getSingletons(FunApplication_$$_javassist_68.java)
         at org.apache.wink.server.internal.application.ApplicationProcessor.process(ApplicationProcessor.java:83)
         at org.apache.wink.server.internal.DeploymentConfiguration.addApplication(DeploymentConfiguration.java:339)
         at org.apache.wink.server.internal.servlet.RestServlet.createRequestProcessor(RestServlet.java:139)
         at org.apache.wink.server.internal.servlet.RestServlet.init(RestServlet.java:94)
         at javax.servlet.GenericServlet.init(GenericServlet.java:161)
         at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:342)
         ... 98 more

To get around this issue, I implemented the following web.xml config:
<servlet-class>org.apache.wink.jcdi.server.internal.servlet.CdiRestServlet</servlet-class>
       <init-param>
             <param-name>applicationConfigLocation</param-name>
             <param-value>/WEB-INF/application</param-value>
       </init-param>
…and that eliminated the error.  I think that it would be good to keep configuration options
consistent with wink-server.  I don’t like having to use a properties file to list my Providers
and Resources and would prefer to use my own Application subclass to load the Providers and
Resources.  I was using a subclass with wink-server before I tried wink-jcdi-server.


Here’s issue #2 (the blocker):
Once I resorted to using the properties file to list my Providers and Resources (in this case
a MOXyJsonProvider and a simple Resource), I tried invoking a GET request on the resource
via a wink-client class (that worked for the non-wink-jcdi-server version) and Chrome’s
PostMan, but I get the following stack trace:

[12/14/13 16:45:33:647 CST] 00000095 RequestProces E org.apache.wink.server.internal.RequestProcessor
handleRequest An unhandled exception occurred which will be propagated to the container.
[12/14/13 16:45:33:647 CST] 00000095 ServletWrappe E com.ibm.ws.webcontainer.servlet.ServletWrapper
service SRVE0014E: Uncaught service() exception root cause restSdkService: javax.servlet.ServletException:
java.lang.LinkageError: loading constraint violation when resolving method "org/apache/wink/common/internal/lifecycle/CreationUtils.injectFields(Ljava/lang/Object;Lorg/apache/wink/common/internal/registry/metadata/ClassMetadata;Lorg/apache/wink/common/RuntimeContext;)V"
: loader "com/ibm/ws/classloader/CompoundClassLoader@eb70d1d9" of class "org/apache/wink/jcdi/server/internal/extension/WinkInjectionTarget$1"
and loader "org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader@20dde9ee" of class "org/apache/wink/common/internal/lifecycle/CreationUtils"
have different types for the method signature
         at org.apache.wink.server.internal.RequestProcessor.handleRequest(RequestProcessor.java:195)
         at org.apache.wink.server.internal.servlet.RestServlet.service(RestServlet.java:124)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
         at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1235)
         at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:779)
         at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
         at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
         at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1071)
         at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3763)
         at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304)
         at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:976)
         at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)
         at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:200)
         at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:453)
         at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:515)
         at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:306)
         at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:277)
         at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
         at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
         at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
         at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
         at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
         at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
         at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
         at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
         at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
         at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1700)
Caused by: java.lang.LinkageError: loading constraint violation when resolving method "org/apache/wink/common/internal/lifecycle/CreationUtils.injectFields(Ljava/lang/Object;Lorg/apache/wink/common/internal/registry/metadata/ClassMetadata;Lorg/apache/wink/common/RuntimeContext;)V"
: loader "com/ibm/ws/classloader/CompoundClassLoader@eb70d1d9" of class "org/apache/wink/jcdi/server/internal/extension/WinkInjectionTarget$1"
and loader "org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader@20dde9ee" of class "org/apache/wink/common/internal/lifecycle/CreationUtils"
have different types for the method signature
         at org.apache.wink.jcdi.server.internal.extension.WinkInjectionTarget$1.run(JAXRSJCDICustomInjectionTarget.java:65)
         at java.security.AccessController.doPrivileged(AccessController.java:327)
         at org.apache.wink.jcdi.server.internal.extension.WinkInjectionTarget.inject(JAXRSJCDICustomInjectionTarget.java:56)
         at org.apache.webbeans.component.InjectionTargetWrapper.inject(InjectionTargetWrapper.java:80)
         at org.apache.webbeans.component.AbstractOwbBean.create(AbstractOwbBean.java:175)
         at org.apache.webbeans.context.creational.BeanInstanceBag.create(BeanInstanceBag.java:80)
         at org.apache.webbeans.context.AbstractContext.getInstance(AbstractContext.java:226)
         at org.apache.webbeans.context.AbstractContext.get(AbstractContext.java:191)
         at org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler.getContextualInstance(NormalScopedBeanInterceptorHandler.java:135)
         at org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler.invoke(NormalScopedBeanInterceptorHandler.java:95)
         at com.blah.group.project.webservices.config.WinkResource_$$_javassist_70.welcomeMessage(WinkResource_$$_javassist_70.java)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
         at java.lang.reflect.Method.invoke(Method.java:611)
         at org.apache.wink.server.internal.handlers.InvokeMethodHandler.handleRequest(InvokeMethodHandler.java:63)
         at org.apache.wink.server.handlers.AbstractHandler.handleRequest(AbstractHandler.java:33)
         at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
         at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
         at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:67)
         at org.apache.wink.server.internal.handlers.CreateInvocationParametersHandler.handleRequest(CreateInvocationParametersHandler.java:54)
         at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
         at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
         at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:67)
         at org.apache.wink.server.internal.handlers.FindResourceMethodHandler.handleSubResourceMethod(FindResourceMethodHandler.java:188)
         at org.apache.wink.server.internal.handlers.FindResourceMethodHandler.handleRequest(FindResourceMethodHandler.java:110)
         at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
         at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
         at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:67)
         at org.apache.wink.server.internal.handlers.FindRootResourceHandler.handleRequest(FindRootResourceHandler.java:95)
         at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
         at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
         at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:67)
         at org.apache.wink.server.internal.handlers.HeadMethodHandler.handleRequest(HeadMethodHandler.java:53)
         at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
         at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
         at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:67)
         at org.apache.wink.server.internal.handlers.OptionsMethodHandler.handleRequest(OptionsMethodHandler.java:46)
         at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
         at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
         at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:67)
         at org.apache.wink.server.internal.handlers.SearchResultHandler.handleRequest(SearchResultHandler.java:33)
         at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
         at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
         at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:67)
         at org.apache.wink.server.internal.log.ResourceInvocation.handleRequest(ResourceInvocation.java:92)
         at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
         at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
         at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:67)
         at org.apache.wink.server.internal.log.Requests.handleRequest(Requests.java:76)
         at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
         at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
         at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:67)
         at org.apache.wink.server.handlers.AbstractHandlersChain.run(AbstractHandlersChain.java:52)
         at org.apache.wink.server.internal.RequestProcessor.handleRequestWithoutFaultBarrier(RequestProcessor.java:207)
         at org.apache.wink.server.internal.RequestProcessor.handleRequest(RequestProcessor.java:154)
         ... 26 more

[12/14/13 16:45:33:648 CST] 00000095 webapp        E com.ibm.ws.webcontainer.webapp.WebApp
logServletError SRVE0293E: [Servlet Error]-[restSdkService]: java.lang.LinkageError: loading
constraint violation when resolving method "org/apache/wink/common/internal/lifecycle/CreationUtils.injectFields(Ljava/lang/Object;Lorg/apache/wink/common/internal/registry/metadata/ClassMetadata;Lorg/apache/wink/common/RuntimeContext;)V"
: loader "com/ibm/ws/classloader/CompoundClassLoader@eb70d1d9" of class "org/apache/wink/jcdi/server/internal/extension/WinkInjectionTarget$1"
and loader "org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader@20dde9ee" of class "org/apache/wink/common/internal/lifecycle/CreationUtils"
have different types for the method signature
         at org.apache.wink.jcdi.server.internal.extension.WinkInjectionTarget$1.run(JAXRSJCDICustomInjectionTarget.java:65)
         at java.security.AccessController.doPrivileged(AccessController.java:327)
         at org.apache.wink.jcdi.server.internal.extension.WinkInjectionTarget.inject(JAXRSJCDICustomInjectionTarget.java:56)
         at org.apache.webbeans.component.InjectionTargetWrapper.inject(InjectionTargetWrapper.java:80)
         at org.apache.webbeans.component.AbstractOwbBean.create(AbstractOwbBean.java:175)
         at org.apache.webbeans.context.creational.BeanInstanceBag.create(BeanInstanceBag.java:80)
         at org.apache.webbeans.context.AbstractContext.getInstance(AbstractContext.java:226)
         at org.apache.webbeans.context.AbstractContext.get(AbstractContext.java:191)
         at org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler.getContextualInstance(NormalScopedBeanInterceptorHandler.java:135)
         at org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler.invoke(NormalScopedBeanInterceptorHandler.java:95)
         at com.blah.group.project.webservices.config.WinkResource_$$_javassist_70.welcomeMessage(WinkResource_$$_javassist_70.java)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
         at java.lang.reflect.Method.invoke(Method.java:611)
         at org.apache.wink.server.internal.handlers.InvokeMethodHandler.handleRequest(InvokeMethodHandler.java:63)
         at org.apache.wink.server.handlers.AbstractHandler.handleRequest(AbstractHandler.java:33)
         at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
         at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
         at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:67)
         at org.apache.wink.server.internal.handlers.CreateInvocationParametersHandler.handleRequest(CreateInvocationParametersHandler.java:54)
         at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
         at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
         at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:67)
         at org.apache.wink.server.internal.handlers.FindResourceMethodHandler.handleSubResourceMethod(FindResourceMethodHandler.java:188)
         at org.apache.wink.server.internal.handlers.FindResourceMethodHandler.handleRequest(FindResourceMethodHandler.java:110)
         at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
         at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
         at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:67)
         at org.apache.wink.server.internal.handlers.FindRootResourceHandler.handleRequest(FindRootResourceHandler.java:95)
         at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
         at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
         at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:67)
         at org.apache.wink.server.internal.handlers.HeadMethodHandler.handleRequest(HeadMethodHandler.java:53)
         at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
         at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
         at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:67)
         at org.apache.wink.server.internal.handlers.OptionsMethodHandler.handleRequest(OptionsMethodHandler.java:46)
         at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
         at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
         at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:67)
         at org.apache.wink.server.internal.handlers.SearchResultHandler.handleRequest(SearchResultHandler.java:33)
         at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
         at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
         at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:67)
         at org.apache.wink.server.internal.log.ResourceInvocation.handleRequest(ResourceInvocation.java:92)
         at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
         at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
         at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:67)
         at org.apache.wink.server.internal.log.Requests.handleRequest(Requests.java:76)
         at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
         at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
         at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:67)
         at org.apache.wink.server.handlers.AbstractHandlersChain.run(AbstractHandlersChain.java:52)
         at org.apache.wink.server.internal.RequestProcessor.handleRequestWithoutFaultBarrier(RequestProcessor.java:207)
         at org.apache.wink.server.internal.RequestProcessor.handleRequest(RequestProcessor.java:154)
         at org.apache.wink.server.internal.servlet.RestServlet.service(RestServlet.java:124)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
         at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1235)
         at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:779)
         at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
         at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
         at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1071)
         at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3763)
         at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304)
         at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:976)
         at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)
         at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:200)
         at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:453)
         at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:515)
         at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:306)
         at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:277)
         at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
         at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
         at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
         at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
         at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
         at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
         at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
         at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
         at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
         at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1700)


Both issues seem to revolve around the same classes and resulting Classloader issues with
WAS 8.0.0.7’s osgi classes.

I’m stuck using WAS 8.0.0.7, so I can’t upgrade to WAS v8.5.5.

Thanks.


-        Chris

From: Harris, Christopher P
Sent: Monday, November 04, 2013 12:02 AM
To: user@wink.apache.org<mailto:user@wink.apache.org>
Subject: Re: How to inject CDI beans into Wink Resource

Thank you, Gerhard.

My web app contains a beans.xml, and CDI is working fine with no issues.  I’m using Wink
1.4.

So, it seems that JCDI is the key to getting Wink and CDI working together.  Thanks for the
link!  I’ll check it out and let you know if I have any issues.

 - Chris





On Nov 3, 2013, at 3:36 AM, Gerhard Petracek <gerhard.petracek@gmail.com<mailto:gerhard.petracek@gmail.com>>
wrote:

hi,

in a full ee6 application-server it has to work out-of-the-box (once you add/package a beans.xml
correctly).

fyi:
you can have a look at a simple arquillian-test at [1].
(wink 1.4 is released already.)

regards,
gerhard

[1] http://svn.apache.org/repos/asf/wink/tags/wink-1.4.0/wink-jcdi-server/src/test/java/org/apache/wink/jcdi/server/test/WinkCdiTest.java



2013/11/3 Harris, Christopher P <chris_harris@baxter.com<mailto:chris_harris@baxter.com>>
Hi.  I’ve created a Question on JIRA:
https://issues.apache.org/jira/browse/WINK-417

I’ve read about a icdi patch submitted by Gerhard Petracek.  I’m using wink-client 1.4,
however, I haven’t added the wink-server dependency to my pom.xml.  I’ve registered the
Wink servlet (org.apache.wink.server.internal.servlet.RestServlet) in web.xml without, so
I take it that WAS v8.0 provides Wink 1.0.  I also haven’t declared the ibm-wink-jaxrs.jar
artifact that I’ve seen in several Wink/IBM tutorials.  That artifact come with the Web
2.0 feature pack.

So, to further expand my CDI question:
1.) I Gerhard’s patch included in the latest 1.4.x snapshot?
2.) If so, where can I obtain this 1.4.x snapshot?  I assume the Apache snapshots repo.  It
would be great if a snapshot dependency could be published to Maven Central and a pom.xml
dependency snippet could be included in the download documentation on your main site.
3.) Can someone confirm that WAS v8.0 indeed provides an Apache Wink server?
The information transmitted is intended only for the person(s) or entity to which it is addressed
and may contain confidential and/or legally privileged material. Delivery of this message
to any person other than the intended recipient(s) is not intended in any way to waive privilege
or confidentiality. Any review, retransmission, dissemination or other use of, or taking of
any action in reliance upon, this information by entities other than the intended recipient
is prohibited. If you receive this in error, please contact the sender and delete the material
from any computer.



The information transmitted is intended only for the person(s) or entity to which it is addressed
and may contain confidential and/or legally privileged material. Delivery of this message
to any person other than the intended recipient(s) is not intended in any way to waive privilege
or confidentiality. Any review, retransmission, dissemination or other use of, or taking of
any action in reliance upon, this information by entities other than the intended recipient
is prohibited. If you receive this in error, please contact the sender and delete the material
from any computer.

For Translation:

http://www.baxter.com/email_disclaimer

The information transmitted is intended only for the person(s) or entity to which it is addressed
and may contain confidential and/or legally privileged material. Delivery of this message
to any person other than the intended recipient(s) is not intended in any way to waive privilege
or confidentiality. Any review, retransmission, dissemination or other use of, or taking of
any action in reliance upon, this information by entities other than the intended recipient
is prohibited. If you receive this in error, please contact the sender and delete the material
from any computer.

For Translation:

http://www.baxter.com/email_disclaimer

The information transmitted is intended only for the person(s) or entity to which it is addressed
and may contain confidential and/or legally privileged material. Delivery of this message
to any person other than the intended recipient(s) is not intended in any way to waive privilege
or confidentiality. Any review, retransmission, dissemination or other use of, or taking of
any action in reliance upon, this information by entities other than the intended recipient
is prohibited. If you receive this in error, please contact the sender and delete the material
from any computer.

For Translation:

http://www.baxter.com/email_disclaimer



--
Luciano Resende
http://people.apache.org/~lresende
http://twitter.com/lresende1975
http://lresende.blogspot.com/
The information transmitted is intended only for the person(s) or entity to which it is addressed
and may contain confidential and/or legally privileged material. Delivery of this message
to any person other than the intended recipient(s) is not intended in any way to waive privilege
or confidentiality. Any review, retransmission, dissemination or other use of, or taking of
any action in reliance upon, this information by entities other than the intended recipient
is prohibited. If you receive this in error, please contact the sender and delete the material
from any computer.

For Translation:

http://www.baxter.com/email_disclaimer

Mime
View raw message