Can not find basic class weblogic.Deployer - java

Deploy weblogic using jenkins without jenkins plugin.
jenkins weblogic plugin use this command. So I try use it.
/bin/java -Xms256M -Xmx256M -cp /root/wls12210/wlserver/server/lib/weblogic.jar weblogic.Deployer -debug -stage -remote -verbose -upload -name testPage -source /root/.jenkins/workspace/WebLogic/target/testPage.war -targets AdminServer -adminurl t3://127.0.0.1:7001 -user {ID} -password {password} -deploy
But If I use this command not use plugin but only raw command, there is error.
error: Cannot find basic class weblogic.Deployer or cannot load weblogic.Deployer.
above error evoke as korean language, so I translated to english.
under error is jenkins error part.
[WeblogicDeploymentPlugin] - ARTIFACT UNDEPLOYED SUCCESSFULLY.
[WeblogicDeploymentPlugin] - DEPLOYING ARTIFACT... $
/bin/java -Xms256M -Xmx256M -cp
/root/wls12210/wlserver/server/lib/weblogic.jar weblogic.Deployer
-debug -stage -remote -verbose -upload -name testPage -source /root/.jenkins/workspace/WebLogic/target/testPage.war -targets
AdminServer -adminurl t3://127.0.0.1:7001 -user {id} -password
{passwd} -deploy [WeblogicDeploymentPlugin] - ARTIFACT DEPLOYED
SUCCESSFULLY. [INFO]
[INFO] DEPLOYMENT SUCCESS [INFO]
SSH: Connecting from host [localhost.localdomain]
SSH: Connecting with configuration [weblogic] ...
SSH: EXEC: STDOUT/STDERR from command[
/bin/java -Xms256M -Xmx256M -cp /root/wls12210/wlserver/server/lib/weblogic.jar weblogic.Deployer
-debug -stage -remote -verbose -upload -name testPage -source /root/.jenkins/workspace/WebLogic/target/testPage.war -targets
AdminServer -adminurl t3://127.0.0.1:7001 -user {id} -password
{passwd} -deploy
error: Cannot find basic class weblogic.Deployer or cannot load weblogic.Deployer.
How can I solve this error?

Have you tried building wlfullclient.jar and putting that on your classpath instead? weblogic.jar doesn't have any of the ancillary libraries that you'll probably need.

Better load the weblogic environment first, it will load all the weblogic related classes you may need:
According to the path you showed, run this in command line before you try to start the java virtual machine:
". /root/wls12210/wlserver/server/bin/setWLSEnv.sh"

Related

Missing JavaFX application class when using jPackage

I'm getting the message "Missing JavaFX application class com.ponderwhy.pikeinventory.PikeInventory" after deploying with jPackage.
Using AdoptOpenJDK 16, JavaFx-16, WiX 3.11 on Windows 10. My application runs fine when I use the following JVM options file.
# -classpath aka -cp
-cp D:/WS_Utility/PikeInventory/bin;D:/WS_Utility/Basic/bin;D:/WS_Utility/ancillary/bin;C:/Java/javafx-sdk-16/lib;C:/Java/controlsfx-jfx-13/controlsfx-11.0.2.jar
# -modulepath aka -p
-p C:/Java/javafx-sdk-16/lib;D:/WS_Utility/basic/bin;D:/WS_Utility/Ancillary/bin;D:/WS_Utility/PikeInventory/bin;C:/Java/controlsfx-jfx-13/controlsfx-11.0.2.jar
--add-modules=ALL-MODULE-PATH
--add-exports javafx.base/com.sun.javafx.collections=ALL-UNNAMED
--add-exports javafx.base/com.sun.javafx.runtime=ALL-UNNAMED
--add-exports javafx.controls/com.sun.javafx.scene.control=ALL-UNNAMED
--add-opens javafx.graphics/com.sun.javafx.css=ALL-UNNAMED
com.ponderwhy.pikeinventory.PikeInventory
When I use jPackage to build an.exe file using the following jPackage commands:
--type exe
--app-version 1.0.1
--description "Pike Inventory"
--name PikeInventory
--vendor PonderWhy
--verbose
--java-options -splash:$APPDIR//RockF7.jpg
--input D:/Dev/TrainInv/jPackage
--icon D:/Dev/TrainInv/jPackage/LocoFront.ico
--main-jar PikeInventory.jar
--main-class com.ponderwhy.pikeinventory.PikeInventory
--module-path C:/Java/javafx-jmods-16;C:/Java/controlsfx-jfx-13;C:/Java/JDK-16/jmods;D:/Dev/TrainInv/jPackage
--add-modules javafx.base,javafx.controls,javafx.fxml,javafx.graphics,javafx.media,javafx.swing,javafx.web
--win-console
--win-dir-chooser
--win-menu
--win-menu-group PikeInventory
--win-shortcut
# --win-upgrade-uuid PkInv
I have the 2 environment variables set that I find some references to.
PATH_TO_FX=C:\Java\javafx-sdk-16\lib
PATH_TO_FX_MODS=C:\Java\javafx-jmods-16
All three of my projects, Basic, Ancillary and PikeInventory have module-info.class.
The jPackage builds, deploys and installs without error. My splash comes up then the missing class message.
I am at a loss at what to try next to resolve my problem.
Any help would be greatly appreciated.
Peter

IO Exception in Java Packager: Exec failed with code 2 command

I want to create executable bundle for windows from java's jar application using the javapackager but facing issues.
Running cmd command
javapackager -deploy -native -outdir packages -outfile Final -srcdir . -srcfiles Hello.jar -appclass sample.Main
Exception
No base JDK. Package will use system JRE.
No base JDK. Package will use system JRE.
Creating app bundle: Main in C:\Users\DELL\Desktop\Java Packager\packages\bundles
Result application bundle: C:\Users\DELL\Desktop\Java Packager\packages\bundles
java.io.IOException: Exec failed with code 2 command [[C:\Program Files (x86)\InnoSetup6\iscc.exe,
/oC:\Users\DELL\Desktop\Java Packager\packages\bundles,
C:\Users\DELL\AppData\Local\Temp\fxbundler6308867820319632690\images\win-exe.image\Main.iss] in
C:\Users\DELL\AppData\Local\Temp\fxbundler6308867820319632690\images\win-exe.image
at com.oracle.tools.packager.IOUtils.exec(IOUtils.java:165)
at com.oracle.tools.packager.IOUtils.exec(IOUtils.java:138)
at com.oracle.tools.packager.IOUtils.exec(IOUtils.java:132)
at com.oracle.tools.packager.windows.WinExeBundler.buildEXE(WinExeBundler.java:697)
at com.oracle.tools.packager.windows.WinExeBundler.bundle(WinExeBundler.java:366)
at com.oracle.tools.packager.windows.WinExeBundler.execute(WinExeBundler.java:173)
at com.sun.javafx.tools.packager.PackagerLib.generateNativeBundles(PackagerLib.java:352)
at com.sun.javafx.tools.packager.PackagerLib.generateDeploymentPackages(PackagerLib.java:319)
at com.sun.javafx.tools.packager.Main.main(Main.java:476)
Error: Bundler "EXE Installer" (exe) failed to produce a bundle.

weblogic.Deployer gets slow when running multiple times

I deploy some EAR to a remote weblogic server with
java weblogic.Deployer -adminurl http://weblogic:7001/ -username weblogic -password weblogic1 -deploy /tmp/package.ear -remote
But when I run this command multiple times, it's getting really slow to deploy (like 10-15 minutes to deploy a small EAR/WAR).
Why ?
Solution is to add the parameter -Djava.security.egd=file:/dev/./urandom to the java command. See this answer and this post for more details.
The complete command becomes
java -Djava.security.egd=file:/dev/./dev/urandom weblogic.Deployer -adminurl http://weblogic:7001/ -username weblogic -password weblogic1 -deploy /tmp/package.ear -remote

Undocumented Java command line options?

On a server where I work is a JBoss instance, which has the following command line:
/usr/java/jdk1.6.0_31/bin/java -Dcom.sun.management.jmxremote -Dprogram.name=run.sh -server -Xms464m -Xmx464m -XX:MaxPermSize=128m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Dsun.net.inetaddr.ttl=0 -Dcom.sun.management.jmxremote -Djavax.management.builder.initial=org.jboss.system.server.jmx.MBeanServerBuilderImpl -Djboss.platform.mbeanserver -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=20071 -Djava.endorsed.dirs=/opt/jboss/lib/endorsed -classpath /opt/jboss/bin/run.jar:/usr/java/jdk1.6.0_31/lib/tools.jar org.jboss.Main -P /opt/jboss/server/default/site-deploy/example.com/boot-1.properties -c default
I have a few questions:
1. I understand that the -D option sets the named property, e.g. -Dsun.rmi.dgc.server.gcInterval=3600000 sets the property sun.rmi.dgc.server.gcInterval to the value 3600000. What about -D options that have no equals sign, like -Dcom.sun.management.jmxremote? What is the value of com.sun.management.jmxremote?
2. I can't find ANY documentation explaining what the -P or -c options do. Neither java -version or man java mentions them. My guess is that -P means "load the properties from the specified file." I have no idea what -c does.
3. The token org.jboss.Main doesn't seem to be part of the preceding -classpath option. Is it the name of the class that Java is telling it to invoke, e.g. how java Foo would invoke a class called Foo?
/usr/java/jdk1.6.0_31/bin/java -Dcom.sun.management.jmxremote -Dprogram.name=run.sh -server -Xms464m -Xmx464m -XX:MaxPermSize=128m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Dsun.net.inetaddr.ttl=0 -Dcom.sun.management.jmxremote -Djavax.management.builder.initial=org.jboss.system.server.jmx.MBeanServerBuilderImpl -Djboss.platform.mbeanserver -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=20071 -Djava.endorsed.dirs=/opt/jboss/lib/endorsed -classpath /opt/jboss/bin/run.jar:/usr/java/jdk1.6.0_31/lib/tools.jar org.jboss.Main -P /opt/jboss/server/default/site-deploy/example.com/boot-1.properties -c default
1 System property without value means that system property is present, and value is empty string ""
2 those are the command line argument to jboss's Main class
3 that class is coming from one of those jar, open run.jar and validate
The following link documents all of the options to the jboss run.sh script:
Chapter 5. Starting and Stopping JBoss
usage: run.sh [options]
-h, --help Show this help message
-V, --version Show version information
-- Stop processing options
-D<name>[=<value>] Set a system property
-d, --bootdir=<dir> Set the boot patch directory; Must be absolute or url
-p, --patchdir=<dir> Set the patch directory; Must be absolute or url
-n, --netboot=<url> Boot from net with the given url as base
-c, --configuration=<name> Set the server configuration name
-B, --bootlib=<filename> Add an extra library to the front bootclasspath
-L, --library=<filename> Add an extra library to the loaders classpath
-C, --classpath=<url> Add an extra url to the loaders classpath
-P, --properties=<url> Load system properties from the given url
-b, --host=<host or ip> Bind address for all JBoss services
-g, --partition=<name> HA Partition name (default=DefaultDomain)
-u, --udp=<ip> UDP multicast address
-l, --log=<log4j|jdk> Specify the logger plugin type

Running Equinox stand-alone with --launcher.ini option

I'm trying to run Equinox and antRunner in "headless" mode with a custom eclipse.ini file. The "--launcher.ini" option should work according to:
http://wiki.eclipse.org/Equinox_Launcher .
However, when I run the following command line:
java.exe
-cp "C:\Program Files\eclipse\plugins\org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar" \
org.eclipse.core.launcher.Main \
--launcher.ini "C:\ini\my_eclipse.ini" \
-application org.eclipse.ant.core.antRunner \
-console \
-data "c:\my_workspace" \
-file "c:\my_buildfiles\build.xml" \
I get the following error message:
osgi> Unknown argument: --launcher.ini
Unknown target: C:\ini\my_eclipse.ini
Buildfile: .\build.xml
How can I load a custom eclipse.ini when starting Eclipse with Equinox from the command line?
The problem is that you are trying to launch using only the Java part of the launcher, while the wiki page describes the arguments for the native part of the launcher (eclipse.exe or any name you want).
The launcher.ini describes how to setup the Java process (memory size, vm location, arguments to vm, etc.). So, it makes sense that you pass refernece to the launcher.ini to the native launcher.

Categories

Resources