IBM Liberty Profile: The feature 'websocket-1.0' is not recognized - websocket

Just an initial step to run websocket application on IBM Liberty Profile 8.5.5.5. After did lots of research I found I needed to add a feature on the Liberty server.xml file.
<featureManager>
<feature>websocket-1.0</feature>
.......
</featureManager>
But as soon as I added that line on the configuration I'm getting a warning that
The feature 'websocket-1.0' is not recognized
server.xml /WebSphere Application Server V8.5 Liberty Profile/servers/defaultServer
line 5 Liberty Profile Configuration Problem
Any thought? Do I needed to add any Jar file for that?

In the 8.5.5.5 or earlier websocket feature is not contained in the downloaded jar. You have to install it from the repository using the following command:
featureManager install websocket-1.0 --when-file-exists=ignore
see the following page - Java WebSocket 1.0.
The 8.5.5.6 version is Java EE 7 compatible and contains webSocket-1.1 feature already built in, so you may download that one.

The feature files are in [Liberty Install]/lib/features folder.
However, I don't see websocket-1.0 or websocket-1.1 in Liberty 8.5.5.5
Try to use 8.5.5.6, you should see websocket-1.1.mf

For OpenLiberty navigate to [OpenLiberty Install]/bin via shell and execute:
featureUtility installFeature websocket-1.0 --acceptLicense
This will install the missing feature to the folder [OpenLiberty Install]/lib/features.

Related

wasJmsClient not supported in websphere 8.5 liberty profile

I'm having trouble deploying an EAR project on liberty profile locally integrated in eclipse kepler. It comes back with the following error:
Application 'App-Name' requires feature wasJmsClient,
which is not supported by WebSphere Application Server V8.5 liberty profile.
Reason:
Application 'App-Name' requires feature wasJmsClient,
which is not supported by WebSphere Application Server V8.5 liberty profile.
I've read up on IBM documentation which indicates that you need to add suppport to this feature in your server.xml. I have done this, to no evail.
The Liberty profile comes distributed as two jar files, a runtime jar, and an optional extended jar. If you want to use JMS you need to also install the extended jar. Based on the information in the question this might be missing. You can download both the runtime and extended jar from wasdev.net.
You can check to see if the wasJmsClient and wasJmsServer features is installed by running
:
productInfo featureInfo
command found in the wlp/bin folder.
Its simple. Get wlp-extended jar from this link and install it from command prompt as admin.
https://developer.ibm.com/wasdev/downloads/#asset/addons-8.5.5-wlp-extended
Install it just by running the following command from wlp/bin folder:
java -jar wlp-extended.jar
It just prompts for license and its quite interactive.I think its good to go from there. it will install all the webprofile tools.
To recheck that
you can execute the following command from wlp/bin:
productInfo featureInfo
You can use IBM Install Utility (installUtility) inside serverRoot/bin folder to download the required feature:
C:\your\server\path\bin>installUtility install wasJmsClient-2.0
then add it to the server.xml
<featureManager>
<feature>webProfile-8.0</feature>
<feature>localConnector-1.0</feature>
<feature>wasJmsClient-2.0</feature>
</featureManager>

Websphere application server for developers linux command line install

