java.lang.ClassNotFoundException: java.rmi.server.RemoteObjectInvocationHandler in Java 1.3 - java

I need to run an rmi server on java 8 and call it from java 1.3;
when i use This code:
ITest service= (Test) Naming.lookup("rmi://172.16.1.24:1009/testRmiService");
String people = service.TestMethod("hamed" );
"java.lang.ClassNotFoundException: java.rmi.server.RemoteObjectInvocationHandler"
occurred. After that I add this to java.policy:
permission java.net.SocketPermission "localhost:1009","connect, resolve";
this error will be shown :
java.rmi.UnmarshalException: error unmarshalling return; nested
exception is: java.lang.ClassNotFoundException:
java.rmi.server.RemoteObjectInvocationHandler
Please help me to call my rmi service (on java 8 ) from java 3

You haven't run rmic on your remote objects, so you are getting dynamic stubs, and 1.3 doesn't understand those.
After that I add this to java.policy:
Pointless. You aren't running a security manager, so policy file entries are not used.

Related

Error using Matlab parpool from Java on Linux

I need to use MATLAB library compiled to JAR file in my own Java application. That library uses parpool and has some parfor operators. We can use this example as a test.
On Windows it works. On Linux (Ubuntu xenial) I get the error like this but not the same:
Starting parallel pool (parpool) using the 'local_mcruserdata' profile ...
Error using parpool (line 104)
Failed to start a parallel pool. (For information in addition to the causing error, validate the profile 'local_mcruserdata' in the Cluster Profile Manager.)
Error in sample_pct (line 11)
Caused by:
Error using parallel.internal.pool.InteractiveClient>iThrowWithCause (line 666)
Failed to initialize the interactive session.
Error using parallel.internal.pool.InteractiveClient>iThrowIfBadParallelJobStatus (line 767)
The interactive communicating job failed with no message.
The error is com.mathworks.toolbox.javabuilder.MWException: Failed to start a parallel pool. (For information in addition to the causing error, validate the profile 'local_mcruserdata' in the Cluster Profile Manager.)
My MATLAB is 9.2.0.538062 (R2017a) and my JDK is 1.8.0_171 x86_64 on both systems.
If I comment line 11 (parpool function invocation) the error goes away but parfor operator does not create extra workers.
Is it a known bug and can it be fixed?
After adding setSchedulerMessageHandler(#disp); setenv('MDCE_DEBUG','true') to the example (as it was adviced in the comment) I have got the message:
matlabroot/bin/glnxa64/ctfxlauncher: error while loading shared libraries: libmwmclmcrrt.so.9.2: cannot open shared object file: No such file or directory
find matlabroot -name libmwmclmcrrt.so.9.2 gives matlabroot/runtime/glnxa64/libmwmclmcrrt.so.9.2
Adding matlabroot/runtime/glnxa64 directory to LD_LIBRARY_PATH helped!

AWS Elasticbeanstalk deployment error

We are seeing the following errors being thrown while deploying a new application version on to our elasticbeanstalk environment(Tomcat 7 , Java 6).
The eb-version-deployment.log on a running backend EC2 instance shows this:
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>ExpiredToken</Code><Message>The provided token has expired.</Message>
Exception in downloading source bundle. Exception message: S3ResponseError: 400 Bad Request
The elasticbeanstalk event log on the console shows this:
[Instance: Module: AWSEBAutoScalingGroup ConfigSet: Infra-WriteApplication2] Command failed on instance. Return code: 1 Output: Error occurred during build: Command 01downloadVersion failed .
This error started appearing all of a sudden and without any changes being done to any of our underlying infrastructure components (S3,etc).
Any ideas to resolve this ?
Thanks in advance.
Make sure that you have defined AWS Credentials file and it contains valid tokens.
export AWS_CREDENTIAL_FILE=~/.aws/aws.cred

JRE 7 update 51 breaks java swing application; get error: access denied ("java.io.SerializablePermission" "enableSubclassImplementation")

After installing JRE 7 update 51, our java swing applications doesn't work.
We have added the now required manifest attributes, so the application updates fine through java web start, and starts up, but it fails right after the log on process with the exception:
[CORBA MARSHAL 1398079699 Maybe; nested exception is:
org.omg.CORBA.MARSHAL: vmcid: SUN minor code: 211 completed: Maybe]
Caused by: access denied ("java.io.SerializablePermission" "enableSubclassImplementation")
If we use JRE 7 update 45 (or earlier versions) this error doesn't occur.
We're using Weblogic 9.2.3 as application server.
Any suggestions for solving this?
Edit: The jar files are signed with VeriSign Class 3 Code Signing
I am not sure if that's really the probelm, but in addition to the manifest attributes your application has to be signed now (New security requirements for RIAs in 7u51).
The solution was actually quite simple.
The clients needed to add the following in their {java.home}\lib\security\java.policy file:
grant codeBase "https://mydomain.com:443" {
permission java.io.SerializablePermission "enableSubclassImplementation";
}

Error while getting data Using RMI from services into WEB application

I am getting following exception while I am trying to get list of tasks, from services that I have written which are supporting hibernate 4, into web application which supports hibernate 3
java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
java.lang.ClassNotFoundException: org.hibernate.collection.internal.PersistentBag (no security manager: RMI class loader disabled)
Services ------------------> WEB
(Hibernate 4) (Hibernate 3)
Web trying to get data from services through RMI and getting above excpetion
Apparently your client doesn't see the classes in your service. One of the methods to achieve this is to have a shared rmi code base. Consider following script that adds all jars in the lib folder and your primary jar in the dist folder to rmi codebase and make them visible to the client:
#!/bin/bash
lib_path=lib
artefact=name-of-your.jar
for file in $(ls $lib_path); do
lib=$lib:$lib_path/$file
rmicodebase="$rmicodebase file:$PWD/$lib_path/$file"
done
lib=$lib:dist/$artefact:etc
rmicodebase="$rmicodebase file:$PWD/dist/$artefact"
CLASSPATH=classes:etc:$lib
echo CLASSPATH: $CLASSPATH
echo rmicodebase=$rmicodebase
java -Xmx64M -Xms64M -classpath $CLASSPATH -Djava.rmi.server.codebase="$rmicodebase" $*
I assume that you have a shared rmi registry in the central process of your server. Another possibility to achieve the class visibility is to have a separate rmi registry running in the server process:
java.rmi.registry.LocateRegistry.createRegistry(port)
and have your client connect to this registry.
regards
Leon

Ganymed SSH for java connect issue

We are using the Ganymed-SSH library and facing this error while doing SSH to another machine.
[root#XXXX test]# java -classpath .:ganymed-ssh2-build210.jar Basic
ERROR:java.io.IOException: There was a problem while connecting to 10.X.X.X:22
java.io.IOException: There was a problem while connecting to 10.X.X.X:22
at ch.ethz.ssh2.Connection.connect(Connection.java:699)
at ch.ethz.ssh2.Connection.connect(Connection.java:490)
at Basic.main(Basic.java:27)
Caused by: java.io.IOException: Key exchange was not finished, connection is closed.
at ch.ethz.ssh2.transport.KexManager.getOrWaitForConnectionInfo(KexManager.java:91)
at ch.ethz.ssh2.transport.TransportManager.getConnectionInfo(TransportManager.java:229)
at ch.ethz.ssh2.Connection.connect(Connection.java:655)
... 2 more
Caused by: java.io.IOException: Cannot read full block, EOF reached.
at ch.ethz.ssh2.crypto.cipher.CipherInputStream.getBlock(CipherInputStream.java:81)
at ch.ethz.ssh2.crypto.cipher.CipherInputStream.read(CipherInputStream.java:108)
at ch.ethz.ssh2.transport.TransportConnection.receiveMessage(TransportConnection.java:231)
at ch.ethz.ssh2.transport.TransportManager.receiveLoop(TransportManager.java:669)
at ch.ethz.ssh2.transport.TransportManager$1.run(TransportManager.java:468)
at java.lang.Thread.run(Thread.java:636)
Can anyone explain what could be the issue here? Where should we start to debug from?
SSH access from normal shell works correctly.
Probably there is some problem with your public key
ssh failed after 141742-01/02 patch on solaris 10 !
Enabled aes192/aes256 support in ssh/sshd does not work on S10u3 or older released
A workaround is to disable the use of aes192/aes256 ciphers for ssh and sshd. Change the two config files /etc/ssh/ssh_config and /etc/ssh/sshd_config and add the following line:
Ciphers aes128-ctr,aes128-cbc,arcfour,3des-cbc,blowfish-cbc
You’ll have to restart sshd to pickup the change (“svcadm restart ssh”).
Source:
http://blog.mydream.com.hk/howto/matching-cipher-is-not-supported-aes256-cbc

Categories

Resources