CruiseControl cannot get web interface to work - java

On a fresh installation of CruiseControl, every single time I start CruiseControl, I get the following two exceptions thrown:
ontrollerAgent- Exception starting httpAdaptor
java.net.BindException: Address already in use: JVM_Bind
at java.net.PlainSocketImpl.socketBind(Native Method)
ontrollerAgent- Exception starting connectorServer
java.io.IOException: Cannot bind to URL [jrmp]: javax.naming.NameAlreadyBoundException: jrmp [Root exception is java.rmi.AlreadyBoundException: jrmp]
at javax.management.remote.rmi.RMIConnectorServer.newIOException(Unknown Source)
Before and after these nothing seems to (obviously) go wrong. And as a result, I cannot view the web dashboard of CruiseControl. Any ideas on what is going wrong here?
Full stack traces:
[cc]Feb-25 16:33:49 ontrollerAgent- Starting HttpAdaptor with CC-Stylesheets
[cc]Feb-25 16:33:49 ontrollerAgent- starting httpAdaptor
[cc]Feb-25 16:33:49 ontrollerAgent- Exception starting httpAdaptor
java.net.BindException: Address already in use: JVM_Bind
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(Unknown Source)
at java.net.ServerSocket.bind(Unknown Source)
at java.net.ServerSocket.<init>(Unknown Source)
at mx4j.tools.adaptor.PlainAdaptorServerSocketFactory.createServerSocket (PlainAdaptorServerSocketFactory.java:24)
at mx4j.tools.adaptor.http.HttpAdaptor.createServerSocket(HttpAdaptor.java:672)
at mx4j.tools.adaptor.http.HttpAdaptor.start(HttpAdaptor.java:478)
at net.sourceforge.cruisecontrol.jmx.CruiseControlControllerAgent.start(CruiseControlControllerAgent.java:172)
[truncated]
[cc]Feb-25 16:33:49 ontrollerAgent- starting rmiRegistry
[cc]Feb-25 16:33:49 ontrollerAgent- Port 1099 is already in use, so no new rmiRe
gistry is started
[cc]Feb-25 16:33:49 ontrollerAgent- starting connectorServer
[cc]Feb-25 16:33:50 ontrollerAgent- Exception starting connectorServer
java.io.IOException: Cannot bind to URL [jrmp]: javax.naming.NameAlreadyBoundException: jrmp [Root exception is java.rmi.AlreadyBoundException: jrmp]
at javax.management.remote.rmi.RMIConnectorServer.newIOException(Unknown Source)
at javax.management.remote.rmi.RMIConnectorServer.start(Unknown Source)
at net.sourceforge.cruisecontrol.jmx.CruiseControlControllerAgent.start(CruiseControlControllerAgent.java:190)
at net.sourceforge.cruisecontrol.Main.startJmxAgent(Main.java:137)
at net.sourceforge.cruisecontrol.Main.start(Main.java:115)
at net.sourceforge.cruisecontrol.launch.Launcher.run(Launcher.java:259)
at net.sourceforge.cruisecontrol.launch.Launcher.main(Launcher.java:117)
Caused by: javax.naming.NameAlreadyBoundException: jrmp [Root exception is java.
rmi.AlreadyBoundException: jrmp]
at com.sun.jndi.rmi.registry.RegistryContext.bind(Unknown Source)
at com.sun.jndi.rmi.registry.RegistryContext.bind(Unknown Source)
at javax.naming.InitialContext.bind(Unknown Source)
at javax.management.remote.rmi.RMIConnectorServer.bind(Unknown Source)
... 6 more
Caused by: java.rmi.AlreadyBoundException: jrmp
at sun.rmi.registry.RegistryImpl.bind(Unknown Source)
at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
at sun.rmi.server.UnicastServerRef.oldDispatch(Unknown Source)
at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
at sun.rmi.transport.Transport$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
[truncated]
2010-02-25 16:33:50.710::INFO: Logging to STDERR via org.mortbay.log.StdErrLog
2010-02-25 16:33:50.850::INFO: jetty-6.1.11
2010-02-25 16:33:51.161:/dashboard:INFO: Initializing Spring root WebApplicationContext