I tried to install websphere application server for developer v8.5. I've already installed the installation manager. Then I download the image from here: all the three parts of WebSphere Application Server for Developers, Installation Manager Repository. Cause my linux has no GUI, so I unzipped the file and tried to use installation manager to install it.
I used :
./imcl listAvailablePackages -repositories /home/user/tmp/wasdev_installer/repository.config to verify that the package exist.
Then I ran : ./imcl install com.ibm.websphere.DEVELOPERSILAN.v85_8.5.5000.20130514_1044 -repositories /home/user/tmp/wasdev_installer/repository.config -installationDirectory /home/user/Websphere_v85 -accessRights nonAdmin -acceptLicense
But I always got errors like :
ERROR: The silent installation process does not support
installing packages that are contained on multiple media discs.
CRIMC1017E ERROR: Failed to locate zip com.ibm.websphere.batch_136_all.all 8.5.5000.201305110146.
Cannot find the table of contents file for an artifact in the repository. Table of contents files are located under the atoc directory in the repository.
If the repository files were transferred from a different location, verify that the files were not altered during the transfer operation. Copy the repository files to a different location and install from that location.
I re-unzipped the file, but didn't help. Was I doing wrong? Thanks for your help.
Deepending on what programming models you're using, you could always try the WebSphe Liberty Profile artefact install: https://www.ibmdw.net/wasdev/downloads/. It doesn't support every programming model that the full profile does, but it's a super-easy install, and easy to get going with as a development environment.
I resolved this issue by unzipping all files to one directory. The file part1 contains disk1, so the other files should be put under the directory of part1, which means in the same level of disk1 directory.
If you do not want to bother with downloading and decompressing archives containing the Installation Manager repositories, then there is a much easier and simpler process for getting WebSphere Application Server for Developers installed.
Once you have IBM Installation Manager installed, you only need to provide the repository location to where the IBM hosted WebSphere Application Server for Developers repository is located. For instance, to install WAS for Developers version 8.0 or version 8.5, you simply add one of the repository locations to the repository preferences.
V8.0: http://www.ibm.com/software/repositorymanager/V8WASDeveloperILAN
V8.5: http://www.ibm.com/software/repositorymanager/V85WASDeveloperILAN
Instructions for installing WAS for Developers using IBM hosted repositories in available on WASDev.net.
You could even use the IBM hosted repositories in your command line installation or response file installation, as long as you create a secure storage file with you MY IBM ID credentials for authenticating with the IBM servers, as described in the WebSphere Knowledge Center.
Alternatively, you can use the IBM Package Utility (a companion to Installation Manager), to reconstruct the IBM hosted repository on your local machine. The advantage to using PU is that you will be able to create a local repository that also includes the fixpack level of your own choosing rather than having to go get a fixpack from IBM Fix Central and then updating the installation afterwards.
Information on creating local repositories with Packaging Utility is available in the WebSphere Knowledge Center.

Activate Maven profile based software package installed on deploy server

I am using Maven 2.2.1 for building and deploying an application.
I am having a requirement like, if the application is to be deployed on the server it should check whether the server into which the application is to be deployed is installed in the system. If the server is not installed then it should skip all the remaining processes and exit the build process.
Can I do this using profiles?
Yes, you can do this by activating the profile by the presence of a file. Since your requirement is that the "application is installed on the system" then you can look for a file known to be used by that server software.
For example, if I wanted to activate a profile if WebSphere MQ is installed on a server, I could activate the profile as follows
<file>
<exists>/opt/mqm/java/lib/com.ibm.mq.jar</exists>
</file>
Note, this only works if the server software is always installed in the same location.
Reference: http://www.sonatype.com/books/mvnref-book/reference/profiles-sect-activation.html

"PWC6345: There is an error in invoking javac." error when using Jetty WTP plugin to deploy a JSP page on Jetty

