Is there any deployment platforms for Java daemons? We have glassfish, geronimo etc. for web-application deployment, but if I have simple Spring based application which is processing messages from ActiveMQ or something like that. Where I should deploy that?
You probably are looking for something like Java Service Wrapper. I used it a couple of years ago for a group of services that needed a watchdog and start, stop and restart operations. You can do that and a few things more:
Run a Java application as a Windows Service or Unix Daemon:
makes it possible to install a Java Application as a Windows Service or a daemon process on Unix systems.
Standard, Out of the Box Scripting: provides scripts for run on Windows and Unix
On Demand Restarts: Your application can request a restart of their own JVM
Flexible Configuration: Configuration for JVM and application can be centralized in a text file.
Logging: While the Java Service Wrapper does not attempt to replace any Logging Tools available, it does provide a number of properties to configure how "stdout" and "stderr" output to the JVM console is handled. This output can be logged to any combination of the console, a file, or the "Event Log" (Windows) or "syslog" (Unix).
If you build your project with Maven, there is a Application Assembler Maven Plugin that you can use.
Creating a simple daemon process with Spring
Related
I deploy a spring boot application on azure (app service), but it takes many time to get started (20 minutes sometimes), I always have in the logs this line with many occurences :
Waiting for response to warmup request for container myapp_id_on_azure_0_917c0e77. Elapsed time = 326.0884541 sec
I seems to wait something to effectively start the application ... but what ?
Anyone have tips ?
FYI : I execute : java -jar /home/site/wwwroot/my_app.jar for starting my application. I not define any server port in application.properties on my spring boot application. I also verify that on "general settings" of the app service the option "always on" is enabled ...
FYI : I execute : java -jar /home/site/wwwroot/my_app.jar
From this sentence, I can probably guess that you are using the linux platform.
I think your question is meaningless, in the absence of any log. So there should be no one who can give you a direct and effective solution, but can only provide you with troubleshooting ideas.
Troubleshooting steps
If you use windows platform, you should add web.config under wwwroot folder.
Instead of executing java -jar /home/site/wwwroot/my_app.jar in the command line.
If you use linux paltform, and your webapp use myapp.jar file , so you should use Java SE, like below.
Whatever paltform you use, you shold check application log, find error message, it will help you solve the issues.
I am working on a web-app front end (spring mvc) which depends on war file (created also by me).
Both module web and core communicate via REST (Jersey).
Both modules are separate maven projects.
On some occasions during development I screw up something in the core and exception is thrown. Many times I need to setup a breakpoint there and trap the issue.
The problem is: I start the debug when running the web-app fine. But will never stop on any breakpoint in core (doooh). (core is build using maven package command, to generate war file).
I could start only the core and debug it. Problem some complex functions expect many attributes (form object json format).
Any ideas?
Tnx
Start the core on debug mode, if you can do this in your IDE then you are all set, otherwise you can set up your IDE for remote debugging, There are instructions to do this for popular Ide's. Set up for eclipse, Set up for Intellij
You can debug the core and start web-app regularly and make it send the request you want to debug on the core side.
Have the core source code open in your IDE. Configure it for remote debug of the JVM that the servlet container/app server is running the app. Enable remote debugging on the servlet container/app server. Start the server, start the remote debugging in the IDE. Set a break point and enjoy.
I have some 5 application running in my tomcat server. I want to build some kind of tool where I can be able to choose one application from the application list and than be able to view the following things-
1.)Detect low memory
2.)Enable or disable GC and class loading verbose tracing
3.)Detect deadlocks
4.)Control the log level of any loggers in an application
5.)Memory used by that application.
6.)Thread view for that application.
I want to have some kind of open source so that i can modify it and integrate it into my web project so that i can view it directly in a webpage.Is there something already existing.?
have a look at http://visualvm.java.net
Enable JMX for your Tomcat server: Monitoring and Managing Tomcat. Then you can manage it with any JMX console. JConsole is the one bundled in JDK.
How to activate JMX on my JROCKIT JVM for access with jconsole?
(somewhat a follow up question to How to activate JMX on my JVM for access with jconsole?)
The main reason I ask is, because I get strange errors if I try to run jboss (6.0.0.Final) with activated JMX, and jboss doesn't start correctly. So maybe it is a jboss problem.
The easiest way to do this, and at the same time support a variety of potential networking configuration challenges, as well as work with any JVM (most ?) is to install a JMXConnectorServer in the JBoss App Server. Now you're using standard J2SE connectivity.
Older builds of JBoss 6 had this support built in and I'm not sure why jboss removed it but here's how you can recreate it.
Find the jar jboss-as-jbossas-jmx-remoting.jar which has a maven signature of org.jboss.jbossas / jboss-as-jbossas-jmx-remoting. Copy it to the [jboss-home]/server/[your-server]/lib directory.
Create a file like jmx-connector-service.xml as outlined below and drop it into your [jboss-home]/server/[your-server]/deploy directory.
(Sorry, was having trouble formatting XML for stackoverflow).
When the server starts, you will see a log statement like this, pretty early on:
INFO [JMXConnectorServerService] JMX Connector server: service:jmx:rmi://10.213.14.95/jndi/rmi://10.213.14.95:1090/jmxconnector
You can tweak the bindings, the use of a registry, the ports etc, but now you can open JConsole and connect to service:jmx:rmi://10.213.14.95/jndi/rmi://10.213.14.95:1090/jmxconnector.
You can find more information on the service here.
Assuming my clients are running my J2EE WAR application on their intranet, and I have an update for them... how do I push the updated war file to them?
I'd like it to be automatic and require no human interaction on the client's side.
Can this be done?
Any help would be appreciated.
Tomcat (if this is your target container...) offers a manager interface that will allow you to deploy/start/stop applications.
I have used both ant and maven tasks to great effect in deploying wars remotely all while being built-in to the build process.
Depending on your deployment process, this may not work for you, but for dev & qa: highly recommended.
Edit: of course apache has to be configured for this type of access to be allowed.
See: Deployer how-to
Glassfish has documentation on deployment here.
Ant tasks are also available here.
Glassfish uses Tomcat internally, but the Tomcat Manager is not available as it is a separate application.
If the glassfish admin console can be accessed, it can be used to upload and deploy war files.
I'm not sure if you're comfortable giving them access to your source code repository...even in read-only mode.
If you are, then you could script up something in ANT to check out the latest version of the source code (using CVS task) and then build the .war file (using WAR task).
The only trick would be automatically deploying it once the war has been built. Tomcat will automatically deploy applications copied into a certain directory. For Websphere, see this question and this question.
For other J2EE servers I don't know how it would be done.