Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stripes 1.6.0 will not run in a WebSphere Liberty #57

Open
NiklasA opened this issue May 9, 2016 · 10 comments
Open

Stripes 1.6.0 will not run in a WebSphere Liberty #57

NiklasA opened this issue May 9, 2016 · 10 comments

Comments

@NiklasA
Copy link

NiklasA commented May 9, 2016

Hi,

I just included Stripes into my JEE application but every time I will get this error message during start up. I am using a WebSphere Application Server 8.5.5.X. I am searching for awhile now and I've heard that there are some troubles with IBM WebSphere in combination with the Stripes Framework. Is there anyone, who get a JEE application running in a similar combination or know what I have to consider?

Error Log:

    [5/9/16 21:59:39:743 CEST] 00000079 com.ibm.ws.webcontainer.servlet                              I SRVE0242I: [skillDB-ear-0.0.1] [/skillDB] [StripesDispatcher]: Initialization successful.
    [5/9/16 21:59:39:810 CEST] 00000079 com.ibm.ws.webcontainer.filter                               E SRVE0321E: The [StripesFilter] filter did not load during start up.
    javax.servlet.ServletException: Filter [StripesFilter]: could not be initialized
        at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.init(FilterInstanceWrapper.java:163)
        at com.ibm.ws.webcontainer.filter.WebAppFilterManager._loadFilter(WebAppFilterManager.java:655)
        at com.ibm.ws.webcontainer.filter.WebAppFilterManager.loadFilter(WebAppFilterManager.java:518)
        at com.ibm.ws.webcontainer.filter.WebAppFilterManager.init(WebAppFilterManager.java:246)
        at com.ibm.ws.webcontainer.osgi.webapp.WebApp.initializeFilterManager(WebApp.java:854)
        at com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinally(WebApp.java:1164)
        at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:1053)
        at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:6463)
        at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.startWebApp(DynamicVirtualHost.java:446)
        at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.createRunnableHandler(DynamicVirtualHost.java:248)
        at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.createRunnableHandler(DynamicVirtualHost.java:313)
        at com.ibm.ws.http.internal.VirtualHostImpl.discriminate(VirtualHostImpl.java:251)
        at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink.ready(HttpDispatcherLink.java:306)
        at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:471)
        at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleNewRequest(HttpInboundLink.java:405)
        at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.processRequest(HttpInboundLink.java:285)
        at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.ready(HttpInboundLink.java:256)
        at com.ibm.ws.channel.ssl.internal.SSLConnectionLink.determineNextChannel(SSLConnectionLink.java:1037)
        at com.ibm.ws.channel.ssl.internal.SSLConnectionLink$MyReadCompletedCallback.complete(SSLConnectionLink.java:626)
        at com.ibm.ws.channel.ssl.internal.SSLReadServiceContext$SSLReadCompletedCallback.complete(SSLReadServiceContext.java:1777)
        at com.ibm.ws.tcpchannel.internal.WorkQueueManager.requestComplete(WorkQueueManager.java:504)
        at com.ibm.ws.tcpchannel.internal.WorkQueueManager.attemptIO(WorkQueueManager.java:574)
        at com.ibm.ws.tcpchannel.internal.WorkQueueManager.workerRun(WorkQueueManager.java:929)
        at com.ibm.ws.tcpchannel.internal.WorkQueueManager$Worker.run(WorkQueueManager.java:1018)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
    Caused by: net.sourceforge.stripes.exception.StripesServletException: Could not instantiate specified Configuration. Class name specified was [net.sourceforge.stripes.config.RuntimeConfiguration].
        at net.sourceforge.stripes.controller.StripesFilter.createConfiguration(StripesFilter.java:145)
        at net.sourceforge.stripes.controller.StripesFilter.init(StripesFilter.java:103)
        at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.init(FilterInstanceWrapper.java:149)
        ... 26 more
    Caused by: net.sourceforge.stripes.exception.StripesRuntimeException: Problem instantiating default configuration objects.
        at net.sourceforge.stripes.config.DefaultConfiguration.init(DefaultConfiguration.java:245)
        at net.sourceforge.stripes.config.RuntimeConfiguration.init(RuntimeConfiguration.java:291)
        at net.sourceforge.stripes.controller.StripesFilter.createConfiguration(StripesFilter.java:137)
        ... 28 more
    Caused by: java.lang.NullPointerException
    [5/9/16 21:59:39:813 CEST] 00000079 com.ibm.ws.webcontainer.filter                               E SRVE0321E: The [StripesFilter] filter did not load during start up.
    javax.servlet.ServletException: Filter [StripesFilter]: could not be initialized
        at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.init(FilterInstanceWrapper.java:163)
        at com.ibm.ws.webcontainer.filter.WebAppFilterManager._loadFilter(WebAppFilterManager.java:655)
        at com.ibm.ws.webcontainer.filter.WebAppFilterManager.loadFilter(WebAppFilterManager.java:518)
        at com.ibm.ws.webcontainer.filter.WebAppFilterManager.init(WebAppFilterManager.java:246)
        at com.ibm.ws.webcontainer.osgi.webapp.WebApp.initializeFilterManager(WebApp.java:854)
        at com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinally(WebApp.java:1164)
        at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:1053)
        at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:6463)
        at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.startWebApp(DynamicVirtualHost.java:446)
        at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.createRunnableHandler(DynamicVirtualHost.java:248)
        at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.createRunnableHandler(DynamicVirtualHost.java:313)
        at com.ibm.ws.http.internal.VirtualHostImpl.discriminate(VirtualHostImpl.java:251)
        at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink.ready(HttpDispatcherLink.java:306)
        at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:471)
        at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleNewRequest(HttpInboundLink.java:405)
        at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.processRequest(HttpInboundLink.java:285)
        at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.ready(HttpInboundLink.java:256)
        at com.ibm.ws.channel.ssl.internal.SSLConnectionLink.determineNextChannel(SSLConnectionLink.java:1037)
        at com.ibm.ws.channel.ssl.internal.SSLConnectionLink$MyReadCompletedCallback.complete(SSLConnectionLink.java:626)
        at com.ibm.ws.channel.ssl.internal.SSLReadServiceContext$SSLReadCompletedCallback.complete(SSLReadServiceContext.java:1777)
        at com.ibm.ws.tcpchannel.internal.WorkQueueManager.requestComplete(WorkQueueManager.java:504)
        at com.ibm.ws.tcpchannel.internal.WorkQueueManager.attemptIO(WorkQueueManager.java:574)
        at com.ibm.ws.tcpchannel.internal.WorkQueueManager.workerRun(WorkQueueManager.java:929)
        at com.ibm.ws.tcpchannel.internal.WorkQueueManager$Worker.run(WorkQueueManager.java:1018)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
    Caused by: net.sourceforge.stripes.exception.StripesServletException: Could not instantiate specified Configuration. Class name specified was [net.sourceforge.stripes.config.RuntimeConfiguration].
        at net.sourceforge.stripes.controller.StripesFilter.createConfiguration(StripesFilter.java:145)
        at net.sourceforge.stripes.controller.StripesFilter.init(StripesFilter.java:103)
        at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.init(FilterInstanceWrapper.java:149)
        ... 26 more
    Caused by: net.sourceforge.stripes.exception.StripesRuntimeException: Problem instantiating default configuration objects.
        at net.sourceforge.stripes.config.DefaultConfiguration.init(DefaultConfiguration.java:245)
        at net.sourceforge.stripes.config.RuntimeConfiguration.init(RuntimeConfiguration.java:291)
        at net.sourceforge.stripes.controller.StripesFilter.createConfiguration(StripesFilter.java:137)
        ... 28 more
    Caused by: java.lang.NullPointerException

