I'm in the arduous process of trying to upgrade a couple of our servers to use a current version of the application installed on it and I've gotten a bit stuck. I've gotten everything replaced and have narrowed my issue down to 1 .jar file. If I use the new version of this specific file, I can not get the service to start, and using the old version (and the new version of every other file), it runs fine.
When I try to start the service I get this message: Could not start <service> service on Local Computer. The service did not return an error. This could be an internal Windows error or an internal service error.
I've looked in the event viewer, and all it has are these entries every time I try to start it:
<Service> has started
Could not find the service start class
<service> has failed to start
Is there some place else that I can look that might be able to give a bit more information on why it's failing to start?
We are using the 'JavaService' utility to create the windows process. This server is also running jboss.
EDIT: I have also determined that it is not an issue with my SQL database as I just did all of the upgrades between the versions. I still can't get it to start with the new .jar, and the old .jar still works.
Thanks!
You can't execute a java application as a service. Windows services implement a specific interface that java.exe or javaw.com do not. You will need a wrapper to implement this functionality. One such wrapper is http://wrapper.tanukisoftware.org.
As Pierre mentioned, you can't run java directly as a Windows service. Apache commons daemon (a.k.a. Procrun) is another tool that will adapt a java application for use as a Windows service.
I found the issue!
After days and days of looking around at configuration files, I finally noticed something: We are now using log4j for logging but it wasn't included in the .jar's manifest! I added it to the manifest and it now starts up!
Thanks for your help everyone :]
Related
Good time!
I need to integrate JProfile7 and Weblogic 11g. I have done all the steps are described for this and nearly everithing is ok except the following thing.
My application connects to the remote data base and there is a proxy server that I need to use to communicate to the world outside the company.
As far as JProfiler rewrites the Weblogic's start script to use its agent, there should be a way to tell it to use the proxy, but I can't find how do this.
Could somebody, please, suggest, how to do this?
EDIT:
I've tried to use the
-Dhttp.proxySet=true -Dhttps.proxyHost=12.121.12.12 -Dhttps.proxyPort=1212 java options, but the problem remains
As long as your application and the jProfiler are running within the same network without any proxy restrictions, you should be fine. It is the application, not jProfiler, who communicates with the proxied DB node.
You should be able to start your application as is - if the app is using the current proxy, then the same app with the jProfiler settings will be also using that given proxy. There should not be any difference in the application behavior.
Also, you start the application VM, let it run for a while with the correct proxy and then attach the jProfiler to the application - thiw will not change the proxy settings.
Actually, I don't know the main cause of the problem, but to resolve the issue I've done the following:
created a new file: profiledStartScript.bat outside the weblogic server's bin directory.
added the following lines:
set DOMAIN_HOME=C:/Oracle/Middleware/user_projects/domains/myDomain
set JAVA_OPTIONS=%JAVA_OPTIONS% -agentpath:C:\PROGRA~1\jprofiler7\bin\windows-x64\jprofilerti.dll=port=8849
call "%DOMAIN_HOME%\bin\startWebLogic.cmd"
and that did the trick.
Hi Java web service experts,
I am working on a web service project. My goal is to create a client java program to consume the vendor web service and deliver a data file. I am at the part where I am able to generate the proxy classes from the vendor wsdl document through JDeveloper. Now I start to work to create the java stand alone client application. My issue is I am not able to debug or run my java program because of this following error. I think it has to do with the imported vendor.xml document in Jdeveloper but I am not sure. Below is the error
The target vendor.xml cannot be started because it is not a runnable
target. The target run cannot be started because it does not exist.
I've researched into this issue but not much information came up after all. I am new to this web service and would appreciated all the help.
Thank you for responding to my question. To answer the question, the vendor.xml document generated by Jdeveloper together with other skeleton classes. I try to compile or run a very simple java client program that I built just to test out if it compiles or run properly and I get that error. It points to the vendor xml document and says that it cannot run or start because it does not exist.
I have a Java 1.6 application deployed on several machines (~ 30), and started as a Windows service.
My main problem concerns the maintenance of these deployed artifacts: if I develop a new version of this application, I don't want to manually redeploy it on every machine.
Ideally, when the Windows service is starting, it checks on a remote server if an update exists, and if it is found, then it upgrades the application.
Note that it is acceptable that after this upgrade the service requires to be restarted again.
This mechanism can be compared to the Maven snapshot verification: if there is a newer version of a SNAPSHOT version on a remote repository, then Maven download it before running it.
Note that the application itself will be deployed on a Maven repository (in our case Nexus), so the check for an update will be done against this Nexus instance.
What are my technical solutions to implement such an automatically application update?
Do not hesitate to ask me more details about technical information or about the context...
Thanks.
Edit: As stated by Peter Lawrey, I can use Java Web Start. However, how can I integrate JWS within a Java application that is run as a Windows service?
I would look at Java Web Start
A common technique for this is to use a launcher. The steps are something like this:
Start the launcher.
The launcher checks to see if the application should be updated. If yes, the launcher updates the application (I think of this as "the update step").
After the update step, the launcher runs the application.
I have a Java Application written that forwards selected files to an ssh server. I want this application to be automatically run every time windows starts.
I am aware that this question has been asked multiple times, and I have followed those leads. I have tried Java Service Wrapper (which is no longer accessible because of a dns problem), Apache Daemon, and JSL. Though I have at times been able to get the application installed as a service, I have never been able to get it to run properly on boot, or even start it manually from the command line.
My question is whether anyone is aware of a full first step through final step tutorial of how to make this work. I have come across a few things, but they all either assume that you have implemented something that they do not explain how to implement, or rely on applications that I do not have installed.
Thanks
I use Java Service Wrapper to install as windows or linux service: http://wrapper.tanukisoftware.com/doc/english/download.jsp
~> create one runnable JAR to your app.
~> Download the proper service wrapper (they are diffrent to windows and linux)
~> Configure the service in wrapper.conf
Important: set wrapper.java.classpath correct (your jar must be here too)
Set wrapper.java.mainclass with org.tanukisoftware.wrapper.WrapperSimpleApp
Set wrapper.app.parameter.1 with the name of your main class, for example:
wrapper.app.parameter.1=Main
~> Test the service as console (windows bat)
I am searching any way for embedding Weblogic server in Java , I know its possible because we have maven plugins for Weblogic which embeds Weblogic in maven, But googling for it did'nt gave me useful output, Does anybody know how can we embed wemlogic in java program ?
WebLogic doesn't provide an embedded API so, even if it's a pure Java Server and if you can thus call weblogic.Server from Java code, you will have to handle everything yourself (starting the container, waiting until it's started, deploying things, waiting until they are deployed, etc). In other words, this will require some work.
Maybe have a look at the sources of Cargo, although Cargo isn't really starting an embedded Weblogic (i.e. running weblogic.Server in the same JVM). This will give you an idea of what has to be done. Or, depending on your needs, use Cargo Java API.
But if you need a full Java EE server and if this is an option, I would use GlassFish v3 in embedded mode instead of WebLogic, it will be much simpler. Check the following links and see yourself:
Embedding Glassfish V3 in Unit Test - Two Jars, Three Lines Of Code And Five Seconds Start With Deployment
Embedding EJB 3.1 Container Into Your Unit Tests - Boot Time: 5 Seconds
Using the EJBContainer API with or without Maven (but with GlassFish v3)
TOTD #128: EJBContainer.createEJBContainer: Embedded EJB using GlassFish v3
Do you need WLS specifically, of any servlet container would do? If the latter is OK, then use Jetty.
WLS is not designed to be embeddable. But you can do it. After all, WLS is just a class named weblogic.Server. Setup classpath correctly, setup PATH and other environment variables (see setDomainEnv.sh and startWeblogic.sh), start that class from Java, and you have an "embedded" WLS.
There is probably a way, but I don't know it. My experience from writing maven plugins tells me that the most likely way that the plugin works is that it starts up a new command line process just like you would normally start up the server. So in a sense, not really embedded it.
The best way to see is to track down the source of the plugin and see how they did it.
WebLogic doesn't support embedded mode like Glassfish but you can have control over your Weblogic using "WebLogic Maven Plugin", this provide several maven goals for managing and working with Weblogic instance.
See this link for further information.