Friday, June 17, 2016

Editing Websphere Generic JVM Argument Settings without Websphere Running

I was working with Websphere 8.5.5 locally on my system as I am in the process of developing a web service that will be deployed to a production Websphere server. In short, I switched the Java SDK to an IBM implementation for both code compilation as well as the Websphere runtime and wanted to add some property settings to the server JVM to accommodate some differences in the IBM SDK from the previous SDK. Here are the steps that I took:

  1. I went to the Administration Console and selected *Servers* 
  2. Expanded *Server Type* and selected *WebSphere application servers * 
  3. Clicked on the name of my server. 
  4. Expanded *Java and Process Management* and selected *Process Definition.* 
  5. Under the *Additional Properties* section, clicked *Java Virtual Machine.* 
  6. Scrolled down and located the textbox for *Generic JVM arguments*. 
  7. It was there that I added the arguments.

I then attempted to restart the server only to note that it kept timing out before it would start. Now I had a dilemma in that in order to remove the JVM arguments that caused the server not to start the server had to start! A quick look into the app server's files I was able to find where the JVM settings are stored and therefore where I could remove the settings in order to allow the server to start.

Going to the  AppServer\profiles\AppSrv01\config\cells\ServerNameHereNode01Cell\nodes\ServerNameHereNode01\servers\server1\server.xml file, there is the genericJvmArguments node with the settings in the jvmEntries node.

After removing the settings, the server started successfully. At least now I can research which JVM setting was the culprit and adjust accordingly without hosing my local Websphere installation.

Thursday, June 16, 2016

How to add a Custom JAR to a Maven Project

I know that this is old for many but it is new for me and so I am posting it. :-)

When working with custom JARs and Maven you will need to install them into Maven to reference them from the Project Object Model (POM) file.
Here is what you do at the command line:
 mvn install:install-file -Dfile="C:\Java Projects\MyProject\Marks-1.0.0-SNAPSHOT.jar" -DartifactId=Marks -Dversion=1.0.0 -Dpackaging=jar -e  

Within the POM here is the dependency setting:

1:  <dependency>  
2:     <groupId></groupId><!-- DgroupId -->  
3:     <artifactId>Marks</artifactId><!-- DartifactId -->  
4:     <version>1.0.0</version><!-- Dversion --> 
5:   </dependency>  

Now the JAR is included in the Maven Dependencies.