Unable to add static content to Websphere Liberty profile Server


I am using the WAS Liberty Profile Server and trying to configure the deployment to add a war artifact and also deploy some static content in the server.
I've tried various methods to do this but no success yet. I haven't found any guide on how to do this so have turned to forums.

I've tried the following:

1. define static folder as a webapp in project structure and add to deployment as an artifact
result:It was not possible to infer the application type for application staticFolderName from the location pathToStaticFolder

2. in server configuration under deployment tab added External Source

result:It was not possible to infer the application type for application staticFolderName from the location pathToStaticFolder

Both methods throw following exception.

[err] Exception in thread "Default Executor-thread-5"
[err] java.lang.NullPointerException
[err]  at java.util.Hashtable.put(Hashtable.java:553)
[err]  at com.ibm.ws.app.manager.internal.ApplicationConfig.getServiceProperties(ApplicationConfig.java:108)
[err]  at com.ibm.ws.app.manager.internal.ApplicationConfigurator$NamedApplication.register(ApplicationConfigurator.java:215)
[err]  at com.ibm.ws.app.manager.internal.ApplicationConfigurator$NamedApplication.switchApplicationState(ApplicationConfigurator.java:263)
[err]  at com.ibm.ws.app.manager.internal.statemachine.ApplicationStateMachineImpl.enterState(ApplicationStateMachineImpl.java:1084)
[err]  at com.ibm.ws.app.manager.internal.statemachine.ApplicationStateMachineImpl.performAction(ApplicationStateMachineImpl.java:1012)
[err]  at com.ibm.ws.app.manager.internal.statemachine.ApplicationStateMachineImpl.run(ApplicationStateMachineImpl.java:787)
[err]  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1156)
[err]  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:626)
[err]  at java.lang.Thread.run(Thread.java:780)

I'm evaluating Intellij here at work and this is an important feature I need to help my case.

thanks in advance

Comment actions Permalink

I'm not sure what is the structure of your deployment.
IDEA expects any content (including the static one) to be wrapped into the artifact (WAR artifact in your case).

Please post a screenshot of the artifact structure (for your case 1) or provide minimal sample reproducing the issue.
Comment actions Permalink


thanks for the reply. I've started in a new company and don't have authority to change project structure (yet!) so have to work with what I have. They currently have a lot of static content that is hosted on the file system locally. I want to reference this in Liberty Profile server.

When done in eclipse, entries in the liberty profile server.xml are correctly created for the war and the static content as follows:

<webApplication contextRoot="/" location="{pathToStaticContent}" name="staticStuff"/>

<webApplication contextRoot="xxx" id="mywebapp" location="mywebapp.war" name="mywebapp"/>


Trying to add the static content by creating a deployable artifact ( from my 1. suggestion above) here is the screenshot for what I'm trying to do.



Comment actions Permalink
Please try to add static content resources as describe here:
If you have permission to change project structure -- look at:
And note that during the deploy process, by default, the resources are copied into the root of the output directory. 
Hope that helps
Comment actions Permalink


I just saw this post, I work for IBM on WAS Liberty, that NPE looks strange to me. What version of WAS Liberty are you using?

Comment actions Permalink


I have the same issue. I am using Websphere Liberty

BR /Lasse

Comment actions Permalink

@Lasse can you provide the server configuration you are using?


Please sign in to leave a comment.