Web.xml:

    [...]
    <filter>
        <display-name>Stripes Filter</display-name>
        <filter-name>StripesFilter</filter-name>
        <filter-class>net.sourceforge.stripes.controller.StripesFilter</filter-class>

        <init-param>
            <param-name>ActionResolver.Packages</param-name>
            <param-value>de.fom.skillDB.war.actionbeans</param-value>
        </init-param>
    </filter>

    <filter-mapping>
        <filter-name>StripesFilter</filter-name>
        <url-pattern>*.jsp</url-pattern>
        <dispatcher>REQUEST</dispatcher>
    </filter-mapping>

    <filter-mapping>
        <filter-name>StripesFilter</filter-name>
        <servlet-name>StripesDispatcher</servlet-name>
        <dispatcher>REQUEST</dispatcher>
    </filter-mapping>

    <servlet>
        <servlet-name>StripesDispatcher</servlet-name>
        <servlet-class>net.sourceforge.stripes.controller.DispatcherServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>StripesDispatcher</servlet-name>
        <url-pattern>*.action</url-pattern>
    </servlet-mapping>

Server.xml(including all WebSphere features):

    <feature>appSecurity-2.0</feature>
    <feature>servlet-3.1</feature>
    <feature>jaxrs-2.0</feature>
    <feature>localConnector-1.0</feature>
    <feature>jdbc-4.1</feature>
    <feature>jpa-2.1</feature>
    <feature>jsp-2.3</feature>
    <feature>ejb-3.2</feature>
    <feature>ejbRemote-3.2</feature>

