I am porting a Ruby on Rails 3.2.8 app from MRI 1.9.3 to JRuby 1.6.7
The Rails app itself is JRuby friendly, I did have to jump through some hoops to get twitter-boot strap to work with JRuby. All of my tests pass and the app will run under Webrick (via bundle exec rails server).
When I attempt to run under mizuno, I get this odd error:
bundle exec mizuno -d
java.lang.ClassNotFoundException: Jruby-opensslService
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at org.jruby.util.JRubyClassLoader.findClass(JRubyClassLoader.java:86)
<a few thousands more lines>
(If you thought Java was bad, JRuby really knows how to spit some stack.)
I am sure you are thinking the same I was, but the Gemfile does include the jruby-openssl:
bundle list | grep openssl
* jruby-openssl (0.7.7)
My JRuby runtime, with no JRUBY_OPTS used:
jruby -v
jruby 1.6.7.2 (ruby-1.9.2-p312) (2012-05-01 26e08ba) (OpenJDK 64-Bit Server VM 1.7.0_03) [linux-amd64-java]
Anyone with pearls of wisdom?
I have been able to get mizuno to work using rackup:
bundle exec rackup -s mizuno
Related
What doesn't work
I'm trying to setup WSL2 GUI environment under the latest version Windows Insider Preview. Gedit and Thunar worked fine but when I tried to run GoLand it gave me the following error
Start Failed
Failed to initialize graphics environment
java.awt.AWTError: Can't connect to X11 window server using ':0' as the value of the DISPLAY variable.
at java.desktop/sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at java.desktop/sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:102)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.desktop/sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:61)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:315)
at java.desktop/java.awt.GraphicsEnvironment$LocalGE.createGE(GraphicsEnvironment.java:101)
at java.desktop/java.awt.GraphicsEnvironment$LocalGE.<clinit>(GraphicsEnvironment.java:83)
at java.desktop/java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:129)
at java.desktop/sun.awt.X11.XToolkit.<clinit>(XToolkit.java:233)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:315)
at java.desktop/java.awt.Toolkit$2.run(Toolkit.java:588)
at java.desktop/java.awt.Toolkit$2.run(Toolkit.java:583)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.desktop/java.awt.Toolkit.getDefaultToolkit(Toolkit.java:582)
at java.desktop/java.awt.Toolkit.getEventQueue(Toolkit.java:1499)
at java.desktop/java.awt.EventQueue.invokeLater(EventQueue.java:1318)
at com.intellij.idea.StartupUtil.lambda$scheduleInitUi$9(StartupUtil.java:347)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
at java.base/java.lang.Thread.run(Thread.java:829)
-----
Your JRE: 11.0.11+9-b1341.57 amd64 (JetBrains s.r.o.)
/home/ubuntu/executables/GoLand-2021.1.3/jbr
I'm using WSL2 - Ubuntu-20.04, Windows 11 build 22000.100
What works
start VcXSrv in Windows
$DISPLAY is set to $WINDOWS_IPADDR:0, startxfce4 in wsl2
start GoLand in VcXSrv window
Everything works fine
p.s. I defined a environment variable WINDOWS_IPADDR=$(cat /etc/resolv.conf | grep nameserver | cut -d ' ' -f 2).
What I have tried
I've tried Pycharm and Idea and both of them displayed the same error.
export DISPLAY=localhost:0 && goland.sh gives the same error.
export DISPLAY=0:0 && goland.sh gives the same error.
export DISPLAY=$WINDOWS_IPADDR:0 && goland.sh will not show this error, but nothing happened.
I tried to install a new openjdk-11 which might be different from openjdk-11-jdk-headless but it didn't change the JRE path used by IntelliJ-idea/GoLand/PyCharm, which is always IDE_INSTALL_PATH/jbr, e.g. goland alwayws use jre in /home/ubuntu/executables/GoLand-2021.1.3/jbr
I'm not familiar with X11 or X-Server so I tried searching for similar issues but few is related. I'm think it might be some kind of compatibility issue with WSLg.
Does anyone know how to fix this error? Any and all help/direction is appreciated.
UPDATE:
I install a new distro and everything just magically work now. However, I mistakenly deleted the original distro so I cannot test it anymore. I guess WSLg cannot work very well with gnome & xfce4 as I've installed both desktop environments in WSL. Think twice before you want to install multiple desktops!
I have a minecraft modded server on 1.12.2, and it works for the most part, but it gives me an error.
The minecraft server is
forge-1.12.2-14.23.5.2846-universal.jar, and I'm on lubuntu, using openJDK 10.
I have these mods:
GalacticraftCore-4.0.2.236, GalacticraftPlanets-4.0.2.236, MicdoodleCore-4.0.2.236, and hopperducts 1.5
My system is:
Distributor ID: Ubuntu
Description: Ubuntu 19.04
Release: 19.04
I tried reinstalling it, and it worked to get mission libraries(some) and then this came up.
My code to run is:
java -Xmx1G -Xms1G -jar forge-1.12.2-14.23.5.2846-universal.jar
where "forge-1.12.2-14.23.5.2846-universal.jar" is the run file(yes, spelled correctly).
I just expected it to run, but it gave me this error:
A problem occurred running the Server launcher.java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at net.minecraftforge.fml.relauncher.ServerLaunchWrapper.run(ServerLaunchWrapper.java:70)
at net.minecraftforge.fml.relauncher.ServerLaunchWrapper.main(ServerLaunchWrapper.java:34)
Caused by: java.lang.ClassCastException: class jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to class java.net.URLClassLoader (jdk.internal.loader.ClassLoaders$AppClassLoader and java.net.URLClassLoader are in module java.base of loader 'bootstrap')
at net.minecraft.launchwrapper.Launch.<init>(Launch.java:34)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
... 6 more
For posterity's sake, the issue is openjdk-10. The server .jar file uses something or other that isn't supported by versions of java after 8, and throws this same error you saw, that I spent a while chasing down. There's another relevant thread here. Solution: remove openjdk-10 (or whatever version you're using that isn't 8) with
sudo apt-get remove openjdk-10
and make sure version 8 is installed with
sudo apt-get install openjdk-8.
I found this on GitHub. Basically, the issue may be something with the vannilla Minecraft server.jar. Try re-downloading it, and manually renaming it. If that doesn't fix, there was a comment in there about Linux. Check that out.
Sorry I'm not more help. I'm not a Java developer, and I have just barely used Linux. I used CentOS a bit on my Raspberry Pi, and I used Ubuntu in a virtual machine, but besides that I'm a Windows user.
Im using RED robot framework editor with Java. Though i have added the jar file that contains
'com/github/markusbernhardt/selenium2library/utils/WebDriverCache', it errors as "NoClassDefFoundError"
I use robotframework-selenium2library-java-1.4.0.8 for creating java library.
Below is the console command generated in RED editor.
Command: C:\jython2.7.0\bin\jython.exe -J-Dpython.path=C:\jython2.7.0\Lib\site-packages -J-cp .;C:\Java\JarsKCC\Misc.jar;C:\Java\JarsKCC\KCCUtils.jar;C:\Java\JarsKCC\GetElementList.jar;C:\jython2.7.0\selenium-server-standalone-3.3.1.jar;C:\jython2.7.0\robotframework-selenium2library-java-1.4.0.8 -m robot.run -P C:\jython2.7.0\Lib\site-packages\Selenium2Library --listener C:\Users\CON_RT~1\AppData\Local\Temp\RobotTempDir2533122362618779828\TestRunnerAgent.py:56178:False -s KCC_Automation.TestSuites.TestSeparateWebdriverInstance C:\Java\Workspace\KCC_Automation
Suite Executor: Robot Framework 3.0.2 (Jython 2.7.0 on java1.8.0_121)
Error received while execution is,
[ ERROR ] Unexpected error: NoClassDefFoundError:
com/github/markusbernhardt/selenium2library/utils/WebDriverCache
java.lang.NoClassDefFoundError:
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.privateGetPublicMethods(Class.java:2902)
at java.lang.Class.getMethods(Class.java:1615)
at robot.utils.importer$py.import_$32(C:\jython2.7.0\Lib\site-packages\robot\utils\importer.py:274)
at robot.utils.importer$py.call_function(C:\jython2.7.0\Lib\site-packages\robot\utils\importer.py)
at robot.utils.importer$py._import_class_or_module$5(C:\jython2.7.0\Lib\site-packages\robot\utils\importer.py:77)
at robot.utils.importer$py.call_function(C:\jython2.7.0\Lib\site-packages\robot\utils\importer.py)
at robot.utils.importer$py.import_class_or_module$4(C:\jython2.7.0\Lib\site-packages\robot\utils\importer.py:74)
at robot.utils.importer$py.call_function(C:\jython2.7.0\Lib\site-packages\robot\utils\importer.py)
at robot.model.visitor$py.visit_suite$2(C:\jython2.7.0\Lib\site-packages\robot\model\visitor.py:88)
at robot.model.visitor$py.call_function(C:\jython2.7.0\Lib\site-packages\robot\model\visitor.py)
at robot.model.testsuite$py.visit$19(C:\jython2.7.0\Lib\site-packages\robot\model\testsuite.py:161)
at robot.model.testsuite$py.call_function(C:\jython2.7.0\Lib\site-packages\robot\model\testsuite.py)
at robot.model.itemlist$py.visit$11(C:\jython2.7.0\Lib\site-packages\robot\model\itemlist.py:75)
at robot.model.itemlist$py.call_function(C:\jython2.7.0\Lib\site-packages\robot\model\itemlist.py)
at robot.model.visitor$py.visit_suite$2(C:\jython2.7.0\Lib\site-packages\robot\model\visitor.py:88)
at robot.model.visitor$py.call_function(C:\jython2.7.0\Lib\site-packages\robot\model\visitor.py)
at robot.model.testsuite$py.visit$19(C:\jython2.7.0\Lib\site-packages\robot\model\testsuite.py:161)
at robot.model.testsuite$py.call_function(C:\jython2.7.0\Lib\site-packages\robot\model\testsuite.py)
at robot.model.itemlist$py.visit$11(C:\jython2.7.0\Lib\site-packages\robot\model\itemlist.py:75)
at robot.model.itemlist$py.call_function(C:\jython2.7.0\Lib\site-packages\robot\model\itemlist.py)
at robot.model.visitor$py.visit_suite$2(C:\jython2.7.0\Lib\site-packages\robot\model\visitor.py:88)
at robot.model.visitor$py.call_function(C:\jython2.7.0\Lib\site-packages\robot\model\visitor.py)
at robot.model.testsuite$py.visit$19(C:\jython2.7.0\Lib\site-packages\robot\model\testsuite.py:161)
at robot.model.testsuite$py.call_function(C:\jython2.7.0\Lib\site-packages\robot\model\testsuite.py)
at robot.utils.application$py._execute$10(C:\jython2.7.0\Lib\site-packages\robot\utils\application.py:94)
at robot.utils.application$py.call_function(C:\jython2.7.0\Lib\site-packages\robot\utils\application.py)
at robot.utils.application$py.execute_cli$5(C:\jython2.7.0\Lib\site-packages\robot\utils\application.py:49)
at robot.utils.application$py.call_function(C:\jython2.7.0\Lib\site-packages\robot\utils\application.py)
at runpy$py._run_code$9(C:\jython2.7.0\Lib\runpy.py:73)
at runpy$py.call_function(C:\jython2.7.0\Lib\runpy.py)
at runpy$py._run_module_as_main$14(C:\jython2.7.0\Lib\runpy.py:161)
at runpy$py.call_function(C:\jython2.7.0\Lib\runpy.py)
Caused by: java.lang.ClassNotFoundException:
com.github.markusbernhardt.selenium2library.utils.WebDriverCache
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 190 more
Java code I used from this blog
Note: I also verified with the dependency jar file 'robotframework-selenium2library-java-1.4.0.8-jar-with-dependencies'. I still face the same issue.
The examples in the 'blog' / stackoverflow post had some issues, with the key one being that the name of the class was changed since the answer was written on SO. However, when I compiled the jar file and added the jar file to the class path section of the red.xml none of the errors mentioned in the question were encountered. As the referred SO question had two approaches, I tried them both.
It appears to me that you have specified the directory and not the jar file for the robotframework-selenium2library-java-1.4.0.8.
C:\jython2.7.0\bin\jython.exe
-J-Dpython.path=C:\jython2.7.0\Lib\site-packages
-J-cp .
;C:\Java\JarsKCC\Misc.jar
;C:\Java\JarsKCC\KCCUtils.jar
;C:\Java\JarsKCC\GetElementList.jar
;C:\jython2.7.0\selenium-server-standalone-3.3.1.jar
;C:\jython2.7.0\robotframework-selenium2library-java-1.4.0.8
-m robot.run
-P C:\jython2.7.0\Lib\site-packages\Selenium2Library
--listener C:\Users\CON_RT~1\AppData\ ... \TestRunnerAgent.py:56178:False
-s KCC_Automation.TestSuites.TestSeparateWebdriverInstance
C:\Java\Workspace\KCC_Automation
So my advice is to change this so that the classpath reflects the jar file:
;C:\jython2.7.0\robotframework-selenium2library-java-1.4.0.8\some-jar-name.jar
I have installed the Cloudbees SDK on my Ubuntu 12.04 system following this doc. When I run bees help I get the following message :
Exception in thread "main" java.lang.NoClassDefFoundError:
com/cloudbees/sdk/boot/Launcher Caused by:
java.lang.ClassNotFoundException: com.cloudbees.sdk.boot.Launcher at
java.net.URLClassLoader$1.run(URLClassLoader.java:217) at
java.security.AccessController.doPrivileged(Native Method) at
java.net.URLClassLoader.findClass(URLClassLoader.java:205) at
java.lang.ClassLoader.loadClass(ClassLoader.java:321) at
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) at
java.lang.ClassLoader.loadClass(ClassLoader.java:266) Could not find
the main class: com.cloudbees.sdk.boot.Launcher. Program will exit.
It's maybe useful to note that I alredy installed an older version of the Cloudbees SDK and I started by uninstalling it by removing the installation folder and the .bees folder in my home directory.
It sounds like your bees command may be trying to launch with jars from an incorrect location. Make sure that your BEES_HOME environment variable is pointing at the same directory where there bees command/script you are running comes from.
I'm new to Cloudbees and having some difficulties getting my app deployed.
My app works in my local when using bees run. It also works when I placed it in another tomcat as Tomcat\webapps\ROOT.
In case it matters, I've added a lib:
C:\Java\cloudbees-sdk-1.3.1\biblenav\webapp\WEB-INF\lib\urlrewritefilter-4.0.3.jar
My war file is 635 KB and I'm using the free account.
I've tried to deploy using bees deploy from C:\Java\cloudbees-sdk-1.3.1\biblenav\
and I've tried to deploy the war file from the bees root dir. Both times I get the error below. I've no idea what to do about it. Can anyone help? Thanks!
C:\Java\cloudbees-sdk-1.3.1>bees app:deploy -a angelwarrior/biblenav ./biblenav/webapp/biblenav.war
Deploying application angelwarrior/biblenav (environment: ): .\biblenav\webapp\biblenav.war
........................uploaded 25%
........................uploaded 50%
........................uploaded 75%
........................upload completed
deploying application to server(s)...
Apr 25, 2013 11:25:23 PM com.cloudbees.api.BeesClient applicationDeployArchive
SEVERE: Invalid application deployment response: angelwarrior/biblenav
com.cloudbees.api.BeesClientException: Server.InternalError - java.lang.IllegalArgumentException: Platform error - {{invalid_local_plugin_dir,"/etc/genapp/plugins.d/jar"},
[{genapp_plugin,validate_plugin_dir,1},
{genapp_plugin,new,1},
{genapp_deploy,resolve_plugin,2},
{genapp_deploy,apply_stages,2},
{genapp_deploy,handle_task,1},
{e2_task,dispatch_handle_task,1},
{e2_service,dispatch_info,2},
{gen_server,handle_msg,5}]}
at com.cloudbees.api.BeesClient.readResponse(BeesClient.java:1121)
at com.cloudbees.api.BeesClient.applicationDeployArchive(BeesClient.java:638)
at com.cloudbees.sdk.commands.app.ApplicationDeploy.execute(ApplicationDeploy.java:322)
at com.cloudbees.sdk.commands.Command.run(Command.java:167)
at com.cloudbees.sdk.commands.Command.run(Command.java:80)
at com.cloudbees.sdk.Bees.run(Bees.java:117)
at com.cloudbees.sdk.Bees.main(Bees.java:308)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.cloudbees.sdk.boot.Launcher.main(Launcher.java:35)
That's an unfortunately obfuscated error message, but based on on the details, it looks like you attempted to deploy the app at some point using a "-t jar" flag. This sets your runtime stack to "jar", which isn't a known stack...which led to this downstream error.
You can see a list of valid stack names to use with that -t STACK flag in the CloudBees ClickStack docs.
In your case, it sounds like you'd like to run the deployed app package with Tomcat, so you probably want one of the following commands:
For Tomcat 6:
bees app:deploy -t tomcat -a APPID WAR_FILE
For Tomcat 7:
bees app:deploy -t tomcat7 -a APPID WAR_FILE
For JBoss 7:
bees app:deploy -t jboss -a APPID WAR_FILE
Note: once you set the stack with -t, it is sticky, so you don't need to specify on subsequent deployments.
This was a confusing error for you to see, so we'll also look at cleaning up that error to be more clear.