I have a simple Sinatra app that I will be hosting in tomcat as a war. Everything works fine when I warble it and run it in tomcat. If I set the Ruby 1.9 flag in my warble config
config.webxml.jruby.compat.version = "1.9"
then the war doesn't run and I get this error in the tomcat logs
INFO: An exception happened during JRuby-Rack startup
no such file to load -- mysinatraapp
--- System
jruby 1.6.5.1 (ruby-1.9.2-p136) (2011-12-27 1bf37c2) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_29) [darwin-x86_64-java]
Time: 2012-01-16 10:06:32 -0600
Server: Apache Tomcat/7.0.23
jruby.home: file:/apache-tomcat-7.0.23/webapps/ROOT/WEB-INF/lib/jruby-stdlib-1.6.5.1.jar!/META-INF/jruby.home
--- Context Init Parameters:
jruby.compat.version = 1.9
jruby.max.runtimes = 1
jruby.min.runtimes = 1
public.root = /
rack.env = production
--- Backtrace
LoadError: no such file to load -- mysinatraapp
require at org/jruby/RubyKernel.java:1047
require at file:/apache-tomcat-7.0.23/webapps/ROOT/WEB-INF/lib/jruby-stdlib-1.6.5.1.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36
(root) at /apache-tomcat-7.0.23/webapps/ROOT/WEB-INF/config.ru:2
instance_eval at org/jruby/RubyBasicObject.java:1720
initialize at file:/apache-tomcat-7.0.23/webapps/ROOT/WEB-INF/lib/jruby-rack-1.1.3.jar!/vendor/rack-1.3.6/rack/builder.rb:51
(root) at /apache-tomcat-7.0.23/webapps/ROOT/WEB-INF/config.ru:1
the mysinatraapp.rb file is in the war so I don't understand why it can't find it. The app runs fine when just run from the command line in jruby so I don't think it is a compatibility issue with my code and 1.9. Even just removing these lines from the web.xml
<context-param>
<param-name>jruby.compat.version</param-name>
<param-value>1.9</param-value>
</context-param>
will let the app startup fine.
The versions of my jars are
jruby-core-1.6.5.1.jar
jruby-rack-1.1.3.jar
jruby-stdlib-1.6.5.1.jar
I think this can be explained by a subtle change in load path behavior between 1.8 and 1.9 (MRI too, not just JRuby). Witness:
$ jruby -v -rpp -e 'pp $LOAD_PATH'
jruby 1.7.0.dev (ruby-1.8.7-p357) (2012-01-12 0e83d96) (Java HotSpot(TM) Client VM 1.6.0_29) [darwin-i386-java]
["/Users/nicksieger/Projects/ruby/jruby/lib/ruby/site_ruby/1.8",
"/Users/nicksieger/Projects/ruby/jruby/lib/ruby/shared",
"/Users/nicksieger/Projects/ruby/jruby/lib/ruby/1.8",
"."]
$ jruby -v --1.9 -rpp -e 'pp $LOAD_PATH'
jruby 1.7.0.dev (ruby-1.9.3-p6) (2012-01-12 0e83d96) (Java HotSpot(TM) Client VM 1.6.0_29) [darwin-i386-java]
["/Users/nicksieger/Projects/ruby/jruby/lib/ruby/site_ruby/1.9",
"/Users/nicksieger/Projects/ruby/jruby/lib/ruby/shared",
"/Users/nicksieger/Projects/ruby/jruby/lib/ruby/1.9"]
So you'll probably have to explicitly add '.' or $servlet_context.getRealPath("/WEB-INF") to the load path inside config.ru.
Related
I am trying to generate artifacts for Sabre Retrieve Itinerary.
This is the script I am using:
wsimport -keep \
-verbose \
https://developer.sabre.com/sites/default/files/resources/8258/GetReservation_1.19.0.wsdl \
-B-XautoNameResolution \
-Xnocompile
However I am getting the following warning and even though Java code gets generated I am not sure if it's correct.
[WARNING] schema_reference: Failed to read schema document 'msg-header-2_0.xsd', because 'https' access is not allowed due to restriction set by the accessExternalSchema property.
line 4 of https://developer.sabre.com/sites/default/files/resources/8258/GetReservation_1.19.0.wsdl#types?schema1
This warning is a bit weird as the WSDL contains this line:
<xsd:import namespace="http://www.ebxml.org/namespaces/messageHeader" schemaLocation="msg-header-2_0.xsd"/>
So msg-header-2_0.xsd is referenced via http, not https.
What I have tried so far:
I added jaxp.properties file to my JAVAHOME/lib and JAVAHOME/jre/lib with the following content:
javax.xml.accessExternalSchema = all
I added an additional option as suggested in this post:
-J-Djavax.xml.accessExternalSchema=all
But neither of those helped. My setup is as follows:
java -version
openjdk version "1.8.0_292"
OpenJDK Runtime Environment (Zulu 8.54.0.21-CA-macosx) (build 1.8.0_292-b10)
OpenJDK 64-Bit Server VM (Zulu 8.54.0.21-CA-macosx) (build 25.292-b10, mixed mode)
Has anybody else encountered this problem or knows how to fix it?
The following command works for me...
wsimport -J-Djavax.xml.accessExternalDTD=all -J-Djavax.xml.accessExternalSchema=all -keep -verbose https://developer.sabre.com/sites/default/files/resources/8258/GetReservation_1.19.0.wsdl -Xnocompile
I'm using Apache Ignite entity framework Nuget as a second level cache in an ApsNetCore 2.0 web application under IIS(as reverse proxy).
On my development machine (VS2017 Windows 8.1) everything works well. Wen i deploy to WindowsServer 2012 the Ignite crash at startup with :
An error occurred while starting the application.
IgniteException: Failed to load jvm.dll (Please specify IgniteConfiguration.JvmDllPath or JAVA_HOME.)
Apache.Ignite.Core.Impl.Unmanaged.Jni.JvmDll.Load(string configJvmDllPath, ILogger log)
TargetInvocationException: Exception has been thrown by the target of an invocation.
System.RuntimeTypeHandle.CreateInstance(RuntimeType type, bool publicOnly, bool noCheck, ref bool canBeCached, ref RuntimeMethodHandleInternal ctor, ref bool bNeedSecurityCheck)
IgniteException: Failed to load jvm.dll (Please specify IgniteConfiguration.JvmDllPath or JAVA_HOME.)
Apache.Ignite.Core.Impl.Unmanaged.Jni.JvmDll.Load(string configJvmDllPath, ILogger log)
Apache.Ignite.Core.Ignition.Start(IgniteConfiguration cfg)
Apache.Ignite.EntityFramework.IgniteDbConfiguration.GetOrStartIgnite(IgniteConfiguration cfg)
Apache.Ignite.EntityFramework.IgniteDbConfiguration..ctor()
I checked and re-chewed, installed the JDK , correct system variables....everything. The error don't goes away. What is interesting is the application run ok as console. When it runs under IIS(reverse proxy) it crashes at startup with the above error.
Any suggestions ?
Thank you
I managed to start the website. How ? Only with JDK 11 and explicit path to jvm.dll on app.config file:
If is not explicit in config then crashes.
The JAVA_HOME from system variable is correct set. Also the Path variable is
%JAVA_HOME%;%JAVA_HOME%\bin;%JAVA_HOME%\bin\server;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0;C:\Program Files\Microsoft\Web Platform Installer;C:\Program Files\dotnet;C:\Program Files (x86)\dotnet;C:\ProgramData\chocolatey\bin;C:\Program Files\Memurai;C:\Program Files\Java\jdk-15.0.1\bin\
Maybe is a conflict with C:\Program Files\Java\jdk-15.0.1\bin\ ? It carsh with jvm 15. But it works with jvm 11
Looks like the IIS worker process is running in 32-bit mode, so Ignite looks for a 32-bit JDK, which is not present.
And the console app runs in 64-bit mode, using 64-bit JDK, so it works.
Please check the app pool settings in IIS Manager -> Application Pools -> select the app pool you want and -> Advanced Settings.
Additionally, you can enable detailed logging to a file (since you can't see console logs in IIS) - Ignite logs all attempts to resolve the JDK path. For example, with Apache.Ignite.NLog package:
var nlogConfig = new LoggingConfiguration();
var fileTarget = new FileTarget
{
FileName = "/home/pavel/w/ignite_nlog.log"
};
nlogConfig.AddTarget("logfile", fileTarget);
nlogConfig.LoggingRules.Add(new LoggingRule("*", LogLevel.Trace, fileTarget));
LogManager.Configuration = nlogConfig;
var igniteConfig = new IgniteConfiguration
{
Logger = new IgniteNLogLogger()
};
Ignition.Start(igniteConfig);
I've checked the suggested points by Pavel Tupitsyn:
App pool aplication is 64bits (emable 32bits=false)
I've installed apache.Ignite.NLog
I'tested it on my machine and it logs well all java resolves.
I've deployed to windows server 2012 and under IIS i'm getting 'Process Failure'.
The log file looks like:
2020-12-07 19:39:38.3304|DEBUG||Starting Ignite.NET 2.9.0.50002
2020-12-07 19:39:38.3834|WARN||GC server mode is not enabled, this could lead to less than optimal performance on multi-core machines (to enable see http://msdn.microsoft.com/en-us/library/ms229357(v=vs.110).aspx).
2020-12-07 19:39:46.2534|DEBUG||Starting Ignite.NET 2.9.0.50002
so...just a warning (present on my machine too).
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info:
Apache.Ignite.Core.Common.IgniteException
at Apache.Ignite.Core.Impl.Unmanaged.Jni.JvmDll.Load(System.String, Apache.Ignite.Core.Log.ILogger)
at Apache.Ignite.Core.Ignition.Start(Apache.Ignite.Core.IgniteConfiguration)
at Nop.Web.Program.Main(System.String[])
well...adding apache.ingite.nlog throws PROCESS FAILURE
Hosting is virtual machine with Windows Server 2012 64bits
Any other ideas please....
I have a WebSphere enterprise app. Manual deployment in the IBM admin console works with no issue, but with the wsadmin scripts and jython,
AdminApp.update('%APP_NAME%', 'app', '[ -operation update -contents %EAR_FILE% -usedefaultbindings -defaultbinding.virtual.host default_host -nopreCompileJSPs -installed.ear.destination $(APP_INSTALL_ROOT)/%WAS_HOST%Network -distributeApp -nouseMetaDataFromBinary -nodeployejb -createMBeansForResources -noreloadEnabled -%ws% -validateinstall warn -noprocessEmbeddedConfig -filepermission .*\.dll=755#.*\.so=755#.*\.a=755#.*\.sl=755 -noallowDispatchRemoteInclude -noallowServiceRemoteInclude -asyncRequestDispatchType DISABLED -nouseAutoLink -noenableClientModule -clientMode isolated -novalidateSchema -MapModulesToServers [[ %MODULE_NAME% %WAR_FILE%,WEB-INF/web.xml WebSphere:cell=%WAS_HOST%Network,cluster=%CLUSTER%+WebSphere:cell=%WAS_HOST%Network,node=%WEB_NODE%,server=%WEB_NODE% ][ PobolEJB.jar PobolEJB.jar,META-INF/ejb-jar.xml WebSphere:cell=%WAS_HOST%Network,cluster=%CLUSTER%+WebSphere:cell=%WAS_HOST%Network,node=%WEB_NODE%,server=%WEB_NODE% ]]]' )
the following errors returns and the deployment failed:
com.ibm.websphere.management.application.client.AppDeploymentException:
com.ibm.websphere.management.application.client.AppDeploymentException:
[Root exception is
org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DeploymentDescriptorLoadException:
dd_in_ear_load_EXC_]
org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DeploymentDescriptorLoadException:
org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DeploymentDescriptorLoadException:
dd_in_ear_load_EXC_
I verified the war file, the ejb jar file, the deployment descriptor (application.xml), they are all correct. In fact the same automated deployment job in jenkins worked till recently.
I have done lots research on the web, and also tests with no luck.
Your comments will be greatly appreciated.
Webshphere 1.8.5.5.16
JDK 1.8
x86_64 x86_64 x86_64 GNU/Linux
In my case, for the same error message, it turned out to be an error with ear metadata - application.xml referred to an module/jar that did not exist.
I am running JBoss 7.1.1 instances and httpd + mod_cluster in the standalone mode
Machine1: JBoss 7.1.1 , Apache httpd + mod_cluster (windows 7)
Machine2 : JBoss 7.1.1 (windows 7)
I am starting the nodes in with the below command
standalone -c standalone-ha.xml -b 192.168.4.76 -u 230.0.0.4 -Djboss.server.base.dir=../standalonenode1 -Djboss.node.name=node1
standalone -c standalone-ha.xml -b 192.168.4.81 -u 230.0.0.4 -Djboss.server.base.dir=../standalonenode2 -Djboss.node.name=node2
Apache httpd is installed as a service,configured with JBoss mod cluster subsystem.
I have written a sample application to test the session replication. When the node1 is down, the session object becomes null. The following contents are from server.log file,
22:36:23,111 DEBUG [org.apache.tomcat.util.http.Cookies] (ajp--192.168.4.81-9595-1) Cookies: Parsing b[]: JSESSIONID=yzC5kdQ1jre0T2FnNhVAI6J6.standalonenode1
22:36:23,134 DEBUG [org.apache.catalina.util.StringManager] (ajp--192.168.4.81-9595-1) Can't find resource org.jboss.as.web.session.LocalStrings ModuleClassLoader for Module "deployment.sampleSession-1.0.war:main" from Service Module Loader
The above setup is completely working fine in a remote environment(windows 2012) and i tried to set it up locally with windows 7 machines.
I opened up jboss-as-web-7.1.1.Final.jar and there is no class file with the name org.jboss.as.web.session.LocalStrings.
Please help.
Thanks
Venkat
I have a war that has being working just fine under EAP 6.4.x (x currently 8, but also under 6 and 4 and so on down to 6.4.0).
The WAR has some simple JMS client features to adding a message to a queue on a remote machine. The target QBroker is ActiveMQ 5.8.0.
I use the 5.8.0 RAR to set up an adapter/connector to the remote broker and then just normal JMS client stuff to push a message into a q. All is fine with this.
Beginning the "port" from 6.4.x to 7.0.1; and I am hung up on the amq 5.8.0 RAR stuff. For starters -- not going to use any of the AMQ Artemis stuff that is part of EAP 7 (yet). Initially I want to get my WAR working under 7.0 with as few changes as possible -- so leaving RAR in place is important.
Under 6.4.x, I use the standalone profile and just deploy the RAR via CLI kinda like this:
./jboss-cli.sh --connect -c "deploy --name=${AMQ_DEPLOY_NAME} --runtime-name=${AMQ_RAR_FNAME} ${_TMPDIR}/${AMQ_RAR_FNAME}"
I then use cli to set up resource adapter, connection def/factory and admin-object for the queue.
Following the same process with EAP 7.0.1, if I use the standalone profile I get
java.lang.NoClassDefFoundError: javax/jms/JMSException
issues while trying to enable the WAR that uses the RAR. Ok so when I used standalone-full I get all sorts of variations of this sort of error:
2016-07-18 15:48:10,867 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "messaging-activemq"),
("server" => "default")
]) - failure description: {
"WFLYCTL0180: Services with missing/unavailable dependencies" => ["jboss.messaging-activemq.default is missing [jboss.http-upgrade-registry.default]"],
"WFLYCTL0288: One or more services were unable to start due to one or more indirect dependencies not being available." => {
"Services that were unable to start:" => ["jboss.messaging-activemq.default.jms.manager"],
"Services that may be the cause:" => [
"jboss.http-upgrade-registry.default",
"jboss.naming.context.java.JmsXA"
]
}
}
The above messages suggest something is wrong with the messaging-activemq stuff (or the built in artemis stuff).
In both cases, I do set my EJB default resource adapter to the RAR created above.
So what am I missing on this set up?
Some particulars about my Environment:
War doesn't have any jboss/wildfly specific DDs in it.
I do not have the AMQ RAR deployed as a static module (nor do I want to) -- it is just a jar I have deployed - like other JAR (for DB drivers) or WARS, EJB jars, etc.
cat version.txt
Red Hat JBoss Enterprise Application Platform - Version 7.0.1.GA
java -version
java version "1.8.0_92"
Java(TM) SE Runtime Environment (build 1.8.0_92-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.92-b14, mixed mode)
uname -a
Linux wellandf3 4.6.4-301.fc24.x86_64 #1 SMP Tue Jul 12 11:50:00 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
Is this NoClassDefFoundError caused by a ClassNotFoundException? If thats the case I would try to add javax.jms.api as global module.