I'm trying to deploy a JSP-page on Jetty, using the Jetty WTP plugin for Eclipse. But I get the error below. It looks like Jetty can't find javac. Is there any settings I have to do for the Jetty WTP plugin in Eclipse or how do I fix this?
The JSP page works fine if I export my project as a .war-file to jetty\webapps and then start Jetty manually using java -jar start.jar. But it doesn't work if I deploy using the Jetty WTP plugin for Eclipse as described.
I have my JAVA_HOME set to C:\Program Files (x86)\Java\jdk1.7.0_01 and I use Jetty 8.0.4 on Windows 7.
Servlets is working fine with the current setup. Any suggestions on how to solve this for JSP pages?
HTTP ERROR 500
Problem accessing /MyJavaWeb/formProcess. Reason:
PWC6345: There is an error in invoking javac. A full JDK (not just JRE) is required
Caused by:
org.apache.jasper.JasperException: PWC6345: There is an error in invoking javac. A full JDK (not just JRE) is required
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:92)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:378)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:119)
at org.apache.jasper.compiler.Jsr199JavaCompiler.compile(Jsr199JavaCompiler.java:208)
at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:384)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:453)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:625)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:492)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:378)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:558)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:488)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:520)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:233)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:973)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:417)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:907)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:271)
at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:98)
at com.example.FormProcessServlet.doPost(FormProcessServlet.java:39)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:558)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:488)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:483)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:233)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:973)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:417)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:907)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
at org.eclipse.jetty.server.Server.handle(Server.java:346)
at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:442)
at org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:941)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:801)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:224)
at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)
at java.lang.Thread.run(Unknown Source)
As Jan Bartel suggested, from Jetty: How to configure JSP:
by adding the line below in the start.ini-file in Eclipse, it works fine.
-Dorg.apache.jasper.compiler.disablejsr199=true
I too happened to suddenly get the org.apache.jasper.JasperException: PWC6345 with my Eclipse installation and the Jetty Maven Plugin (which I use to start up Jetty from within Eclipse).
The reason was that I updated my JDK installation shortly before. Inside Eclipse, this caused to change the "Installed JRE" to point to a plain JRE installation instead of a full-fledged JDK installation. A JDK installation is needed for Jasper, as Jasper needs javac (which is not provided by JRE).
In my case, the solution was to provide Eclipse with the JDK installation. To do so, select Window -> Preferences -> Java -> Installed JREs. Here, click Add..., then point to your JDK installation (in my case, JRE home should point to C:\Program Files (x86)\Java\jdk1.7.0_17). Click Finish. Then back in the Installed JREs overview, remove the old JRE reference and select the newly added JDK installation.
I got the PWC6345 error when running a webapp with Run-Jetty-Run plugin.
The fix was to change the Execution environments settings in Preferences.
Since I'm using java 7 I needed to change the setting for JavaSE-1.7.
Probably other execution environments will behave similarly.
Window -> Preferences -> Java -> Installed JREs -> Execution environments
Select JavaSE-1.7 on the left -> pick the *jdk*1.7.x_xx on the right hand side
Ok, solved this after a lot of searching around.
Download any jdk and point JAVA_HOME to this jdk.
Inside this jdk folder you will find ./bin and ./jre/bin
Copy the javac from ./bin and paste it in ./jre/bin [remember copy not cut]
Now in eclipse, Run->External-Tools->External-Tools-Configurations, select the build.xml for of your project in the left pane and click on the JRE tab in the right pane.
Click on installed JREs and add the jdk in the previous step.
Once done, select this new JRE (jdk1.6.0_31) as the 'Separate JRE', click on apply at the bottom and run.
This assumes you are doing a jetty:run using ant on eclipse.
Strange because this thread suggests:
The solution was to install the package jdk7-openjdk.
Perhaps this should be added to the list of dependencies (or maybe for jetty, and not solr itself)?
But that doesn't help much on Windows, where the binary for openjdk7 aren't easily available.
(In "OpenJDK availability for Windows OS" comments, eckes mentions having found some openjdk binaries for Windows, as part of the Build b146. However, said releases aren't maintained any more)
The bug report filled by the OP Jonas is closed with a simple reference to the Eclipse wiki page "Jetty/Howto/Configure JSP".
You have planty solutions guys but I thought that it exist a solution better than fix the start.ini
I lived the same problem and then I realize that it may be because I did have a JDK7 for 64bit while I should have a JDK7 for 32.
So I fixed my problem by downloading and use the JDK7 for 32Bit.
Also, you would still need to
Use the JDK and not the JRE
Set your JAVA_HOME
I am running on Windows by the way ...
I have the same problem. When I run where java, the output is:
C:\Windows\System32\java.exe
D:\Program Files\Java\jdk1.7.0_25\bin\java.exe
Of course the first one is incorrect. So my problem lies in the PATH. I can rectify this by either removing the java.exe in the directory C:\Windows\System32\ because I'm sure it's useless, or putting the second entry in front of the first one.
So When encountering this problem, please check your PATH for the jdk. I hope that my problem and my solution is helpful in some way.
I got the PWC6345 error when running jetty-runner 9.2.1 standalone from Windows 7 cmd (or batch file) with Oracle JDK 1.7.0_60, and none of the other suggestions in this or other forums worked. I'll leave my workaround here, in case it helps someone...
After installing the JDK, running 'where java' showed two different java.exe paths, the first being in the Windows system folder, and the second in the JDK folder (which is the one I added to the path manually). Both of these are actually installed by the same JDK installer. The java.exe in the system folder was taking precedence and causing the full JDK to go undetected.
Placing the JDK bin folder (e.g. "C:\Program Files\java\jdk1.7.0_60\bin") on the path before the other system paths fixed the issue.
In addition to updating the JAVA_HOME (see above)...
If you're encountering this error from command line (e.g. starting Jetty server from dos window), check where windows is finding the java.exe:
where java
If windows comes back with a path showing to your jre, then check your PATH. Chances are the %PATH% contains a path pointing to the jre instead of jdk.
if you set environment variable JRE_HOME , please unset or delete it
and start server again .
In liferay 7 : I got this error fixed by changing the runtime environment of the server from jre to jre with jdk
I got this error when deploy war package to our server.
My deploy command is (applied web container you may find):
java -jar jetty-runner.jar --port 8020 xx.war
I write this answer because it confused me almost one day. I tried some methods above but failed.
Finally I found there is only jre on my servers but not full jdk.
$ls /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.131-2.b11.el7_3.x86_64
jre
I fix it with searching available jdk and install one.
$yum search java | grep 'java-'
$sudo yum install java-1.8.0-openjdk-devel.x86_64
(Notice the -devel)
I added this line to 'eclipse.ini' file which is present inside eclipse folder.
-vm
C:\Program Files\Java\jdk1.8.0_131\bin\javaw.exe
and I also change the JRE path in eclipse
windows -> preferences -> java -> Installed JREs
and provided path upto jdk
C:\Program Files\Java\jdk1.8.0_131
I spent good amount of time on this issue, but it turned out to be very simple. All you have to do is:
choose the JDK instead of JRE while configuring the server runtime!
It worked like a champ, I had this issue with glassFish 4.0

JDBC Driver class not found: oracle.jdbc.OracleDriver

I have installed a third party java webservice which uses Oralce jdbc thin driver to write data into Oracle database. When i run this, i get the following error;
JDBC Driver class not found: oracle.jdbc.OracleDriver
I have oracle installed and set classpath variable to following value:
*D:\oracle\product\10.2.0\client_1\jdbc\lib\classes12.jar;D:\oracle\product\10.2.0\client_1\jdbc\lib\classes12.zip;D:\oracle\product\10.2.0\client_1\jdbc\lib\ojdbc14.jar;D:\oracle\product\10.2.0\client_1\jdbc\lib\ojdbc14.zip;C:\Program Files\Java\jdk1.7.0\jre\lib\rt.jar*
and path variable to following value;
*D:\oracle\product\10.2.0\client_1\bin;C:\Program Files\Java\jdk1.7.0\bin\;D:\oracle\product\10.2.0\client_1\jdbc\lib\classes12.jar;D:\oracle\product\10.2.0\client_1\jdbc\lib\classes12.zip;D:\oracle\product\10.2.0\client_1\jdbc\lib\ojdbc14.jar;D:\oracle\product\10.2.0\client_1\jdbc\lib\ojdbc14.zip*
Any suggestion why web service is not able to identify jdbc driver?
Thanks
I know 2 ways of turning Java app into Windows service and both do not use CLASSPATH. One is Java Service Wrapper by Tanuki Software. This tool uses wrapper.conf where you can show directories with .jar libraries:
# Java Classpath (include wrapper.jar) Add class path elements as
# needed starting from 1
wrapper.java.classpath.1=c:\jars\*
wrapper.java.classpath.2=myservice.jar
Second tool I know is JSL: Java Service Launcher. In this tool there is jsl.ini where you put command line to run your server. It can use java with -cp option to show location of .jar libraries:
[defines]
MY_LIBS=d:\jars\*
AXIS_LIBS=d:\axis2-1.5.4\lib\*
CLASSPATH=.;%MY_LIBS%;%AXIS_LIBS%
export = CLASSPATH
...
[java]
...
cmdline = -Dfile.encoding=utf8 -cp %CLASSPATH% example.my.server
In both configuration you can use * to add all .jar files or you can show those files one by one (just like in CLASSPATH).
At first you should know what Windows is trying to execute. Check it in the service properties page. Then try to localize its configuration. If it uses one of tools I know then you know what to change. Other tools probably have similar configuration.
Method 1:
Download ojdbc.jar
add ojdbc6.jar to deployment assembly.
Right click on project->properties->select deployment assembly->click on 'Add'
->select 'Archives from File System'->browse to the folder where ojdbc6.jar is saved.->add the jar->click finish->Apply/OK.
Method 2:
if you want to add ojdbc.jar to your maven dependencies you follow this link:
http://www.mkyong.com/maven/how-to-add-oracle-jdbc-driver-in-your-maven-local-repository/
.
.
Even if you're using a maven project it is not necessary to add ojdbc to maven dependencies(method 2), method 1 (adding directly to deployment assembly) works just fine.
Make sure you have the ojdbc jar file (make sure you are using the correct one because depending on java version you may need to choose a different one).
use ojdbc14.jar for Java 1.4
use ojdbc5.jar for Java 1.5
ojdbc6.jar for Java 1.6
here is linke where you can download ojdbc6.jar file
http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-112010-090769.html
You also have to add the jdbc jar to your server classpath. if tomcat, rigth-click on your Project->run as->run configurations, click on classpath and add your jdbc jar in Add external jars option
add ojdbc-6.jar to your lib directory of tomcat installation. Maven will downlowd this jar for you in .m2 directory, but you need to have this jar in tomcat lib as well.

Resources