Do you have any Java program still running at the time of CC starting?
As illustrated in this thread:
I've noticed when I restart cruisecontrol I need to kill any remaining java programs or a port class error will occur.
The solution is to:
Stop cruisecontrol
Kill any remaining cvs and java programs.
Wait 30 seconds.
Start cruisecontrol.
The OP bguiz adds in the comments his own recipe:
Stop CruiseControl
Kill any remaining cvs and java programs.
Restart computer,
sc delete CruiseControl,
wrapper -i wrapper.conf.
Start CruiseControl

It looks like you just have another application server running on your machine that uses the same ports as your cruise control server.
Do you deploy Cruise Control on a new server? What server is it?
Try to stop all the servers on your machine and try to launch cruise control again.

If you are using the windows service wrapper to launch CruiseControl, the RMI port is set to 1099 by default. You can alter this port by editing the wrapper.conf file in your CruiseControl installation directory. You might want to run 'netstat' at a command prompt to list all the ports your system is currently using. Then pick one that doesn't conflict with any other server or process.
Killing all other processes isn't always an option.

Related

Apache Ignite 2.7.5: server crash with "NoClassDefFoundError: sun/nio/ch/Invoker$2"

For the current moment, this error occurred only once. Ignite starts with one node in server mode and about 30 in client mode.
In the server's log, I found this stack trace:
Failed to reinitialize local partitions (rebalancing will be stopped):
...
java.lang.NoClassDefFoundError: sun/nio/ch/Invoker$2
...
at sun.nio.ch.Invoker.invokeIndirectly(Unknown Source)
at sun.nio.ch.Invoker.invoke(Unknown Source)
at sun.nio.ch.Invoker.invoke(Unknown Source)
at sun.nio.ch.WindowsAsynchronousFileChannelImpl$ReadTask.run(Unknown Source)
at sun.nio.ch.WindowsAsynchronousFileChannelImpl.implRead(Unknown Source)
at sun.nio.ch.AsynchronousFileChannelImpl.read(Unknown Source)
at org.apache.ignite.internal.processors.cache.persistence.file.AsyncFileIO.read(AsyncFileIO.java:77)
at org.apache.ignite.internal.processors.cache.persistence.file.AbstractFileIO$1.run(AbstractFileIO.java:82)
I inspected the rt.jar the server is used and found this Invoker$2.
Also I found this sun.nio.ch.Invoker$2 in the list of loaded classes in Java VisualVM.
So I don't understand at all what's the problem.

Getting error while executing Cmd command from Java?

Please find below stacktrace for the exception
2016-12-28 16:22:15.685:INFO:osjs.Server:jetty-7.x.y-SNAPSHOT
2016-12-28 16:22:15.706:INFO:osjsh.ContextHandler:started o.s.j.s.ServletContextHandler{/,null}
2016-12-28 16:22:15.711:WARN:osjuc.AbstractLifeCycle:FAILED SocketConnector#0.0.0.0:4444: java.net.BindException: Address already
in use: JVM_Bind
java.net.BindException: Address already in use: JVM_Bind
at java.net.DualStackPlainSocketImpl.bind0(Native Method)
at java.net.DualStackPlainSocketImpl.socketBind(Unknown Source)
at java.net.AbstractPlainSocketImpl.bind(Unknown Source)
at java.net.PlainSocketImpl.bind(Unknown Source)
at java.net.ServerSocket.bind(Unknown Source)
at java.net.ServerSocket.(Unknown Source)
at java.net.ServerSocket.(Unknown Source)
The above stacktrace explain about the exception in cmd.
The exception suggests that you've got another process bound to the same port.
I assume you're running it on Windows :
The below would list all the ports and processes which are being listened:
netstat -ano
And then you could kill the process by using the pid:
taskkill -pid 011 /f <-- 011 is just a sample pid
Maybe you might have to have a look at this blog post for a better understanding.

Jenkins Tomcat deploymet error