TestActionBean.java:

    package de.fom.skillDB.war.actionbeans;

    import net.sourceforge.stripes.action.ActionBeanContext;
    import net.sourceforge.stripes.action.DefaultHandler;
    import net.sourceforge.stripes.action.ForwardResolution;
    import net.sourceforge.stripes.action.Resolution;
    import net.sourceforge.stripes.action.UrlBinding;

    @UrlBinding("/example/")
    public class TestActionBean {

        protected ActionBeanContext context;

        protected String title = "Titel";

        public ActionBeanContext getContext() {
            return context;
        }

        public void setContext(ActionBeanContext context) {
            this.context = context;
        }

        public String getTitle() {
            return title;
        }

        public void setTitle(String title) {
            this.title = title;
        }

        @DefaultHandler
        public Resolution view() {
            return new ForwardResolution( "/index.jsp" );
        }
    }

Thank you in advance! 👍
Niklas

@NiklasA
Copy link
Author

NiklasA commented May 9, 2016

Hi,

I changed my web.xml to:

    <filter>
        <display-name>Stripes Filter</display-name>
        <filter-name>StripesFilter</filter-name>
        <filter-class>net.sourceforge.stripes.controller.StripesFilter</filter-class>

        <init-param>
            <param-name>ActionResolver.Packages</param-name>
            <param-value>de.fom.skillDB.war.actionbeans</param-value>
        </init-param>
    </filter>

    <filter>
        <description>Dynamically maps URLs to ActionBeans.</description>
        <display-name>Stripes Dynamic Mapping Filter</display-name>
        <filter-name>DynamicMappingFilter</filter-name>
        <filter-class>net.sourceforge.stripes.controller.DynamicMappingFilter</filter-class>
    </filter>

    <filter-mapping>
        <filter-name>DynamicMappingFilter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
    </filter-mapping>

    <filter-mapping>
        <filter-name>StripesFilter</filter-name>
        <url-pattern>*.jsp</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
    </filter-mapping>

    <filter-mapping>
        <filter-name>StripesFilter</filter-name>
        <servlet-name>StripesDispatcher</servlet-name>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
    </filter-mapping>

    <servlet>
        <servlet-name>StripesDispatcher</servlet-name>
        <servlet-class>net.sourceforge.stripes.controller.DispatcherServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>StripesDispatcher</servlet-name>
        <url-pattern>*.action</url-pattern>
    </servlet-mapping>

But now I will getting all the time: Error 404: SRVE0295E: Error reported: 404, when I am trying to open the following site https://localhost/<ctx_root>/example/.

@rgrashel
Copy link
Member

Hi Niklas, were you able to get Stripes running on Websphere 8.5? If not, I can download it and give it a try to see if I can get it going.

-- Rick

@vankeisb
Copy link
Member

We have a JIRA issue for this one I think :

https://stripesframework.atlassian.net/browse/STS-922

@NiklasA
Copy link
Author

NiklasA commented Aug 21, 2016

Hi Rick,

no, I was not able to get Stripes running with a current IBM WebSphere Liberty version. I tested Stripes with serveral versions of WebSphere Application Server (8.5.5.4, *.7 and *.9).

@vankeisb:
Yes, you could be right Bluemix uses a similar WebSphere Liberty version.

