How to pass configuration argument on jboss - java

I added db2 driver, edited module.xml in JBOSS_HOME/modules/com/ibm/main.
In this folder, I have
db2jcc4.jar
db2jcc_lecense_cu.jar
db2jcc_license_cisuz.jar
module.xml
After having these, I tried to launch JBoss console on Powershell
.\standalone.bat --server-config=standalone-full-ha.xml -Dcom.sun.CORBA.ORBDynamicStubFactoryFactoryClass=com.sun.corba.se.impl.presentation.rmi.StubFactoryFactoryStaticImpl
which I tried to handle ORB exception(related to this https://bugs.openjdk.java.net/browse/JDK-6497156)
But my jboss container is not launched. I checked the log file,
2019-09-17 296 FATAL [org.jboss.as.server] (main) WFLYSRV0239: Aborting with exit code
and error display on Powershell
WFLYSRV0073: Invalid option '.sun.CORBA.ORBDynamicStubFactoryFactoryClass=com.sun.corba.se.impl.presentation.rmi.StubFactoryFactoryStaticImpl'
It works on command prompts though. I am wondering it is correct way to pass argument like this. Thanks in advance!
Edit
I am using Java8, JBoss7.1

Powershell has issues with -D. Try this instead, notice the " around -D
.\standalone.bat --server-config=standalone-full-ha.xml "-Dcom.sun.CORBA.ORBDynamicStubFactoryFactoryClass=com.sun.corba.se.impl.presentation.rmi.StubFactoryFactoryStaticImpl"

Related

Weblogic 12.2.1.3 Error: Could not find or load main class com.oracle.cie.wizard.WizardController

I was trying to configure Weblogic 12.2.1.3 on Linux account.
After going through oracle documentation, I understood we setup Weblogic by running config.sh script located in /opt/weblogic12213/wlserver_12.2.1.3/installation/oracle_common/common/bin folder.
But this script is giving error as :
Error: Could not find or load main class
com.oracle.cie.wizard.WizardController
Below is the last command which it executes in setup script and it is giving an error :
/usr/java/jdk1.8.0_192/bin/java -Dpython.cachedir=/tmp/cachedir
-Xms32m -Xmx1024m -Dweblogic.alternateTypesDirectory=/opt/weblogic12213/wlserver_12.2.1.3/installation/wlserver/../oracle_common/modules/oracle.oamprovider,/opt/weblogic12213/wlserver_12.2.1.3/installation/wlserver/../oracle_common/modules/oracle.jps
com.oracle.cie.wizard.WizardController -target=config-oneclick
scripts provided by weblogic doesn't set CLASSPATH correctly.
com.oracle.cie.wizard.WizardController comes under com.oracle.cie.wizard_7.8.2.0.jar .
Steps done.
1. Copied config_internal.sh script on some local path. (Because I didn't have the root permission.)
2. Appended this jar in CLASSPATH varibale like this :
CLASSPATH="${FMWCONFIG_CLASSPATH}${CLASSPATHSEP}${DERBY_CLASSPATH}:/opt/weblogic12213/wlserver_12.2.1.3/installation/oracle_common/modules/com.oracle.cie.wizard_7.8.2.0.jar"

Netbeans profile Wildfly Selected methods

I want to profile a selected method in a project that runs in a wildfly server.
When the profiler is setup and the method is called the console will give the following exception:
java.lang.NoClassDefFoundError: org/netbeans/lib/profiler/server/ProfilerRuntimeCPUFullInstr
Steps to reproduce this problem is as following:
start wildfly server through Netbeans > Services > Servers > start Wildfly
Profile > Attach to Project
Setup Attach to Project > select proces (jboss-modules.jar)
Select Methods to profile
Select inside Methods to profile "Selected Method"
add method from own project and apply
run method, the exception will be thrown and the profiler is disconnected
I'm using Netbeans 8.1 and Wildfly 8.2.
What i've tried so far:
adding -Djboss.modules.system.pkgs=org.jboss.byteman,org.netbeans.lib.profiler.server
http://i-proving.com/2011/07/07/how-to-get-visualvm-to-profile-jboss-without-crashing/ but this gave me the following errors:
/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/lib/visualvm/profiler/lib/jfluid-server-15.jar: line 1: PK: command not found
/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/lib/visualvm/profiler/lib/jfluid-server-15.jar: line 2:,�*E: command not found
/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/lib/visualvm/profiler/lib/jfluid-server-15.jar: line 3:+�*E���+BBMETA-INF/MANIFEST.MFManifest-Version:: No such file or directory
/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/lib/visualvm/profiler/lib/jfluid-server-15.jar: line 4: Ant-Version:: command not found
/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/lib/visualvm/profiler/lib/jfluid-server-15.jar: line 5: syntax error near unexpected token ('
/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/lib/visualvm/profiler/lib/jfluid-server-15.jar: line 5:Created-By: 1.7.0_45-b18 (Oracle Corporation)
I also tried to start wildfly in profile mode but this hangs after: Profiler Agent: Waiting for connection on port 5140 (Protocol version: 16)
This should be fixed soon in the nightly builds. Otherwise if you don't want to use the nightly, this is what you'd need to do on your WildFly instance to be able to connect the profiler to it and profile your method.
In standalone.sh you will need to update certain options :
append jfluid-server.jar to the bootclasspath (or you could change the command line to use -classpath jboss-modules.jar:jfluid-server.jar org.jboss.modules.Main instead of -jar jboss-modules.jar)
add the jfluid package to the system.pkgs like this : jboss.modules.system.pkgs=org.jboss.byteman,org.jboss.logmanager,org.netbeans.lib.profiler.server
add the -Xverify:none to avoid error messages

Websphere works when run but fails when debug

I'm using Intellij with WebSphere 8. When I run from within IDE the server works normally. When I try to run it in debug mode however, it fails with the following error:
C:\IBM\WebSphere\AppServer\profiles\AppSrv01\bin\generated_websphere_server_start_script.cmd
C:\IBM\WebSphere\AppServer\java\bin\java -Dfile.encoding=windows-1252 -classpath "C:\IBM\WebSphere\AppServer\runtimes\com.ibm.ws.admin.client_8.5.0.jar;C:\IBM\WebSphere\AppServer\plugins\com.ibm.ws.security.crypto.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 13.1.3\plugins\webSphereIntegration\lib\webSphereIntegration.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 13.1.3\plugins\JavaEE\lib\javaee-impl.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 13.1.3\lib\openapi.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 13.1.3\plugins\webSphereIntegration\lib\specifics\webSphereClientImpl.jar" com.intellij.javaee.oss.process.JavaeeProcess 62847 com.intellij.j2ee.webSphere.agent.WebSphereAgent
Error: JDWP agent already loaded - please check java command line options
[2014-08-11 01:58:59,248] Artifact x.ear: Server is not connected. Deploy is not available.
JVMJ9TI064E Agent initialization function Agent_OnLoad failed for library jdwp, return code -1
Detected server admin port: 8880
JVMJ9VM015W Initialization error for library j9jvmti26(-3): JVMJ9VM009E J9VMDllMain failed
Detected server http port: 9080
Disconnected from server
I tried almost everything I have no idea what the problem is. I did google it for several hours with no luck.
Do anyone know what this all is about and how can it be fixed?
Here is my server configuration:
Solution 1
unchecked the Pass environment variables check box and restart the server in debug mode. it should work properly.
Run --> Edit Configuration --> websphere server --> Startup/Conections tab
select debug, you will see the Pass environment variables check box. it need to be unchecked for debug to work.
Solution 2
if debug mode of websphere is working in eclipse and not working in intellij that reason i found out is debugging serverice on the websphere is already started and intellij is again trying to start the debggin service. so stop the service from websphere console (Servers > Server Types > WebSphere application servers > [serverName] > Debugging Service) and all the default configurations in intellij should work.
I had the same problem. Finally I figure it out. I hope this solution helps. I'm using Intellij idea 2019.1.3.. and WebSphere 8.5.5.13
check WebSphere start server script find debug env variable name (in my script (WebSphere\AppServer\bin\startServer.bat)
WAS_DEBUG)
add same debug option name to intelliJ IDEA
run- debug configuration environment tab.
Since default env variable is debug and cannot be overridden
check pass env variables
add WAS_DEBUG option as I did
or you can update WAS_DEBUG as DEBUG (same as default in IntelliJ) in server startup.bat script.
Both should work.
Pretty old, but i was able to experience too!
They will try to fix this now in: https://youtrack.jetbrains.com/issue/IDEA-193580
firstly, sorry if the translation is not good, I am Brazilian and I would like to share the solution I made.
First: Locate the file "startServer.bat in "WebSphere\AppServer\bin" and open it with any text editor.
Second: Search for the second incidence of the word "WAS_DEBUG" and replace it with "DEBUG", as shown in the image...
Third: In Intellij, go to the server settings and in the "Startup/Connection" tab, select debug.
Fourth: Now uncheck the "use default" checkbox in "Startup script" and point to the location of the "startServer.bat" file in the webSphere directory.
Fifth: Right on the left side of the checkbox, there is an option to enter a parameter. Click and a "Program Arguments" field will appear. Enter the server name, in my case it was "server1".
Okay, now just test
enter image description here
enter image description here

Apache tomcat7 as windows service

I am trying to create a windows service for Apache tomcat 7.0.45.
( in windows version 7)
I executed this :
C:/tomcat7/bin> service install Mytomcat7
Windows service has been created. but it wont start and throws "specific server error code 4".
Can you please help with the steps to create windows service.
I had the same problem!
Found out, that the service.bat didn't configure the service the right way. If you enable the logging from your service starter:
Then you'll see in your loggs something like:
[2014-02-19 16:40:35] [error] ( javajni.c:863 ) [ 2636] FindClass org/apache/catalina/startup/Bootstrap failed
[2014-02-19 16:40:35] [debug] ( javajni.c:964 ) [ 2636] Java Worker thread finished org/apache/catalina/startup/Bootstrap:main with status=3
[2014-02-19 16:40:35] [error] ( prunsrv.c:1183) [ 5000] Failed to start Java
[2014-02-19 16:40:35] [error] ( prunsrv.c:1536) [ 5000] ServiceStart returned 4
You'll notice that there is some classpath problem with the starter. In fact that's the problem! Your service.bat didn't configure the service the right way:
Note: You can also choose "Use default" above "Java Virtual Machine" to use whatever JVM is defined in JAVA_HOME
You'll need to set the classpath correctly:
c:\webclient\apache-tomcat\bin\tomcat-juli.jar;c:\webclient\apache-tomcat\bin\tomcat-juli.jar;c:\webclient\apache-tomcat\bin\bootstrap.jar
In my case i "installed" tomcat at: c:\webclient\apache-tomcat replace that part with yours. In my case not even the Java VM was set.. I'm not shure whether this is a problem with the current versions of tomcat (and it's service.bat), or with some sort of permission problem on the windows server itself..
To solve this error perform the following steps:
Run the tomcat7w.exe monitor application found in <TOMCAT_HOME>/bin.Tomcat7w is a GUI application for monitoring and configuring Tomcat services. If you named your service Mytomcat7 you will need to rename this file to Mytomcat7.exe before running it
In the "Startup" tab change the value of "Mode" from jvm to Java
Do the same in the "Shutdown" tab
The easiest way to setup a tomcat Windows service is to use the Tomcat Windows Service Installer found on the same page as tomcat downloads.
http://tomcat.apache.org/download-70.cgi
However, if you are unable to use this installer. Then you can as you have try the above. The service created 'Mytomcat7' can be managed by the tomcat7w.exe file, after you rename it to 'Mytomcat7w.exe'.
Run the renamed file and you will be able to see all options for the service. The error you are seeing is likely related to an invalid JVM location or JVM mode not set to auto.
Details of settings found here:
http://tomcat.apache.org/tomcat-7.0-doc/windows-service-howto.html
I would just use the installer, it will make your life easier.
http://mirror.ox.ac.uk/sites/rsync.apache.org/tomcat/tomcat-7/v7.0.50/bin/apache-tomcat-7.0.50.exe

Cannot run project from IntelliJ IDEA because of jdwp error

I have a project in IntelliJ IDEA I want to run locally. When I click its debug button it says:
ERROR: Cannot load this JVM TI agent twice, check your java command line for duplicate jdwp options.
Disconnected from server
Error occurred during initialization of VM
agent library failed to init: jdwp
When I click the run button it works. What is the matter?
This is probably too late to help you, but maybe it will help somebody else. The answer is based on a support forum posting by Aleksei Sosnovski.
This can happen when your JAVA_OPTS contains two -Xrunjdwp arguments. E.g., one of these arguments might come from the server start script invoked by IntelliJ to start the container, and another may be added by IntelliJ itself. You can check by looking at JAVA_OPTS in the log when launching the container without debug. If you see an -Xrunjdwp argument, just find where it is set in the container startup script, and remove it.
I guess you already are debugging the server app? In this case it's not possible to connect another instance of debugger.
Most likely the problem happens because you have specified the debugging options in the "VM parameters" field of your run configuration. Everything will work if you remove them.
I had the same problem in my case -Xrunjdwp was set twice: one in the IDEA debug configuration and again in the system variables in CATAALINA_OPTS.
once I removed it from system variables (inside the IDEA it is read only) problem was fixed
Thanks for the tips, it helped me work out the problem too. Mine was due to having
set DEBUG_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005
In my catalina.bat
check server.xml if you have jvmEntries get rid of that entry from server.xml
<!-- <jvmEntries xmi:id="JavaVirtualMachine_1" classpath="" bootClasspath="" verboseModeClass="false" verboseModeGarbageCollection="false" verboseModeJNI="false" runHProf="false" hprofArguments="" debugMode="false" debugArgs="-Djava.compiler=NONE -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=7777" genericJvmArguments="">
Open admin console (http://localhost:9060/ibm/console/login.do)
Application servers > server1 > Debugging service
un-check Enable service at server startup if checked restart server.
On Intellij uncheck the 'Pass environment variables' box in Run/Debug configuration

Categories