I have been using Jenkins for quite some time for Continuous integration with my Java projects.
Recently I tried the Jenkins Deploy Plugin (https://wiki.jenkins-ci.org/display/JENKINS/Deploy+Plugin) to deploy my war file on tomcat 7. However, I am unable to do so as I am getting the following error:
Deploying C:\Program Files (x86)\Jenkins\jobs\MY_PROJS\workspace\target\projs.war to container Tomcat 7.x Remote
[C:\Program Files (x86)\Jenkins\jobs\MY_PROJS\workspace\target\projs.war] is not deployed. Doing a fresh deployment.
Deploying [C:\Program Files (x86)\Jenkins\jobs\MY_PROJS\workspace\target\projs.war]
ERROR: Publisher hudson.plugins.deploy.DeployPublisher aborted due to exception
org.codehaus.cargo.container.ContainerException: Failed to deploy [C:\Program Files (x86)\Jenkins\jobs\MY_PROJS\workspace\target\projs.war]
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.deploy(AbstractTomcatManagerDeployer.java:115)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:187)
at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:64)
at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:90)
at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:77)
at hudson.FilePath.act(FilePath.java:914)
at hudson.FilePath.act(FilePath.java:887)
at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:77)
at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:47)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:776)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1030)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:725)
at hudson.model.Run.execute(Run.java:1695)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:519)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:231)
Caused by: java.io.IOException: Error writing request body to server
at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.checkError(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.write(Unknown Source)
at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
at java.io.BufferedOutputStream.write(Unknown Source)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.pipe(TomcatManager.java:583)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:501)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deployImpl(TomcatManager.java:547)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deploy(TomcatManager.java:273)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deploy(TomcatManager.java:256)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deploy(TomcatManager.java:240)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.deploy(AbstractTomcatManagerDeployer.java:107)
... 17 more
java.io.IOException: Error writing request body to server
at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.checkError(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.write(Unknown Source)
at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
at java.io.BufferedOutputStream.write(Unknown Source)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.pipe(TomcatManager.java:583)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:501)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deployImpl(TomcatManager.java:547)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deploy(TomcatManager.java:273)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deploy(TomcatManager.java:256)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deploy(TomcatManager.java:240)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.deploy(AbstractTomcatManagerDeployer.java:107)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:187)
at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:64)
at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:90)
at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:77)
at hudson.FilePath.act(FilePath.java:914)
at hudson.FilePath.act(FilePath.java:887)
at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:77)
at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:47)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:776)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1030)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:725)
at hudson.model.Run.execute(Run.java:1695)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:519)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:231)
Thanks in advance for your help.
In most cases, errors like this are simply caused by URL parameter being incorrect.
See similar issue documented/resolved here where URL parameter was the culprit. Additionally, I highly reccomend thoroughly covering Apache Manager Documentation.
However, as mentioned in above comment, this may also be caused by version mismatch between the application itself and what is actually being deployed.

Ode server error on stopping (as well as BPEL deploy error)

