cancel
Showing results for 
Search instead for 
Did you mean: 

Activiti REST - Not working in Oracle 12.1.2.0.0

prakashm88
Champ in-the-making
Champ in-the-making
We are trying to deploy Activiti-REST in Oracle 12.1.2.0.0, and as insisted it supports Servlet 3.0.

After completion of the application deployment, when trying to acesss the REST URL, I am getting the following error.


####<Jan 25, 2016 8:58:19 PM EST> <Info> <Deployer> <salsa> <myserver> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1453773499051> <BEA-149060> <Module activiti-rest.war of application activiti-rest successfully transitioned from STATE_ADMIN to STATE_ACTIVE on server myserver.>
####<Jan 25, 2016 8:58:19 PM EST> <Info> <Deployer> <salsa> <myserver> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1453773499069> <BEA-149074> <Successfully completed deployment task: [Deployer:149026]deploy application activiti-rest on myserver..>
####<Jan 25, 2016 8:58:40 PM EST> <Error> <HTTP> <salsa> <myserver> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1453773520821> <BEA-101020> <[ServletContext@698589730[app:activiti-rest module:activiti-rest.war path:null spec-version:3.0]] Servlet failed with an Exception
java.lang.IllegalArgumentException: ServletContext must not be null
        at org.springframework.util.Assert.notNull(Assert.java:112)
        at org.springframework.web.context.support.WebApplicationContextUtils.getWebApplicationContext(WebApplicationContextUtils.java:108)
        at org.springframework.web.context.support.WebApplicationContextUtils.getWebApplicationContext(WebApplicationContextUtils.java:98)
        at org.springframework.web.filter.DelegatingFilterProxy.findWebApplicationContext(DelegatingFilterProxy.java:305)
        at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:250)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3367)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3333)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
        at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:57)
        at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2220)
        at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2146)
        at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2124)
        at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1564)
        at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:254)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:295)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:254)


It seems the Weblogic Security handler is failing eventhough the application is deployed successfully, is there a way to resolve the same. Is there a way to disable the secutiry and test the application asa well.

Any help is appreciated, Thanks !.
3 REPLIES 3

jbarrez
Star Contributor
Star Contributor
I've never seen that error to be honest :s
And you're sure it's supporting servlet 3?

prakashm88
Champ in-the-making
Champ in-the-making
hi Joram,

Thanks for the quick reply. And, Yes 12.1.2.0.0 version supports the Java Servlet 3.0 specs.

Please check the link, https://docs.oracle.com/cd/E24329_01/web.1211/e24494/toc.htm#NOTES260

Even though the application is deployed successfully, I get the above stated error when trying to access the REST Urls.

I have tried to extract the REST Services without the Spring Security and deployed it as a separate Web app. I could see the application deployed and running successfully, with Java Servlet 3.0 Spec Deployment descriptors. I guess the issue should somewhere around security here. But some of the service uses the logged in User details. I am struck implementing a custom authentication mechanism as a replacement to Spring Security.

So I have two questions here

1.  Any idea on why Authentication might fail, there is a config in Weblogic which screws the Header level auth, but its corrected as said at the URL , http://itechgenie.com/myblog/2015/09/activiti-rest-in-weblogic/ , Still no use.
2. I added a filter to capture all request coming into the app, capture and validate the user thorugh custom headers, but how to set the authenticated user into the session ?, I mean, when I try to access ExplorerApp.get().getLoggedInUser() it returns null. Infact "ExplorerApp.get()" is null. Its not a bean and I am not sure how this object is instantiated or used.

Any help on resolving at least one of the above is much appreciated !!

Thanks.

jbarrez
Star Contributor
Star Contributor
I have very little websphere experience … so I'm afraid I can't be of much help there …

I don't think 2) will work. For starters, ExplorerApp is part of Activiti Explorer … not REST. That is a thread local that contains the server side UI for the current user. With a filter, i don't think you've passed the point where that threadlocal is set already. You probably need to change https://github.com/Activiti/Activiti/blob/master/modules/activiti-webapp-rest2/src/main/java/org/act... if you need to do as you describe.