Can not run jar file on websphere - java

I had problem with Websphere.
I want to run test.jar in websphere.
I copy test.jar in dropins and run "sh ./server start --archive="java -jar ../dropins/test.jar"
Starting server --> ok
But console.log empty

It's not clear from your description exactly what you're trying to do, but based on your title, I assume you're trying to run a Java application. Liberty is an app server for running Java EE apps, but given that you're trying to run a file ending in .jar, that is more typical of a standalone (Java SE) app. Also, the command line you're using is mixing options, the --archive option is for specifying a target file for the server package or dump operation. See the IBM help topic https://www.ibm.com/docs/en/was-liberty/base?topic=line-server-command-options for more details. On the Liberty app server, you can deploy Java EE (not Java SE) apps by copying the .ear or .war of the app to the dropins directory. If you provide additional details about the contents of test.jar and what you're trying to achieve, you'll get a more complete answer.

Related

How do I remove jar filename before endpoint's url?

When I compile my maven-based project I have the resulting jar file in 'target/my-application'. When I run locally my application (I use Payara Micro if this is important) I have the following in log:
Payara Micro URLs
http://localhost:8080/my-application-1.0-SNAPSHOT
How do I get rid of my-application-1.0-SNAPSHOT from URL address?
As per request, I'd say that:
What type of application is that? EAR/WAR?
war application (however, maven creates for me "payara-uber-jar"
and I run the application via java -jar filename.jar
What application server is it running on?
Payara micro
Are you using maven?
Yes, I am.
Hello according to Paraya documentation what you need to do is:
java -jar payara-micro.jar --deploy NAMETHATYOUWANT.war
And then the context path will be /NAMETHATYOUWANT
https://www.davidsalter.co.uk/payara-micro-context-path/

Why doesn't my JBoss AS bin directory contain a run.sh script?

I am running Ubuntu 16.04 and I need to install and run Restcomm JSS7 stack as a JBoss AS Service.
I followed this video tutorial to install JBoss AS 7. Then I set the JBOSS_HOME environment variable to installation directory of JBoss AS 7. As a result, I was able to start the JBoss AS successfully by executing ./run.sh in the bin sub-folder of the installation directory.
Then I followed this guide to install Restcomm JSS7 stack. For that, I downloaded restcomm-jss7-7.4.1404.zip, unzipped it to /opt/ and then navigated to the ss7-jboss sub-directory and then executed ant deploy,
and the result was
...
BUILD SUCCESSFUL
which according to the guide is an indication of the service deployed successfully.
Then I am following CHAPTER 4 SECTION 4.1 of this user manual to run it as a JBoss AS Service. According to it,
All you have to do to start the Service is start the JBoss AS. This
will automatically start the SS7 Service. To start the JBoss Server
you must execute the run.sh (Unix) or run.bat (Microsoft Windows)
startup script in the /bin folder (on Unix or
Windows).
TWO PROBLEMS:
My <jboss_install_directory>/bin does NOT have a run.sh script. Because of this reason, I tried by running JBoss AS by using the regular standalone.sh script.
Next in the user manual, it is stated:
Result: If the service started properly you should see following lines
in the Unix terminal or Command Prompt depending on your environment:
(Note: I have pasted the following excerpt from user manual here, since it is too long to paste in this question.)
But I see none of those lines in my terminal. Rather, my terminal output of running ./standalone.sh is pasted here.
So I don't know how and where to proceed from here. Please help.
NOTE: This question is NOT a duplicate of my other question. Like I mentioned in the question titles, this question is about why my JBoss AS installation doesn't contain a run.sh script, and what would be its alternative. The other question is about some possible command to find out the JBoss Services started when it is running? When a beginner is starting to learn something, their entire purpose Not getting the job done. They have many confusions/questions in their mind.
The documentation documents how to start a JBoss 5.1 server but your installation uses a JBoss 7.1 server, which is why you have to use standalone.sh instead of run.sh to start the server and why the logs are different.
Since you correctly reach the JBoss AS 7.1.0.Final "Thunder" started in 3955ms line I wouldn't worry too much (except about using a documentation that is clearly outdated).
The documentation of your product only declares compatibility with JBoss 5.1.0. While it may work on later releases, you might want to check if there's a more recent version of your product. I wouldn't recommend installing JBoss AS 5.1.0 as it isn't supported anymore and will contain security breaches.

java missing class when supervisor running process but not when running as www-data user

I've made my first clojure app and I've built it with leiningen by running lein ring uberjar. I can run this on my dev machine (fedora 23) and I can run this on my ubuntu production machine java -jar tomahawk.jar. I've followed the digital ocean tutorial here that describes how to set up the environment. My supervisor conf is the following:
[program:tomahawk]
environment=TOMAHAWK_DB=$TOMAHAWK_DB
command=/usr/lib/jvm/java-1.7.0-openjdk-amd64/bin/java -jar tomahawk.jar
logfile=/tmp/supervisord.log
directory=/var/www/tomahawk/app
user=www-data
autostart=true
autorestart=true
startretries=3
redirect_stderr=true
stdout_logfile=/var/www/logs/tomahawk.app.log
However, when using this through nginx, i get the error
2016-03-19 23:34:08.594:WARN:oejs.AbstractHttpConnection:/
java.sql.SQLException: No suitable driver found for jdbc:sqlserver:$
at java.sql.DriverManager.getConnection(DriverManager.java:596)
at java.sql.DriverManager.getConnection(DriverManager.java:187)
at clojure.java.jdbc$get_connection.invoke(jdbc.clj:255)
This comes from the com.microsoft.sqldbc4.jar file. However, I can run this standalone jar file, as well as I can run sudo -u www-data env TOMAHAWK_DB=$TOMAHAWK_DB java -jar tomahawk.jar just fine. Also, while this is running, I can hit it through the nginx reverse proxy.
I've searched around and found an unanswered email on the supervisor mailing list from 2011. Why can I only sometimes see the missing jar file?
I've tried putting it inside of the /usr/lib/jvm/.../lib/ext location for my jvm, bundled inside of the jar file, running from Tomcat, etc. I've made an upstart script as well with identical results as well. I am not sure what other paths I can try and was wondering if anyone had any insights.

Can a java .war file contain a webserver

I'm looking into installing Jenkins, in the instructions it says
"Easy installation: Just java -jar jenkins.war, or deploy it in a
servlet container. No additional install, no database."
I understand the servlet container method, but does the above statement mean that just installing Java and running the .war file will somehow spinup a webserver and start serving http request ?
Yes, the war file contains the built-in Winstone servlet container, and running that command will start it and make it listen for requests on port 8080.
Edit: Jenkins 1.535 and above bundles Jetty (rather than Winstone). You can still run it with java -jar jenkins.war.
Jenkins comes bundled with Winstone, a very lightweight servlet container. As such, Jenkins can be started from the command line as stated by the instructions without any additional software installation.

Deploy java program on Linux

A web application has been developed in C# which hits my Java code through a restful web service which returns a JSON response.This process was working on a local machine with tomcat server. Now my Java application needs to be hosted on an external server in Linux environment.
Using putty, I logged into the particular hostname and as a root admin.
I have installed Java JDK 1.7, Apache tomcat server 7, my Java application as a war file is placed in the webapps folder. I can start the tomcat server too.
My question is:
How do I hit my application from windows. Is it http://x.y.z.k:8080//MYAPPNAME(war file name)/?
How do i check the java logs in the linux env?
Also I have a set of files that I read from my windows folders as in C://uploads//file.txt or C:\DeveloperTool\Pluggins\
I replaced them with the linux structure in my java code. as /home/opt/file.txt
Will this work?
How do I hit my application from windows. Is it
http://x.y.z.k:8080//MYAPPNAME(war file name)/?
If 8080 is the port Tomcat is configured to listen on (I think by default, it is), then that is correct. Bare in mind the web app name is case sensitive. You can configure this setting in $TOMCAT_HOME/conf/server.xml
How do i check the java logs in the linux env?
Since you're using a remote shell over SSH, you will want to use either tail or less to monitor logs in real time. The log files are stored in $TOMCAT_HOME/logs.
Try
$ less +F /path/to/tomcat/logs/catalina.out
catalina.out is the main file when running Tomcat on *nix systems.
Also I have a set of files that I read from my windows folders as in
C://uploads//file.txt or C:\DeveloperTool\Pluggins\
I replaced them with the linux structure in my java code. as
/home/opt/file.txt Will this work?
As Lutz Horn mentioned in the comments, try it. In theory, that should work fine as long as the permissions are setup properly.

Categories

Resources