I am very new to this and have been looking all through the apache forums and elsewhere for solutions, but have not been able to find anything.
Firstly, I have followed the following guides on getting Apache ODE 1.3.6 setup as well as BPEL with eclipse:
http://www-inf.it-sudparis.eu/~nguyen_n/teaching_assistant/bpel/installing_bpel_designer_and_apache_ode_on_eclipse
and the following guide to create and deploy a hello world project:
http://www-inf.it-sudparis.eu/~nguyen_n/teaching_assistant/bpel/deploying_hello_world_bpel_process_with_eclipse_bpel_designer_and_apache_ode
I have gone over others and these seem to be very on point and correct.
Now here are my two issues:
I can start the ODE server fine; but when I stop it I get an alert:
A Java Exception has Occurred
and in the console I get the following:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory
at org.apache.catalina.startup.Bootstrap.<clinit>(Bootstrap.java:60)
Caused by: java.lang.ClassNotFoundException: org.apache.juli.logging.LogFactory
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 1 more
After a minute or two the server has to be killed as it won't stop
The tomcat-juli.jar is in the classpath (or else I would also get this error when starting the server)
By second issue is:
2) When I try to deploy the HelloWorld project on the Ode server, I get the following (in the console:
11:49:54,599 WARN [ProcessStoreImpl] Deployment failed within the engine, store undeploying process.
org.apache.ode.bpel.iapi.ContextException: Could not activate endpoint for service {http://helloworld.localhost}HelloWorldService and port HelloWorldPort
at org.apache.ode.axis2.BindingContextImpl.activateMyRoleEndpoint(BindingContextImpl.java:83)
at org.apache.ode.bpel.engine.BpelProcess.activate(BpelProcess.java:588)
at org.apache.ode.bpel.engine.BpelEngineImpl.registerProcess(BpelEngineImpl.java:346)
at org.apache.ode.bpel.engine.BpelServerImpl.register(BpelServerImpl.java:321)
at org.apache.ode.axis2.ODEServer.handleEvent(ODEServer.java:665)
at org.apache.ode.axis2.ODEServer.access$100(ODEServer.java:89)
at org.apache.ode.axis2.ODEServer$ProcessStoreListenerImpl.onProcessStoreEvent(ODEServer.java:641)
at org.apache.ode.store.ProcessStoreImpl.fireEvent(ProcessStoreImpl.java:592)
at org.apache.ode.store.ProcessStoreImpl.fireStateChange(ProcessStoreImpl.java:598)
at org.apache.ode.store.ProcessStoreImpl.deploy(ProcessStoreImpl.java:311)
at org.apache.ode.store.ProcessStoreImpl.deploy(ProcessStoreImpl.java:172)
at org.apache.ode.axis2.deploy.DeploymentPoller.check(DeploymentPoller.java:160)
at org.apache.ode.axis2.deploy.DeploymentPoller.access$300(DeploymentPoller.java:60)
at org.apache.ode.axis2.deploy.DeploymentPoller$PollingThread.run(DeploymentPoller.java:251)
Caused by: org.apache.ode.axis2.OdeFault: The soap:address http://localhost:8080/HelloWorld used for service {http://helloworld.localhost}HelloWorldService and port HelloWorldPort should be of the form http://hostname:port/ode/processes/myProcessEndpointName
at org.apache.ode.axis2.hooks.ODEAxisService.extractServiceName(ODEAxisService.java:226)
at org.apache.ode.axis2.hooks.ODEAxisService.createService(ODEAxisService.java:86)
at org.apache.ode.axis2.BindingContextImpl.createService(BindingContextImpl.java:120)
at org.apache.ode.axis2.BindingContextImpl.activateMyRoleEndpoint(BindingContextImpl.java:78)
... 13 more
11:49:54,640 INFO [BpelServerImpl] Unregistered process {http://helloworld.localhost}HelloWorld-5.
11:49:54,641 ERROR [DeploymentPoller] Deployment of BPEL_HelloWorld failed, aborting for now.
org.apache.ode.bpel.iapi.ContextException: Could not activate endpoint for service {http://helloworld.localhost}HelloWorldService and port HelloWorldPort
at org.apache.ode.axis2.BindingContextImpl.activateMyRoleEndpoint(BindingContextImpl.java:83)
at org.apache.ode.bpel.engine.BpelProcess.activate(BpelProcess.java:588)
at org.apache.ode.bpel.engine.BpelEngineImpl.registerProcess(BpelEngineImpl.java:346)
at org.apache.ode.bpel.engine.BpelServerImpl.register(BpelServerImpl.java:321)
at org.apache.ode.axis2.ODEServer.handleEvent(ODEServer.java:665)
at org.apache.ode.axis2.ODEServer.access$100(ODEServer.java:89)
at org.apache.ode.axis2.ODEServer$ProcessStoreListenerImpl.onProcessStoreEvent(ODEServer.java:641)
at org.apache.ode.store.ProcessStoreImpl.fireEvent(ProcessStoreImpl.java:592)
at org.apache.ode.store.ProcessStoreImpl.fireStateChange(ProcessStoreImpl.java:598)
at org.apache.ode.store.ProcessStoreImpl.deploy(ProcessStoreImpl.java:311)
at org.apache.ode.store.ProcessStoreImpl.deploy(ProcessStoreImpl.java:172)
at org.apache.ode.axis2.deploy.DeploymentPoller.check(DeploymentPoller.java:160)
at org.apache.ode.axis2.deploy.DeploymentPoller.access$300(DeploymentPoller.java:60)
at org.apache.ode.axis2.deploy.DeploymentPoller$PollingThread.run(DeploymentPoller.java:251)
Caused by: org.apache.ode.axis2.OdeFault: The soap:address http://localhost:8080/HelloWorld used for service {http://helloworld.localhost}HelloWorldService and port HelloWorldPort should be of the form http://hostname:port/ode/processes/myProcessEndpointName
at org.apache.ode.axis2.hooks.ODEAxisService.extractServiceName(ODEAxisService.java:226)
at org.apache.ode.axis2.hooks.ODEAxisService.createService(ODEAxisService.java:86)
at org.apache.ode.axis2.BindingContextImpl.createService(BindingContextImpl.java:120)
at org.apache.ode.axis2.BindingContextImpl.activateMyRoleEndpoint(BindingContextImpl.java:78)
... 13 more
As far as I can tell the BPEL was configured to run on ODE environment, but I cannot seem to get much more out of this trace.
Any assistance is greatly appreciated, thank you!
You need to use the ODE service address:
http://localhost:8080/ode/processes/HelloWorld
As I can see from your logs your address is
http://localhost:8080/HelloWorld
It worked for me.

Java RMI (Server: TCP Connection Idle/Client: Unmarshalexception (EOFException))

I'm trying to implement Sun Tutorials RMI application that calculates Pi. I'm having some serious problems and I cant find the solution eventhough I've been searching the entire web and several javaskilled people.
I'm hoping you can put an end to my frustrations.
The crazy thing is that I can run the application from the cmd on my desktop computer. Trying the exact same thing with the exact same code in the exact same directories on my laptop produces the following errors. The problem occures when I try to connect the client to the server.
I don't believe that the error is due to my policyfile as I can run it on the desktop. It must be elsewhere. Have anyone tried the same and can you give me a hint as to where my problem is, please?
POLICYFILE SERVER:
grant
{
permission java.security.AllPermissions;
permission java.net.SocketPermission"*", "connect, resolve";
};
POLICYFILE CLIENT:
grant
{
permission java.security.AllPermissions;
permission java.net.SocketPermission"*", "connect, resolve";
};
______________________________________________
SERVERSIDE ERRORS:
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\STUDENT>cd\
C:\>start rmiregistry
C:\>java -cp c:\java;c:\java\compute.jar -Djava.rmi.server.codebase=file:/c:/jav
a/compute.jar -Djava.rmi.server.hostname=localhost -Djava.security.policy=c:/jav
a/servertest.policy engine.ComputeEngine
ComputeEngine bound
Exception in thread "RMI TCP Connection(idle)" java.security.AccessControlExcept
ion: access denied (java.net.SocketPermission 127.0.0.1:1440 accept,resolve)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkAccept(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.checkAcceptPermi
ssion(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport.checkAcceptPermission(Unknown Sour
ce)
at sun.rmi.transport.Transport$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Sou
rce)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Sour
ce)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source
)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
_______________________________
CLIENTSIDE ERRORS:
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\STUDENT>cd\
C:\>java -cp c:\java;c:\java\compute.jar -Djava.rmi.server.codebase=file:\C:\jav
a\files\ -Djava.security.policy=c:/java/clienttest.policy client.ComputePi local
host 45
ComputePi exception:
java.rmi.UnmarshalException: Error unmarshaling return header; nested exception
is:
java.io.EOFException
at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(Unkn
own Source)
at java.rmi.server.RemoteObjectInvocationHandler.invoke(Unknown Source)
at $Proxy0.executeTask(Unknown Source)
at client.ComputePi.main(ComputePi.java:18)
Caused by: java.io.EOFException
at java.io.DataInputStream.readByte(Unknown Source)
... 6 more
C:\>
Thanks in advance
Perry
Your server didn't have permission to accept a connection from that client.
Ergo your policy file wasn't where you said it was, or wasn't loaded for some other reason.
Run it with -Djava.security.debug=access,failure and you will see what protection domain you were in when the security exception occurred, and what permissions it had.
java -cp c:\java;c:\java\compute.jar -Djava.rmi.server.codebase=file:/c:/java/compute.jar -Djava.rmi.server.hostname=localhost -Djava.security.policy=c:/java/servertest.policy engine.ComputeEngine
NB a file: codebase cannot work if it refers to a local filesystem, unless the client is also in the same machine, which makes RMI fairly pointless. Codebase URLs need to refer to locations that are accessible by the client. You can use shared file systems but you must provide a URL that is usable by the client. The server doesn't use its own codebase URL at all.
I tried the same and I found that Java simply ignored the policy file, no matter where I put it or what I put into it or which option I used to make the VM pick it up.
In the end, I create my own SecurityManager in the code and did everything manually.

Categories

Resources