Quantcast
Channel: A Portal to a Portal
Viewing all articles
Browse latest Browse all 1850

Down the rabbit hole - Fun with Dynamic Web Module version 4.0 and Eclipse and WebSphere Liberty Profile

$
0
0
I’m using Eclipse



and WebSphere Liberty Profile

~/wlp/bin/server version
WebSphere Application Server 17.0.0.4 (1.0.19.201712061531) on Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_181-b13 (en_GB)
and attempting to deploy a Spring Boot application to the Eclipse runtime.

Alas, I see this: -



and, when I dig into the Eclipse project properties: -



In short, something is blocking me from uninstalling the Dynamic Web Module 4.0 facet.

The project came into life as a result of this tutorial: -


which described how to use the SprintSource Tool Suite (STS) plugin: -


to create a new Spring Starter Project: -


Amongst many other sources, this: -


namely to hack one of the metadata files within the Eclipse project.

Firstly, I looked for the relevant file: -

find ~/eclipse-workspace/ -name org.eclipse.wst.common.project.facet.core.xml

/Users/davidhay/eclipse-workspace//SpringBoot/.settings/org.eclipse.wst.common.project.facet.core.xml
/Users/davidhay/eclipse-workspace//Spring3MVC/.settings/org.eclipse.wst.common.project.facet.core.xml

and then edited it: -

vi /Users/davidhay/eclipse-workspace//SpringBoot/.settings/org.eclipse.wst.common.project.facet.core.xml

and then changed it from: -

 
to: -

 

and then refreshed the project: -


and cleaned the project: -



When I went back into the Project Facets: -


which was nice.

More importantly, it allowed me to actually remove the Dynamic Web Module facet: -


However, this removed my ability to deploy the project to the WebSphere Liberty Profile runtime.

When I re-ran the Maven -> Update Project task: -


the original facet returns: -


which gives me a clue…..


   
        jsp-2.3
        javaee-7.0
        appSecurity-2.0
        adminCenter-1.0
        localConnector-1.0
        transportSecurity-1.0
   
….

In other words, I’m trying to use a feature from Java Enterprise Edition 8 ( JEE8 ) whereas my Liberty runtime is only configured for JEE8.

I nuked the offending line: -

        javaee-7.0

and replaced it with: -

        javaee-8.0

which threw up: -

[ERROR   ] CWWKF0042E: A feature definition cannot  be found for the  javaee-8.0 feature.  Try running the command, bin/installUtility install javaee-8.0,  to install the feature. Alternatively, you can run the command, bin/installUtility install odm,  to install all features that are referenced by this configuration.
...

in the server’s console.log.

This was mitigated thusly: -

chmod +x ~/wlp/bin/installUtility

~/wlp/bin/installUtility install javaee-8.0

Establishing a connection to the configured repositories ...
This process might take several minutes to complete.

Successfully connected to all configured repositories.

Preparing assets for installation. This process might take several minutes to complete.

To be on the safe side, I stopped and started the WLP instance: -

~/wlp/bin/server stop odm

Stopping server odm.
Server odm stopped.

~/wlp/bin/server start odm

Starting server odm.
Server odm started with process ID 98748.

but I still saw this: -

[ERROR   ] CWWKF0042E: A feature definition cannot  be found for the  javaee-8.0 feature.  Try running the command, bin/installUtility install javaee-8.0,  to install the feature. Alternatively, you can run the command, bin/installUtility install odm,  to install all features that are referenced by this configuration.

and then another penny dropped…..

Let’s look at the version of Liberty again….

 ~/wlp/bin/server version

WebSphere Application Server 17.0.0.4 (1.0.19.201712061531) on Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_181-b13 (en_GB)

and then look at this: -


which is dated June 2018.

Yes, I’m trying to install a JEE8 application onto a 2017 version of WLP, which does NOT have the JEE8 support …

Can you say “Doofus” ??

I went here: -


and downloaded WLP EE 18.0.0.3, and extracted it over my existing WLP installation: -

cd ~
unzip ~/Downloads/wlp-javaee8-18.0.0.3.zip 

which now gives me this: -

 ~/wlp/bin/server version

WebSphere Application Server 18.0.0.3 (1.0.22.cl180320180905-2337) on Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_181-b13 (en_GB)

and used installUtility to “clean” up my configuration: -

~/wlp/bin/installUtility install odm

which resulted in: -

...
Checking for missing features required by the server ...
The server does not require any additional features.  No features were installed.

Start product validation...
Validating feature: com.ibm.websphere.appserver.internal.jaxrs-2.0... FAIL!
  [ERROR] Content: dev/api/ibm/javadoc/com.ibm.websphere.appserver.api.jaxrs20_1.0-javadoc.zip is either changed or broken.
  [ERROR] Content: bin/jaxrs/tools/wadl2java.jar is either changed or broken.
Validating feature: com.ibm.websphere.appserver.jaxrs.common-2.0... FAIL!
  [ERROR] Content: dev/api/ibm/javadoc/com.ibm.websphere.appserver.api.jaxrs20_1.0-javadoc.zip is either changed or broken.
  [ERROR] Content: bin/jaxrs/tools/wadl2java.jar is either changed or broken.
Validating feature: jsp-2.2... FAIL!
  [ERROR] Content: dev/spi/ibm/javadoc/com.ibm.websphere.appserver.spi.jsp_1.0-javadoc.zip is either changed or broken.
Validating feature: restConnector-1.0... FAIL!
  [ERROR] Content: clients/restConnector.jar is either changed or broken.
  [ERROR] Content: dev/spi/ibm/javadoc/com.ibm.websphere.appserver.spi.restHandler_2.0-javadoc.zip is either changed or broken.
  [ERROR] Content: dev/api/ibm/javadoc/com.ibm.websphere.appserver.api.restConnector_1.3-javadoc.zip is either changed or broken.
Validating feature: servlet-3.0... FAIL!
  [ERROR] Content: bin/tools/ws-webserverPluginutil.jar is either changed or broken.
  [ERROR] Content: dev/api/ibm/javadoc/com.ibm.websphere.appserver.api.servlet_1.1-javadoc.zip is either changed or broken.
Validating feature: servlet-3.1... FAIL!
  [ERROR] Content: bin/tools/ws-webserverPluginutil.jar is either changed or broken.
  [ERROR] Content: dev/api/ibm/javadoc/com.ibm.websphere.appserver.api.servlet_1.1-javadoc.zip is either changed or broken.
Validating feature: websocket-1.0... FAIL!
  [ERROR] Content: dev/api/ibm/javadoc/com.ibm.websphere.appserver.api.wsoc_1.0-javadoc.zip is either changed or broken.
Product validation was complete, and found 13 error(s).

This made me wonder whether a cleanup was in order: -


so I tried this: -

~/wlp/bin/server start odm —clean

but to no avail.

In the end, I updated the WebSphere Developer Tools tooling inside Eclipse: -


and had Eclipse create a new instance: -

~/wlp/bin/server list

The following servers are defined relative to the user directory /Users/davidhay/wlp/usr.

foobar
odm
wdt

Now, finally, I can deploy my Spring Boot application: -



The moral of the story ?

Get your bloomin' dependencies right !

Viewing all articles
Browse latest Browse all 1850

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>