@rgrashel:
Do you need any help to reproduce this issue? Then i would create a test project (Maven / EAR-File).

Thank you in advance.
Niklas

@vankeisb
Copy link
Member

That's a VFS issue. In short, Stripes has a pluggable way of scanning the classpath, called VFS. This allows to discover your @ActionBeans etc. (see ResolverUtil). VFSs are provided for some ASs (Tomcat, JBoss, etc), but not all of them.

Unfortunately, we have no VFS for liberty.

@rgrashel I should be able to find the code that I wrote in order to leverage Servlet 3+ API class discovery. I think it should be checked in, in order to workaround issues like this one. It's much simpler than to write a VFS, and I still think it should be the standard, since it's built-in the Servlet spec. So if you have a servlet 3+ container, you should not be concerned about this VFS thing. VFS should be kept only for Mock testing IMHO.

@rgrashel
Copy link
Member

Hi Niklas,

If you have an EAR file that you could provide, that would be hugely
helpful. Thanks.

-- Rick

On Sun, Aug 21, 2016 at 5:46 AM, NiklasA [email protected] wrote:

Hi Rick,

no, I was not able to get Stripes running with a current IBM WebSphere
Liberty version. I tested Stripes with serveral versions of WebSphere
Application Server (8.5.5.4, *.7 and *.9).

@vankeisb https://github.com/vankeisb:
Yes, you could be right Bluemix uses a similar WebSphere Liberty version.

@rgrashel https://github.com/rgrashel:
Do you need any help to reproduce this issue? Then i would create a test
project (Maven / EAR-File).

Thank you in advance.
Niklas


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#57 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AEv4H_liy-R1lOZMqW2dYsbyMnqS1w4_ks5qiCx9gaJpZM4IafIm
.

@NiklasA
Copy link
Author

NiklasA commented Aug 28, 2016

Hi Rick,

sorry, for the late response. I uploaded a war file here: Link.

I used the following AppServer: WebSphere Liberty Profile

If you need further help, please let me know.

Niklas

@rgrashel
Copy link
Member

Niklas,

I just installed the latest version of Liberty (16.0.0.3) with Java EE 7 Web Profile. Running on JDK1.8. I dropped your WAR right in the defaultServer/dropins directory and got no errors. I even pulled up the test helloworld page at http://localhost:9080/test.

Then, I went ahead and built the Stripes Examples WAR file from master and copied that into the defaultServer/dropins directory. That also deployed successfully. There are a couple of bugs because of relative pathing, but you can hit http://localhost:9080/stripes-examples/rockandroll/artists and get a JSON response from a RestActionBean.

Is there something I am not doing to duplicate the error you are getting?

-- Rick

@NiklasA
Copy link
Author

NiklasA commented Sep 21, 2016

Hi Rick,

sorry, the issue was that I could not call http(s)://localhost:9080/test**/example/**. But you gave me the right hint with the Stripes examples. I compared both web.xml files and I was able to get it running (Commit).

But I am wondering, because I'm pretty sure that I have tried the DynamicMappingFilter in same way earlier and it did not work. And in the log the warning is still thrown "[WARNING ] No MultipartWrapper implementation could be loaded".

That's why I looked again at the JIRA ticket, which @vankeisb has mentioned. And then I remembered that I used a Multi-Module Maven Project, where the WAR file includes the Stripes staff and was packaged to an EAR file. Perhaps the problem can only be reproduced in this way.

Niklas

@NiklasA
Copy link
Author

NiklasA commented Sep 27, 2016

Hi Rick,

because I could not reproduced the issue with a single WAR file, I have expanded my test project and created a Multiple Module Maven project. With it, I was able to reproduce the issue. Sorry that it takes so long and the ticket gets longer and longer...

Steps:

  1. Download the files from Link
  2. After you add war file to WebSphere Liberty Profile and tried to open the application on http(s)://{DOMAIN}:{PORT}/LibertyWAR/example/, you will get an error "The [StripesFilter] filter did not load during start up." in log file.

I hope you can use my test project to investigate the issue and I hope too that is not an issue of misconfiguration on my side and I wasted your time ;-).

Thank you in advance.
Niklas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants