I'm trying to optimize an application by binding its threads to different cores. To begin with, I would like to bind the entire application to a single core using the Affinity-3.0.6 package from OpenHFT.
So far I've had no luck. At first I imported the package and tried the command
AffinityLock al = AffinityLock.acquireCore();
was warned about not having JNA access, so I downloaded the jna-4.2.2 package and imported it as well.
After the second import, the same command gives the following error:
WARN Affinity - Windows JNA-based affinity not usable because it
failed to load! Reason: java.lang.NoClassDefFoundError:
com/sun/jna/platform/win32/WinDef$DWORD
and the execution is not bound to the single core.
I'm blindly trying to give the software what it wants without understanding what it needs.
i suspect youve added jna.jar, but not jna-platform.jar to your project, and the class that fails to load ispart of platform.
see docs and download links here.
Related
I'm having a node-js app on Heroku using the pdfMerge.js library.
following the documentation I'm using the stream event mechanism as a callback to identify the end of the process
then an exception is thrown :
events.js:167 Error: spawn java ENOENT.
I'm almost sure it's happening because I'm messing required java installation as described here:
pdfmerger combines multiple PDF-files into a single PDF-file. It is a node module that utilizes the Apache PDFBox Library, which the required functionality are distributed along with this module. The only requirement for this module to run, is having Java 6 or higher in the path.
I'm Not familiar enough with Heroku installation/configuration process in order to make it work.
thanks in advance
You can add Java to your app by adding the heroku/jvm buildpack like this:
$ heroku buildpacks:add -i 1 heroku/jvm
Then redeploy with git commit --allow-empty and git push heroku master.
When using the Java Attach API, I'm getting the following link error on Linux (tried it on different machines) only:
Exception in thread "main" java.lang.UnsatisfiedLinkError: sun.tools.attach.WindowsAttachProvider.tempPath()Ljava/lang/String;
at sun.tools.attach.WindowsAttachProvider.tempPath(Native Method)
at sun.tools.attach.WindowsAttachProvider.isTempPathSecure(WindowsAttachProvider.java:74)
at sun.tools.attach.WindowsAttachProvider.listVirtualMachines(WindowsAttachProvider.java:58)
at com.sun.tools.attach.VirtualMachine.list(VirtualMachine.java:134)
at sun.tools.jconsole.LocalVirtualMachine.getAttachableVMs(LocalVirtualMachine.java:151)
at sun.tools.jconsole.LocalVirtualMachine.getAllVirtualMachines(LocalVirtualMachine.java:110)
...
Interestingly, on Solaris and Windows it's working out of the box.
I tried out several combinations of specifying java.library.path to point to the directory which contains the libattach.so but with no luck.
What's wrong here?
And as a bonus question: Is there a way to see which native library is actually bound to a java class?
Different AttachProvider are used on different platforms. On Linux, it shouldn't use sun.tools.attach.WindowsAttachProvider. It is for Windows.
[solaris] sun.tools.attach.SolarisAttachProvider
[windows] sun.tools.attach.WindowsAttachProvider
[linux] sun.tools.attach.LinuxAttachProvider
This is configured in a resource file META-INF\services\com.sun.tools.attach.spi.AttachProvider (typically this file exists in tools.jar). It will search CLASSPATH to get first occurrence of this resource file and read the AttachProvider implementation class from it.
So you can probably resolve this problem by search sun.tools.attach.WindowsAttachProvider in your CLASSPATH. Possibly you have included a tools.jar from Windows.
I need to create a Java stored procedure in Oracle. I have used IBM's sample class for creating an MQ message from a simple class outside of Java EE environment. I have tested the class by itself and it is working.
My Oracle vesrion is 11i.
When I am trying to add the jars used in the simple application to load to Oralce along with my simple class, I am getting errors about class not found, even if same jars work with the test case. I am stuck with this for over a week and am desperately hoping that someone would be able to help me with it.
Kinds of errors I am getting are like this from -v flag with loadjava utility on the client
on line 326 / 327, you see this:
creating : class com/ibm/mq/jms/admin/AP loading : class
com/ibm/mq/jms/admin/AP
and then at the end starting from line 6224 to end, it indicates that the above class can’t be resolved:
com/ibm/mq/jms/admin/APRCXI: ORA-29534: referenced object
xxxx.com/ibm/mq/jms/admin/AP could not be resolved
com/ibm/mq/jms/admin/APSDX: ORA-29534: referenced object xxxx.com/ibm/mq/jms/admin/AP could not be resolved exiting : errors
resolving class com/ibm/mq/jms/admin/AP
the command I used is:
c:\Oracle\product\11.2.0\client_1\bin\loadjava.bat -f -jarsasdbobjects
-prependjarnames -stoponerror -u xxxx/yyyy#SID -v -resolve lib\jms.jar lib\com.ibm.mqjms.jar lib\com.ibm.mq.jmqi.jar lib\dhbcore.jar
lib\fscontext.jar src\com\test\javasp\mq\JmsProducer.java
I also tried with -genmissing option with some additional jars ( list I found here ), but still get similar error for a different class.
Other issue with this that I am facing is that if I get an error and try to use the dropjava command from Oracle, it doesn't work either.
I also saw from this link, that this person was successful, but unfortunately, he/she didn't indicate how they used loadjava to load the jars.
If i can provide any other information, please let me know.
If anyoneone has any idea on how to get the Java Stored Procedure to use IBM MQ working with Oracle 11i, I would really appreciate the help.
Found a detailed answer in this blog entry. I tried it and it worked for me.
In Oracle there is no concept of CLASSPATH, so the standard MQ Client install is useless. You can only load the jars reference by your app within the database schema. Classes are resolved when loaded with the -r option. You can further on specify your own resolved using -r -Resolver (schemas). (check Oracle docs for exact format). So in effect the database schemas becomes the classpath.
Using Websphere MQ classes for Java poses a number of problems, you have to ensure that the Oracle JDK version is at an appropriate support level to connect to the chosen MQ server version. Check the system requirements for websphere MQ Vx.x. You should find IBM's web references. check the support for MQ classed for java.
I have such an issue at the moment trying to connect to Mq using Oracle 10 and JDK 1.4.2. I had to recompile my Java code using JDK 1.4.x. This does not work and I assume it is because I connect to MQ 7.0.1.7 which requires JRE 1.7 as minimum.
I am working on a grails app and need to remove Tomcat plugin in order to be able to host on Google App Engine (Also to use Jetty for another project)
As instructed on Grails app engine documentation, I need to remove Tomcat as GAE apps only runs on their server.
However, I keep on getting this error (The error message is much longer, only post the first few lines):
: Unable to delete file C:\Users\Rama\.grails\1.3.7\projects\ccubemanager\plugins\tomcat-1.3.7\lib\catalina-ant.jar
at org.apache.tools.ant.taskdefs.Delete.handle(Delete.java:624)
at org.apache.tools.ant.taskdefs.Delete.removeDir(Delete.java:683)
at org.apache.tools.ant.taskdefs.Delete.removeDir(Delete.java:679)
at org.apache.tools.ant.taskdefs.Delete.execute(Delete.java:543)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor47.invoke(Unknown Source)
I am wondering if deleting the catalina-ant.jar manually would be a wise choice.
I tried to manually delete the whole /plugin directory anyway following this and it caused more mess that I cannot run any command on the app:
groovy.lang.MissingMethodException: No signature of method: java.math.BigInteger.call() is applicable for argument types: (java.lang.String) values: [target/classes]
Possible solutions: wait(), abs(), abs(), any(), wait(long), add(java.math.BigInteger)
at BuildConfig.run(BuildConfig.groovy:1)
at grails.util.BuildSettings.loadConfig(BuildSettings.groovy:653)
at grails.util.BuildSettings$loadConfig.callCurrent(Unknown Source)
at grails.util.BuildSettings.loadConfig(BuildSettings.groovy:630)
WARNING: There was an error loading the BuildConfig: No signature of method: java.math.BigInteger.call() is applicable for argument types: (java.lang.String) values: [target/classes]
Possible solutions: wait(), abs(), abs(), any(), wait(long), add(java.math.BigInteger)
I also try to start an entirely new project and uninstall tomcat, surprisingly it does not work either?
I am using Grails 1.3.7; STS 2.6.0; Windows 7
Could anyone please help, thanks alot!!
You should be able to uninstall tomcat by running the following command from the root of the project grails uninstall-plugin tomcat.
This will fail if another process has locked any of the files that the command needs to delete - this could be what is preventing catalina-ant.jar from being deleted. There are various tools available for windows that will tell you which process has a lock on a file. I've used unlocker in the past.
I have a jar application which process and converts file into csv file. I have made it to run in windows service using Java Service Wrapper. It got installed my jar application successfully when I run "InstallApp-NT. Bat" file and starts running my application when I run "app" command.
But when I try to start the service in services, its not starting and showing following message in dialog box<
Windows could not start the generic Preprocessor application on Local Computer. For more information, review the System Event Log. If this is a non-microsoft service, contact the service vendor, and refer to service-specific error code1
I have the system log file and it showing the below error message
System Event log:
--> Wrapper Started as Service
Java Service Wrapper Community Edition 3.3.2
Copyright (C) 1999-2009 Tanuki Software, Ltd. All Rights Reserved.
http://wrapper.tanukisoftware.org
Launching a JVM...
WrapperManager: Initializing...
WrapperSimpleApp:
WrapperSimpleApp: Encountered an error running main:
WrapperSimpleApp: java. Lang. NullPointerException
WrapperSimpleApp: at java. Util. Hashtable. Put(Hashtable. Java: 396)
WrapperSimpleApp: at java. Util. Properties. SetProperty(Properties. Java: 128)
WrapperSimpleApp: at java. Lang. System. SetProperty(System. Java: 701)
WrapperSimpleApp: at com. Dnb. Genericpreprocessor. Process. ProcessRunner. Main(Unknown Source)
WrapperSimpleApp: at sun. Reflect. NativeMethodAccessorImpl. Invoke0(Native Method)
WrapperSimpleApp: at sun. Reflect. NativeMethodAccessorImpl. Invoke(NativeMethodAccessorImpl. Java: 39)
WrapperSimpleApp: at sun. Reflect. DelegatingMethodAccessorImpl. Invoke(DelegatingMethodAccessorImpl. Java: 25)
WrapperSimpleApp: at java. Lang. Reflect. Method. Invoke(Method. Java: 585)
WrapperSimpleApp: at org. Tanukisoftware. Wrapper. WrapperSimpleApp. Run(WrapperSimpleApp. Java: 238)
WrapperSimpleApp: at java. Lang. Thread. Run(Thread. Java: 595)
<-- Wrapper Stopped
I don't think any error in application code because it running fine when run "app" command. Please help what I should now. Thanks in advance.
I am using the following code in com.dnb.genericpreprocessor.process.ProcessRunner class.
String projectHome = "D:\BL";
System.setProperty("project.home", projectHome);
System.setProperty("log.home",System.getenv("DBE")); ---> DBE is the envirinment variable I created in user variables.
When I run the application by giving app command... Its running the application by printing the environment value but showing the same error when I start it in service.
Answering your question update that you phrased as an answer, you need to ensure that the variable is in fact set in the specific environment where you are running the application. It appears that it is not. In fact, to avoid the NullPointerException, I would modify your code to something like:
String loghome = System.getenv("DBE");
if (loghome == null) {
// LOG A COMPLAINT that the environment variable is not set
loghome = "some reasonable default value";
}
System.setProperty("log.home", loghome);
so at least your application won't fail with an obtuse NPE if it is executed in the wrong environment.
Check com.dnb.genericpreprocessor.process.ProcessRunner if that is your code and see what data you are setting in System property. NullPointer is telling that the key or the value you passed is Null.
Check your wrapper.config; you need to have all the necessary jars in order, and each with their own index number (for some reason):
wrapper.java.classpath.1=../lib/wrapper.jar
wrapper.java.classpath.2=%JAVA_HOME%/lib/tools.jar
...
Just a first thought.
I am not familiar with the proprietary solution you are using, but it seems you somehow configured it wrong.
Looks like some parameter the wrapper should have is null and is propagating all the way up until the system is trying to set it as property.
Maybe you should put your 'DBE' enviroment in the system variables not user variables.
Windows service starts at system account.