glassfish starts only from the netbeans IDE and not from the command prompt - glassfish

i have installed the netbeans version 6.8 with glassfish version 3 on a redhat machine.
the thing is that when i try starting/stopping the glassfish via the netbeans, it works fine, BUT when i try starting the glassfish via:
./asadmin stop-domain domain1
i get the error
"GlassFish requires Java SE version 6. Your JDK is version 4"
i have got only one JDK instance installed
rpm -qa | grep jdk
will return "jdk-1.6.0_18-fcs"
any ideas ?

Set the environment variable AS_JAVA to point to your 1.6 JDK. (asadmin will use bin/java within that directory). AS_JAVA must be set in glassfish/config/asenv.conf

Related

Is jboss 4.2.2 GA compatible with java 11?

We have a product that is running fine with JBoss 4.2.2/java 7.
We are now moving to JDK 11. simply added java 11 in the classpath and tried starting the server.
Encountered below error
OpenJDK 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0
-Djava.endorsed.dirs=C:\PathBuilder\GE\EMEA\vp\jboss\lib\endorsed is not supported. Endorsed standards and standalone APIs in modular form
will be supported via the concept of upgradeable modules.
removed below configurations from run.bat and started the server again
-XX:MaxPermSize=128m
"-Djava.endorsed.dirs=%JBOSS_ENDORSED_DIRS%"
now getting below error and which is
interrupting the ear deployment Caused by:
java.lang.ClassNotFoundException: No ClassLoaders found for:
org.omg.CORBA.Object
Is Java 4.2.2 compatible with JDK 11 or we need to update JBoss to 7.2 or latest versions?
can someone help with this or provide related links?
JBoss 4.2 is a very old and outdated version and it only tested with JDK 1.5 and 1.6 version. If you are upgrading your JDK to 11 then you should update the JBoss to 7.3 version which is the latest available GA release from Red Hat.
You can download the jdk files of older versions like jdk6 and then replace JAVA path in the jboss run file from "set JAVA=%JAVA_HOME%\bin\java" to
"set JAVA=C:\Users\jdk1.6.0_45\bin\java"
Of course it's better to upgrade to a higher JBoss version... But in case that's not possible, you can avoid the ClassNotFoundException for org.omg.CORBA.Object by placing rt.jar from Java 8 in your JBoss-libs folder.
With this configuration you can run older JBoss versions with Java 11.

How to check apache maven version 3.1.1 or newer is installed in a machine?

I am absolutely new to Java Enterprise Edition and can someone help me by providing the steps needed to check whether Apache maven version 3.1.1 or newer is installed in a machine?
You can check it by executing mvn -version.
if the command is not found, no version is installed correctly else there is an output of the maven version.
If you want to check it programatically you can write an java application which executes the mvn -version command and reads the result of the process.
(Search for java Runtime.getRuntime().exec )

Netbeans 8 and 7.4 Problems on CentOS 6.5

I am new to Linux and my boss ordered me to install Netbeans software to one of CentOS 6.5 desktop.
I have downloaded and install Netbeans 7.4 along with Java jdk package. Installation was fine but when I try to execute the Netbeans icon, nothing happens.
I even go the the netbeans installation directory Netbeans 7.4/bin/ netbean and try to execute in terminal but nothing happens. It does not give any error,just not start. Please help. I have tried both the Netbeans version 7.4 and 8,but same problem.
Well I have downloaded the 32 bit version of NETBEANs and JDK package, but my OS is 64 bit...silly :) now I have installed correct version of JDK and Netbeans and its working.

VisualVM hangs when installing plugins

I'm trying to install some plugins for VisualVM but it keeps hanging on the below screen - telling me "Please wait until the installer discovers plugin dependencies". I'm running Ubuntu 12.04. It hangs both when I try and install them from the "available plugins" list and when I try to install them manually after downloading them from the VisualVM plugins centre.
I have just got the same problem with visualvm 1.3.2 installed from default ubuntu repo.
It used opendjdk as default (configured in /usr/lib/visualvm/etc/visualvm.conf), it works after I switch to oracle jdk, for example, assuming you installed oracle jdk at /usr/lib/jvm/jdk1.6.0_43
try
jvisualvm --jdkhome /usr/lib/jvm/jdk1.6.0_43/
Ubuntu 12.04, Visual VM 1.3.2.
Fixed the same issue by switching from OpenJDK 6 to OpenJDK 7.
jdkhome="/usr/lib/jvm/java-7-openjdk-i386" in /usr/lib/visualvm/etc/visualvm.conf.

Glassfish will not start

I am installing Glassfish 3.1.2 on a vps server running Ubuntu 12.04 LTS and a I am not being able to start glassfish.
As X are not installed and I am connecting via ssh I am using the manual unzip method to install Glassfish.
Inside Glassfish bin directory with the glassfish user I do ./asadmin start-domain and nothing happens. It seems to hang. I cannot even stop it with ctrl+c. I need to kill the java process from another console.
The server.log file in the domain does not show any error. Last two lines are:
mar 23, 2013 1:12:03 AM com.sun.enterprise.admin.launcher.GFLauncherLogger info
INFO: Se ha iniciado correctamente en 7 mseg.
Thank you very much for your help.
I had the same problem when I was installing glassfish. I fixed this problem by running Glassfish on an old version of jre. I was trying to install with version 1.8 and ended up using an old installation of jre6. Server started fine after I installed Glassfish using version 1.6.
It looks like a bug with the log levels. GFFileHandler logging level might be set to "OFF".
Try this:
asadmin start-domain
asadmin set-log-levels com.sun.enterprise.server.logging.GFFileHandler=ALL
asadmin restart-domain