I am trying to run a Java application from the command line.
The format is as follows from the command line:
<executable name> <configuration file path and name> -classpath <list of jars including the path to the jar> <path to main method>
When I run this application, it starts fine and allows me to log into the application. But when I submit my login credentials, I receive a 'Class not found' error. My colleague can has the same jars on his computer and when he logs in it works fine.
We are using the same login credentials.
The jars are the same, so the class not found cannot be in those jars. When it tries to authenticate, it uses a web service on a server. So, I cannot determine where to look to see what class I am missing.
Does anyone have any ideas as to where I should be looking?
Related
I have installed RD 4.8 CE on a Windows 2019 server + MariaDB. The application is up and I can login with the admin account. Service is Windows integrated.
I'm trying now to allow AD users to login and perform activities. I haven't found much documentation on how to configure RD on Windows. So I'm grabbing from here and there. So far I have done the following:
Created a file called jass-multiauth.conf in server/config/ folder as listed below:
multiauth {
com.dtolabs.rundeck.jetty.jaas.JettyCombinedLdapLoginModule sufficient
debug="true"
contextFactory="com.sun.jndi.ldap.LdapCtxFactory"
providerUrl="ldaps://xxxxxxxxxxx:636"
bindDn="CN=xxxxxx,OU=Service Accounts,OU=Admin Users and Groups,OU=xxx,DC=xxx,DC=xxx,DC=xxx"
bindPassword="x$xx<x>xx"
authenticationMethod="simple"
forceBindingLogin="true"
userBaseDn="OU=Admin Users,OU=Admin Users and Groups,OU=xxx,DC=xxx,DC=xxx,DC=xxx"
userRdnAttribute="sAMAccountName"
userIdAttribute="sAMAccountName"
userPasswordAttribute="unicodePwd"
userObjectClass="user"
roleBaseDn="OU=Groups,OU=Admin Users and Groups,OU=xxxx,DC=xxx,DC=xxx,DC=xxx"
roleNameAttribute="cn"
roleMemberAttribute="member"
roleObjectClass="group"
cacheDurationMillis="300000"
timeoutRead="10000"
reportStatistics="true"
supplementalRoles="user";
org.eclipse.jetty.jaas.spi.PropertyFileLoginModule required
debug="true"
file="E:/rundeck/server/config/realm.properties";
};
when I restart rundeck service the AD users are not recognized and no error at all is displayed in the log. I can however login with the admin account. So to troubleshoot this I added:
java %RDECK_CLI_OPTS% %RDECK_SSL_OPTS% -Drundeck.jaaslogin=true -Dloginmodule.conf.name=jaas-multiauth.conf -Djava.security.auth.login.config=E:\rundeck\server\config\jaas-multiauth.conf -Dloginmodule.name=multiauth -jar rundeck.war --skipinstall -d >> %CURDIR%\var\logs\service.log 2>&1
to the start-rundeck.bat file and in fact when I launch it I see an error which is quite weird:
[2022-12-22T18:58:09,409] ERROR config.GrailsApplicationPostProcessor - Error loading spring/resources.groovy file: java.io.IOException: E:\rundeck\server\config\jaas-multiauth.conf (No such file or directory)
java.lang.SecurityException: java.io.IOException: E:\rundeck\server\config\jaas-multiauth.conf (No such file or directory)
the file is there, path is correct and permission is set as on any other file in same directory. I deleted the file and created it again, but same error.
Also, I have a question: I understand that I should not edit the profile file. Hence, when the problem above is fixed, considering that the rundeck service is Windows integrated, where shall I put the line:
java %RDECK_CLI_OPTS% %RDECK_SSL_OPTS% -Drundeck.jaaslogin=true -Dloginmodule.conf.name=jaas-multiauth.conf -Djava.security.auth.login.config=E:\rundeck\server\config\jaas-multiauth.conf -Dloginmodule.name=multiauth -jar rundeck.war --skipinstall -d >> %CURDIR%\var\logs\service.log 2>&1
to refer the jass-multiauth.conf file?
Your multiauth config file is saved as jass-multiauth.conf but the launcher script is looking for jaas-multiauth.conf (jass =! jaas). That is the reason of "No such file or directory" error. Rename the file as jaas-multiauth.conf and relaunch the Rundeck service.
Trying to deploy/run a springbok application (jar) on Azure App Service, but seeing an "Application Error".
Application
We built the application using Springboot and wanted to deploy the prebuilt jar file (from /target" folder.
Azure Setup
Created a new App Service using Java 11
Under "Deployment Center" linked with the Github repository that holds the code and jar file under /target
Under App service > Configuration > General Settings > Startup Command
java -jar /target/lead-processing-0.0.1-SNAPSHOT.jar
Logs
2021-05-05T22:25:23.730536337Z STARTUP_FILE=
2021-05-05T22:25:23.737427449Z STARTUP_COMMAND=java -jar /target/lead-processing-0.0.1-SNAPSHOT.jar
2021-05-05T22:25:23.738113651Z No STARTUP_FILE available.
2021-05-05T22:25:23.738719652Z Running STARTUP_COMMAND: java -jar /target/lead-processing-0.0.1-SNAPSHOT.jar
2021-05-05T22:25:24.003600232Z Finished running startup command 'java -jar /target/lead-processing-0.0.1-SNAPSHOT.jar'. Exiting with exit code 1.
2021-05-05T22:25:24.004755134Z Error: Unable to access jarfile /target/lead-processing-0.0.1-SNAPSHOT.jar
Are we missing anything?
The problem that app service cant find your jar file.
Unable to access jarfile /target/lead-processing-0.0.1-SNAPSHOT.jar
I think when you deployed from target then you jar is possible in root. Go to App Service Editor inside of your app and check location for your jar
Removing the "/" right before the target works for me
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"
I am setting up an Apache Storm system but am having problems getting the program to run consistently. I have set up storm on three servers but it only works consistently on one. I think the issue lies somewhere in the path of the command.
I have been using storm-starter to set up the program and have tested it locally with RollingTopWords. When I run the following command $ storm jar storm-starter-*.jar storm.starter.RollingTopWords the computer stalls a second then i get the following error:
Could not find or load main class storm.starter.RollingTopWords
The jar is stored in the directory /apache/storm/examples/storm-starter/target . Let me know if there is any other information I can provide that would be of help because I'm feeling a little desperate at this point.
The following is the entire output for the program that doesn't work.
Running: /usr/lib/jvm/java-1.7.0-openjdk-amd64/bin/java -client -Dstorm.options= -Dstorm.home=/home/scix3/apache/storm -Dstorm.log.dir=/home/scix3/apache/storm/logs -Djava.library.path=/usr/local/lib:/opt/local/lib:/usr/lib -Dstorm.conf.file= -cp /home/scix3/apache/storm/lib/kryo-2.21.jar:/home/scix3/apache/storm/lib/core.incubator-0.1.0.jar:/home/scix3/apache/storm/lib/commons-fileupload-1.2.1.jar:/home/scix3/apache/storm/lib/ring-servlet-0.3.11.jar:/home/scix3/apache/storm/lib/clj-stacktrace-0.2.2.jar:/home/scix3/apache/storm/lib/jline-2.11.jar:/home/scix3/apache/storm/lib/servlet-api-2.5.jar:/home/scix3/apache/storm/lib/disruptor-2.10.1.jar:/home/scix3/apache/storm/lib/log4j-over-slf4j-1.6.6.jar:/home/scix3/apache/storm/lib/clojure-1.5.1.jar:/home/scix3/apache/storm/lib/commons-exec-1.1.jar:/home/scix3/apache/storm/lib/logback-core-1.0.13.jar:/home/scix3/apache/storm/lib/jetty-util-6.1.26.jar:/home/scix3/apache/storm/lib/slf4j-api-1.7.5.jar:/home/scix3/apache/storm/lib/carbonite-1.4.0.jar:/home/scix3/apache/storm/lib/compojure-1.1.3.jar:/home/scix3/apache/storm/lib/minlog-1.2.jar:/home/scix3/apache/storm/lib/commons-lang-2.5.jar:/home/scix3/apache/storm/lib/tools.macro-0.1.0.jar:/home/scix3/apache/storm/lib/reflectasm-1.07-shaded.jar:/home/scix3/apache/storm/lib/tools.cli-0.2.4.jar:/home/scix3/apache/storm/lib/math.numeric-tower-0.0.1.jar:/home/scix3/apache/storm/lib/logback-classic-1.0.13.jar:/home/scix3/apache/storm/lib/tools.logging-0.2.3.jar:/home/scix3/apache/storm/lib/asm-4.0.jar:/home/scix3/apache/storm/lib/jetty-6.1.26.jar:/home/scix3/apache/storm/lib/snakeyaml-1.11.jar:/home/scix3/apache/storm/lib/hiccup-0.3.6.jar:/home/scix3/apache/storm/lib/clj-time-0.4.1.jar:/home/scix3/apache/storm/lib/jgrapht-core-0.9.0.jar:/home/scix3/apache/storm/lib/clout-1.0.1.jar:/home/scix3/apache/storm/lib/chill-java-0.3.5.jar:/home/scix3/apache/storm/lib/commons-io-2.4.jar:/home/scix3/apache/storm/lib/joda-time-2.0.jar:/home/scix3/apache/storm/lib/storm-core-0.9.4.jar:/home/scix3/apache/storm/lib/objenesis-1.2.jar:/home/scix3/apache/storm/lib/commons-logging-1.1.3.jar:/home/scix3/apache/storm/lib/ring-core-1.1.5.jar:/home/scix3/apache/storm/lib/ring-jetty-adapter-0.3.11.jar:/home/scix3/apache/storm/lib/commons-codec-1.6.jar:/home/scix3/apache/storm/lib/json-simple-1.1.jar:/home/scix3/apache/storm/lib/ring-devel-0.3.11.jar:storm-starter-.jar:/home/scix3/apache/storm/conf:/home/scix3/apache/storm/bin -Dstorm.jar=storm-starter-.jar storm.starter.RollingTopWords
Error: Could not find or load main class storm.starter.RollingTopWords
The main issue for the error
Could not find or load main class storm.starter.RollingTopWords cloud be.
Check the launch configuration while building the jar.
you must be very careful while building the jar ,it asks you to choose destination folder and launch configuration(launch configuration should be of same project)
You might have missed the main class in your project.
Before using Stormsubmitter in Remote cluster, check once weather it works properly localcluster
To check if the problem is with storm unable to find the jar, you can try issuing
storm jar /fullpath/my-storm-jar.jar Classname
Few other things you can make sure
The jar is compiled properly/jar contains the RollingTopWords class
storm.yaml points to the correct nimubs (This seems less probable, as the the connection is being made and there is an attempt to load the topology)
I am trying to implement a simple JAAS module with realm configuration on Tomcat 7. I am trying to implement this based on the following link:
http://www.byteslounge.com/tutorials/jaas-authentication-in-tomcat-example
I have placed jass.config in CATALINA_HOME/conf folder and have added the following code to CATALINA_HOME/bin/catalina.bat file
JAVA_OPTS=$JAVA_OPTS "-Djava.security.auth.login.config==$CATALINA_HOME/conf/jaas.config"
However, once I start Tomcat and attempt to access the protected admin.html page, I get the basic login dialog of the browser (as expected). But while trying to log in, Tomcat reports the following error:
SEVERE: Unexpected error
java.lang.SecurityException: Unable to locate a login configuration
Please help how to make Tomcat find the JAAS config file.
The fact that you're using .bat file suggests you're using Windows where variables get referred to using %VARIABLE% notation instead of $VARIABLE. Try changing the expression to:
set JAVA_OPTS=%JAVA_OPTS% -Djava.security.auth.login.config=%CATALINA_HOME%/conf/jaas.config