Diagnose failed deployment - java

I have to deploy an EAR archive corresponding to a Java EE application in a client's WebLogic server. I have full access to Enterprise Manager but I'm not allowed to deploy through it—instead, I need to invoke a web service that triggers a home-brew shell script. I can see its source code: it first attempts to undeploy the app and (no matter the result) then attempts to deploy the uploaded EAR; each task call a Python script and that's where I lose track. I believe actual work is eventually done by Java libraries from WebLogic Scripting Tool.
The problem is that I'm not getting any error code or message but the application stubbornly remains in its previous release. I'm positively sure there's nothing wrong with the EAR. I've recompiled everything several times and it deploys successfully to the staging server (where I do use EM).
Is there any log file to be found either in Enterprise Manager or Administration Console?

Related

How to deploy spring boot application into it self

I have a spring boot application that running on embedded tomcat with java -jar app.jar on a server away from my work office, and I haven't any ssh or other access to that server.
So when I want to install and run newer version of application, I should go to the server place, physically connect to server and then install and run newer version.
Is there a way to run newer version of application without going to the server place? for example, upload newer jar file into my running application, and itself update it.
NOTE
I don't have any access to server and cannot use and run any continous delivery tools like jenkins or other, because of IP and port restrictions.
I did something like this a while back which worked out pretty well.
So you could create a super small app on the server(so small that it "never" needs to be updated) and have that monitor the versions and when a new version is available it could stop the real process and restart it with the new jar file.
I unfortunately don't have the code for that starter app, but it shouldn't take that long to write one that suits your needs
Why don't you install a Tomcat to the server and use it's management GUI to deploy the newer version of the app? It is a very old fashion but works well.
The only thing you will need to modify in your source code is to replace the packaging from jar to war in the pom.xml, so you can deploy it via Tomcat Manager.
This how the manager GUI looks like:
You can learn more about the Tomcat Manager here.

How do I debug server-side errors?

Our Java application is going through migration from a WAS 7 server to a WAS 8.5 server - and for some reason, even though our application shows as Deployed in our Admin Console, the application itself isn't coming up on our assigned URL.
I've ruled out the possibility of a code-related problem by testing the application in my local server, so I know the problem is with some server settings - but, almost all of my experience in CS is in coding, and I don't know how to figure out where those settings have gone awry.
What options do I have to debug my application's server-side issues?
You don't specify what you mean by "coming up," so I'll start with the broad suggestions.
A couple things to sanity check:
Ensure the application has been deployed on the specific server you are trying to access it on. It's common to have multiple servers all in one cell controlled by one deployment manager, and applications can be deployed to only some of those servers. In the admin console, under Servers -> WebSphere application servers you can find the server you expect it to be on and check Installed applications.
Check to see if the application itself has started. It's possible the server has been started, but not the application. In Applications -> WebSphere enterprise applications, look for the green arrow next to your application.
If you're trying to access a servlet, make sure the context-root of your web module is set to what you expect. In the application's configuration page, it's in Context Root for Web Modules under Web Module Properties.
If all of those seem correct, or if the application is stopped and won't start, check the server logs in your profile's logs directory, especially the SystemOut.log and the ffdc folder. It may be that an error is occuring when you go to access it, or when it is starting up. Those should appear there.
If your application uses EJBs at a version less than 3.1, the EJBDeploy tool must have been run against your application either before deployment, or as part of the deployment process. If you are expecting the latter to occur, ensure the EJBDeploy tool was installed alongside WebSphere on the target system.
If all of that fails, you may way to break out the debugger (if that's allowed in your environment) and see if your code is even being reached.
Check Server Logs: in WAS Console you can find the logs of your server.
Debug in local server. By deploying an ear in your local server, you can then start the server in loggin mode. Then you shuld stop and restart your websphere aplication and it will be stoped in selected breakpoints.

Best way to show app version starting jetty project

The project based on the jetty at startup must display the application version in console. Is desired to show version data just after jetty says he started. However, the app architecture does not allow to do so directly from my code.
Perhaps this can be done using configuration files?
Editing1:
Project starts as jetty server from compiled with maven war file and on momet of start I have no access to pom.xml. Also, after start no java methods are calling. Jetty server waits while somebody connect to it via browser or rest api (not sure how it works). Only after a user request my code will be called.
So, I need to show version of my project just after jetty server run with my compiled war file. How can I do it?

web application auto install

I need to have an autoinstall/update a web application running on JBoss 6.
I need at least to:
* stop the server
* copy the war in the deployment directory
* apply DB update scripts
* start the server
Do you know an tool or open source project for that?
Thx
Christophe
Most Servlet containers have the ability to deploy without stopping the server. Some do it by dropping the WAR file in a specific directory which is polled by the webserver (if configured properly) while others expose "upload" web APIs.
JBoss typically uses Tomcat as its servlet container. While I don't know which version your version of JBoss is using, Tomcat has supported deploying on a running server for a very long time. Perhaps the documentation for Tomcat 5.5 is enough for you to determine what changes (if any) you need to make.
In the event that you really need to stop the server Tomcat has the ability to stop the server from an external program (it only requires the right kind of message to be sent); however, once stopped, Tomcat can't receive a "startup" message, it will have to be started manually.
A better solution would be to detect when the application started by looking at servlet lifecycle events, and then to "check" the database upon a "first started up" event. In the off chance that your database detection shows the database doesn't match the expected version, apply the changes. After the database detection shows the database is up-to-date, then start normal request processing. This isolates the code within your web application in such a manner that allows for easy deployment and upgrades, although it does mean more work in tailoring the application to encapsulate it's own database maintenance duties.
In the event that such a technique isn't an option, you will have to rely on an external tool to get the job done. Typically such a tool requires heavy integration of resources (sometimes across multiple machines). In such a case, an Enterprise Job Scheduler, or a workflow engine (with your own written adapters) is generally applied to solve the issues at hand.
For information, we finally implemented our own solution. Basically
One job downloads from a FTP a ZIP file containing an installer application written in Java
One unzipped, the installer is run. This one executes SQL update scripts, then deploy the WAR file using the JBoss JMX API. However for JBoss cluster support, we had to write our own MBean in order to copy the WAR file on each node.

Swing changes not refelecting in the server

I am using Java Swing. I have done some changes in client pages and I am compiling the entire application, building the ear file and deploying it in Weblogic 8.1 server. But the changes I have done are not reflected in the application. I have restarted the server, deleted logs and cache. Still i am not able to see changes. Please help me.
Swing is a library that allows creating UI in java. Weblogic is a J2EE application server. EAR file contains your server side application. What is the relationship between updating your server side and changes you are expecting to see on UI?
If you are using java web start or applet check the codebase, i.e. where the client side application is started / downloaded from

Categories

Resources