Trouble with RMI codebase
Hi, i've created a file transfer application via RMI, it work very well, i can transfer file longer than 1 GB without any problem.
But when i copy my project with all classes to another directory, it doesn't work. I'm sure that the trouble is in the VM options :
"-Djava.rmi.server.codebase=file:E:\RMIFileTransfer\classes\ -Djava.security.policy=file:E:\RMIFileTransfer\policy\RMI.policy ", that points to the old directory. I don't want to change "E:\RMIFileTransfer\" in the VM options each time i move my project!!!
How can be java.rmi.server.codebase and java.security.policy properties setted by an user input, or in the main( String args[] ) method? (sorry for my bad english...)
(a) use a JAR file, not a directory system
(b) the codebase setting has to have the same meaning throughout the system, i.e. to the server, the registry, and the client. Obviously a file: URL is not likely to comply, because every host has its own file system. Have a look into providing the JAR file via an HTTP service and using an http: URL.
Similar Messages
-
We have during the last month started to get problems where the Vadis application
stops working. We can't figure out the cause of this.
Recent additions to the application is that we have started to use RMI for our
client communication - currently we are both using CORBA (OrbixWeb 3.1c) and RMI
- planning to get rid of CORBA. We have also some new features that increases
the amount of tasks to perform.
The system can hang both under heavy load and under off peak hours, when many
clients are connected or when nobody is using it!?! Strange...
This happens approximately once a week.
Today we managed to get a JRockit dump (with Ctrl-Break) - see attached file.
The main thread that should run all real tasks is Schemaläggare, but the stack
trace indicates a really weird place to stop. When looking at the code we can't
see how this could be either a deadlock or an infinite loop. Maybe you can make
some more out of the printout?
For example, we wonder what the timestamp row means. Almost all threads have a
timestamp of around 2200. But one thread has 1 and the other 346. What does this
mean?
We are using the following version of JRockit:
java version 1.3
Java(TM) 2 Runtime Environment, Standard Edition (build "1.3.1_CROSIS_20011213-1316")
JRockit Virtual Machine (build 3.0.1-CROSIS-2001213-1317)
with nativeThreads activated.
Do you know of any troubles with using RMI for this version. Or the combination
of RMI and CORBA/OrbixWeb?
Best regards,
Tomas L
[ProblemReport_JRockit.txt]Really don't know the answer to that question. I haven't analyzed the
problem in detail. I know that a lot of issues has been fixed since
3.0.1, and if the problem is with the VM it is likely to have been fixed.
Regards,
/Staffan
TomasLiden wrote:
Alright,
However, before taking on the job of upgrading JRockit it would be nice to know
whether the problem is likely to be solved. Or put in other words: Do you think
the problem is in the JVM or in our application?
All the best,
/Tomas
Staffan Larsen <[email protected]> wrote:
Well, as you noted, NT4 isn't a supported platform for 7.0sp4, but we
are not aware of anything that would not work. Then again, 3.0.1 isn't
supported either...
You have two choices the way I see it: 1) Use 7.0sp4 on NT4 and
hopefully it solves your problem. 2) Upgrade to W2K (but I guess that
is
hard).
Regards,
/Staffan
TomasLiden wrote:
Hi,
I guessed you would answer something like that ;-) However, our serveris running
Windows NT4 (don't remember the service pack) and on your downloadsite it says
W2K for 7.0sp4. Will that work?
/T
Staffan Larsen <[email protected]> wrote:
Hi Tomas,
JRockit 3.0.1 is pretty old at this time, so I would strongly suggest
that you upgrade to JRockit 7.0sp4 (if you need 1.3.1 compatibility),
or
JRockit 1.4.2 (if you are ok with 1.4.2 compatibility). Both version
are
available for download at
http://commerce.bea.com/showallversions.jsp?family=WLJR
Regards,
/Staffan
TomasLiden wrote:
We have during the last month started to get problems where the Vadisapplication
stops working. We can't figure out the cause of this.
Recent additions to the application is that we have started to useRMI for our
client communication - currently we are both using CORBA (OrbixWeb3.1c) and RMI
- planning to get rid of CORBA. We have also some new features thatincreases
the amount of tasks to perform.
The system can hang both under heavy load and under off peak hours,when many
clients are connected or when nobody is using it!?! Strange...
This happens approximately once a week.
Today we managed to get a JRockit dump (with Ctrl-Break) - see attachedfile.
The main thread that should run all real tasks is Schemaläggare, butthe stack
trace indicates a really weird place to stop. When looking at the
code
we can't
see how this could be either a deadlock or an infinite loop. Maybeyou can make
some more out of the printout?
For example, we wonder what the timestamp row means. Almost all threadshave a
timestamp of around 2200. But one thread has 1 and the other 346.
What
does this
mean?
We are using the following version of JRockit:
java version 1.3
Java(TM) 2 Runtime Environment, Standard Edition (build "1.3.1_CROSIS_20011213-1316")
JRockit Virtual Machine (build 3.0.1-CROSIS-2001213-1317)
with nativeThreads activated.
Do you know of any troubles with using RMI for this version. Or thecombination
of RMI and CORBA/OrbixWeb?
Best regards,
Tomas L
Problem report.
Application hangs - deadlock or loop?
We have during the last month started to get problems where the Vadisapplication stops working. We can't figure out the cause of this.
Recent additions to the application is that we have started to useRMI for our client communication - currently we are both using CORBA
(OrbixWeb 3.1c) and RMI - planning to get rid of CORBA. We have also
some new features that increases the amount of tasks to perform.
The system can hang both under heavy load and under off peak hours,when many clients are connected or when nobody is using it!?! Strange...
This happens approximately once a week.
Today we managed to get a JRockit dump (with Ctrl-Break) - see below.The main thread that should run all real tasks is Schemaläggare, but
the stack trace indicates a really weird place to stop. When looking
at the code we can't see how this could be either a deadlock or aninfinite
loop. Maybe you can make some more out of the printout?
For example, we wonder what the timestamp row means. Almost all threadshave a timestamp of around 2200. But one thread has 1 and the other
346. What does this mean?
We are using the following version of JRockit:
java version 1.3
Java(TM) 2 Runtime Environment, Standard Edition (build "1.3.1_CROSIS_20011213-1316")
JRockit Virtual Machine (build 3.0.1-CROSIS-2001213-1317)
with nativeThreads activated.
Do you know of any troubles with using RMI for this version. Or thecombination of RMI and CORBA/OrbixWeb?
Best regards,
Tomas L
================== Ctrl-Break printout ====================
====== THREAD 00000080 == Noname
State: ACTIVE, DAEMON, GCABLE
Prio: 0 (5)
Timestamp: 2232 before current stamp
Stack: 0x00000000
Code: 0x00000000
LastJava: 0x7FF8FF08
ThreadID: 0x00000E7B
### Stacktrace:
--- End of stack trace
### End of stacktrace.
=====================
====== THREAD 00000100 == RMI TCP Connection(2191)-10.40.105.193
State: ACTIVE, DAEMON, GCABLE
Prio: 0 (5)
Timestamp: 1 before current stamp
Stack: 0x00000000
Code: 0x00000000
LastJava: 0x7FF4FC44
ThreadID: 0x000006F4
### Stacktrace:
at se.sj.otm.tillampning.systemProvider.gen.RVadisClientProviderImpl.doT
illgangligaVagnar(Compiled Code)@5f5f4fee
at se.sj.otm.tillampning.systemProvider.gen.RVadisClientProviderImpl_Ske
l.dispatch(Compiled Code)@5f5f5ad1
at sun.rmi.server.UnicastServerRef.oldDispatch(Compiled Code)@5d32d44c
at sun.rmi.server.UnicastServerRef.dispatch(Compiled Code)@5d32cfc8
at sun.rmi.transport.Transport$1.run(Compiled Code)@5d32cb3f
at java.security.AccessController.doPrivileged(Native Method)@5a091990
at sun.rmi.transport.Transport.serviceCall(Compiled Code)@5d32b02d
at sun.rmi.transport.tcp.TCPTransport.handleMessages(CompiledCode)@5d32
a9c8
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(CompiledCod
e)@5d3296db
at java.lang.Thread.run(Compiled Code)@59e3328e
at java.lang.Thread.startThreadFromVM(Compiled Code)@59e33134
--- End of stack trace
### End of stacktrace.
=====================
====== THREAD 00000180 == ObjyThread
State: WAITING, NONDAEMON, GCABLE
Prio: 0 (5)
Timestamp: 2226 before current stamp
Stack: 0x00000000
Code: 0x00000000
LastJava: 0x7FF3FED8
ThreadID: 0x00000B2F
### Stacktrace:
--- End of stack trace
### End of stacktrace.
=====================
====== THREAD 00000200 == Finalizer
State: WAITING, DAEMON, GCABLE
Prio: 0 (5)
Timestamp: 2231 before current stamp
Stack: 0x00000000
Code: 0x00000000
LastJava: 0x7FF2FEB8
ThreadID: 0x00000B7A
### Stacktrace:
at java.lang.Object.wait0(Compiled Code)@59e35860
at java.lang.ref.ReferenceQueue.remove(Optimized Code)@5f7742fe
at java.lang.ref.Finalizer$FinalizerThread.run(Compiled Code)@59e35379
at java.lang.Thread.startThreadFromVM(Compiled Code)@59e33134
--- End of stack trace
### End of stacktrace.
=====================
====== THREAD 00000280 == SignalHandler
State: ACTIVE, DAEMON, GCABLE
Prio: 0 (5)
Timestamp: 2230 before current stamp
Stack: 0x00000000
Code: 0x00000000
LastJava: 0x7FEFFEF0
ThreadID: 0x00000B3C
### Stacktrace:
at java.lang.Thread.run(Compiled Code)@59e3328e
at java.lang.Thread.startThreadFromVM(Compiled Code)@59e33134
--- End of stack trace
### End of stacktrace.
=====================
====== THREAD 00000300 == Hotspot Detector
State: ACTIVE, DAEMON, GCABLE
Prio: 0 (5)
Timestamp: 2229 before current stamp
Stack: 0x00000000
Code: 0x00000000
LastJava: 0x7FEEFEE0
ThreadID: 0x0000096C
### Stacktrace:
--- End of stack trace
### End of stacktrace.
=====================
====== THREAD 00000380 == Reference Handler
State: WAITING, DAEMON, GCABLE
Prio: 0 (5)
Timestamp: 2228 before current stamp
Stack: 0x00000000
Code: 0x00000000
LastJava: 0x7FEDFEE4
ThreadID: 0x00000E30
### Stacktrace:
at java.lang.ref.Reference$ReferenceHandler.run(Compiled Code)@5a090526
at java.lang.Thread.startThreadFromVM(Compiled Code)@59e33134
--- End of stack trace
### End of stacktrace.
=====================
====== THREAD 00000400 == Thread-0
State: ACTIVE, DAEMON, GCABLE
Prio: 0 (5)
Timestamp: 2232 before current stamp
Stack: 0x00000000
Code: 0x00000000
LastJava: 0x00A5B1E0
ThreadID: 0x00000D2A
### Stacktrace:
--- End of stack trace
### End of stacktrace.
=====================
====== THREAD 00000480 == RMI TCP Accept-1
State: ACTIVE, DAEMON, GCABLE
Prio: 0 (5)
Timestamp: 2225 before current stamp
Stack: 0x00000000
Code: 0x00000000
LastJava: 0x7FE8FEA4
ThreadID: 0x00000EA0
### Stacktrace:
at java.net.ServerSocket.implAccept(Compiled Code)@5a23b775
at java.net.ServerSocket.accept(Compiled Code)@5a23b57c
at sun.rmi.transport.tcp.TCPTransport.run(Compiled Code)@5a23a9f8
at java.lang.Thread.run(Compiled Code)@59e3328e
at java.lang.Thread.startThreadFromVM(Compiled Code)@59e33134
--- End of stack trace
### End of stacktrace.
=====================
====== THREAD 00000500 == OrbixWeb Server Listener thread
State: ACTIVE, NONDAEMON, GCABLE
Prio: 0 (5)
Timestamp: 2224 before current stamp
Stack: 0x00000000
Code: 0x00000000
LastJava: 0x7FE7FEA0
ThreadID: 0x0000008E
### Stacktrace:
at java.net.ServerSocket.implAccept(Compiled Code)@5a23b775
at java.net.ServerSocket.accept(Compiled Code)@5a23b57c
at IE.Iona.OrbixWeb.CORBA.Listener.acceptNewConnection(CompiledCode)@5a
2f429e
at IE.Iona.OrbixWeb.CORBA.Listener.run(Compiled Code)@5a2f3e37
at java.lang.Thread.run(Compiled Code)@59e3328e
at java.lang.Thread.startThreadFromVM(Compiled Code)@59e33134
--- End of stack trace
### End of stacktrace.
=====================
====== THREAD 00000580 == Request Processor
State: WAITING, NONDAEMON, GCABLE
Prio: 0 (5)
Timestamp: 2223 before current stamp
Stack: 0x00000000
Code: 0x00000000
LastJava: 0x7FE6FEA0
ThreadID: 0x00000E0E
### Stacktrace:
at IE.Iona.OrbixWeb.CORBA.EventHandler.nextRequest(CompiledCode)@5a2f78
fc
at IE.Iona.OrbixWeb.CORBA.BOAImpl.processOneEvent(CompiledCode)@5a2f763
b
at IE.Iona.OrbixWeb.CORBA.BOAImpl.processEvents(Compiled Code)@5a2f418b
at IE.Iona.OrbixWeb.CORBA.EventHandler.run(Compiled Code)@5a2f3c8d
at java.lang.Thread.run(Compiled Code)@59e3328e
at java.lang.Thread.startThreadFromVM(Compiled Code)@59e33134
--- End of stack trace
### End of stacktrace.
=====================
====== THREAD 00000600 == RMI TCP Accept-2
State: ACTIVE, DAEMON, GCABLE
Prio: 0 (5)
Timestamp: 2222 before current stamp
Stack: 0x00000000
Code: 0x00000000
LastJava: 0x7FE5FEA4
ThreadID: 0x00000680
### Stacktrace:
at java.net.ServerSocket.implAccept(Compiled Code)@5a23b775
at java.net.ServerSocket.accept(Compiled Code)@5a23b57c
at sun.rmi.transport.tcp.TCPTransport.run(Compiled Code)@5a23a9f8
at java.lang.Thread.run(Compiled Code)@59e3328e
at java.lang.Thread.startThreadFromVM(Compiled Code)@59e33134
--- End of stack trace
### End of stacktrace.
=====================
====== THREAD 00000680 == RMI Reaper
State: WAITING, NONDAEMON, GCABLE
Prio: 0 (5)
Timestamp: 2221 before current stamp
Stack: 0x00000000
Code: 0x00000000
LastJava: 0x7FE4FEA0
ThreadID: 0x000008FB
### Stacktrace:
--- End of stack trace
### End of stacktrace.
=====================
====== THREAD 00000700 == GC Daemon
State: WAITING, DAEMON, GCABLE
Prio: 0 (5)
Timestamp: 2220 before current stamp
Stack: 0x00000000
Code: 0x00000000
LastJava: 0x7FE3FEC4
ThreadID: 0x00000927
### Stacktrace:
--- End of stack trace
### End of stacktrace.
=====================
====== THREAD 00000780 == Thread-11
State: WAITING, NONDAEMON, GCABLE
Prio: 0 (5)
Timestamp: 2213 before current stamp
Stack: 0x00000000
Code: 0x00000000
LastJava: 0x7FE2FEC8
ThreadID: 0x00000CF1
### Stacktrace:
--- End of stack trace
### End of stacktrace.
=====================
====== THREAD 00000800 == Gtpl
State: ACTIVE, NONDAEMON, GCABLE
Prio: 0 (5)
Timestamp: 2204 before current stamp
Stack: 0x00000000
Code: 0x00000000
LastJava: 0x7FE1FDC8
ThreadID: 0x00000B01
### Stacktrace:
--- End of stack trace
### End of stacktrace.
=====================
====== THREAD 00000880 == Pbok
State: ACTIVE, NONDAEMON, GCABLE
Prio: 0 (5)
Timestamp: 2203 before current stamp
Stack: 0x00000000
Code: 0x00000000
LastJava: 0x7FE0FDC8
ThreadID: 0x00000A27
### Stacktrace:
--- End of stack trace
### End of stacktrace.
=====================
====== THREAD 00000900 == Beval
State: ACTIVE, NONDAEMON, GCABLE
Prio: 0 (5)
Timestamp: 2202 before current stamp
Stack: 0x00000000
Code: 0x00000000
LastJava: 0x7FDFFDC8
ThreadID: 0x00000C27
### Stacktrace:
at java.net.SocketInputStream.read0(Optimized Code)@5f776df9
at java.net.SocketInputStream.read(Optimized Code)@5f776e42
at java.io.DataInputStream.readInt(Optimized Code)@5f58a2df
at com.ibm.mq.MQInternalCommunications.receive(Optimized Code)@5f762c43
at com.ibm.mq.MQSESSIONClient.MQGET(Optimized Code)@5f74a056
at com.ibm.mq.MQQueue.get(Optimized Code)@5f76e931
at se.sj.otm.ramverk.hostConnection.communication.MQPoll.execute(Optimiz
ed Code)@5f8fc96f
at se.sj.otm.basobjekt.Poll.run(Compiled Code)@5a35db6f
at java.lang.Thread.startThreadFromVM(Compiled Code)@59e33134
--- End of stack trace
### End of stacktrace.
=====================
====== THREAD 00000980 == Kal
State: ACTIVE, NONDAEMON, GCABLE
Prio: 0 (5)
Timestamp: 2201 before current stamp
Stack: 0x00000000
Code: 0x00000000
LastJava: 0x7FDEFDC8
ThreadID: 0x0000064A
### Stacktrace:
--- End of stack trace
### End of stacktrace.
=====================
====== THREAD 00000a00 == OrbixWeb Connection Monitor thread
State: WAITING, DAEMON, GCABLE
Prio: 0 (5)
Timestamp: 2218 before current stamp
Stack: 0x00000000
Code: 0x00000000
LastJava: 0x7FDDFEC8
ThreadID: 0x00000968
### Stacktrace:
--- End of stack trace
### End of stacktrace.
=====================
====== THREAD 00000a80 == Connection[IIOP, Socket[addr=nttmd51.sj.se/10.54.132.9
5,port=1574,localport=1977], is_daemon]
State: ACTIVE, DAEMON, GCABLE
Prio: 0 (5)
Timestamp: 2217 before current stamp
Stack: 0x00000000
Code: 0x00000000
LastJava: 0x7FDCFEA4
ThreadID: 0x000007AA
### Stacktrace:
--- End of stack trace
### End of stacktrace.
=====================
====== THREAD 00000b80 == Thread-9
State: WAITING, NONDAEMON, GCABLE
Prio: 0 (5)
Timestamp: 2215 before current stamp
Stack: 0x00000000
Code: 0x00000000
LastJava: 0x7FDAFEC8
ThreadID: 0x00000F58
### Stacktrace:
--- End of stack trace
### End of stacktrace.
=====================
====== THREAD 00000c00 == Thread-10
State: WAITING, NONDAEMON, GCABLE
Prio: 0 (5)
Timestamp: 2214 before current stamp
Stack: 0x00000000
Code: 0x00000000
LastJava: 0x7FD9FEC8
ThreadID: 0x00000302
### Stacktrace:
--- End of stack trace
### End of stacktrace.
=====================
====== THREAD 00000c80 == Thread-12
State: WAITING, NONDAEMON, GCABLE
Prio: 0 (5)
Timestamp: 2212 before current stamp
Stack: 0x00000000
Code: 0x00000000
LastJava: 0x7FD8FEC8
ThreadID: 0x00000D52
### Stacktrace:
--- End of stack trace
### End of stacktrace.
=====================
====== THREAD 00000d00 == Thread-13
State: WAITING, NONDAEMON, GCABLE
Prio: 0 (5)
Timestamp: 2211 before current stamp
Stack: 0x00000000
Code: 0x00000000
LastJava: 0x7FD7FEC8
ThreadID: 0x00000ABC
### Stacktrace:
--- End of stack trace
### End of stacktrace.
=====================
====== THREAD 00000d80 == Thread-14
State: WAITING, NONDAEMON, GCABLE
Prio: 0 (5)
Timestamp: 2210 before current stamp
Stack: 0x00000000
Code: 0x00000000
LastJava: 0x7FD6FEC8
ThreadID: 0x000008F5
### Stacktrace:
--- End of stack trace
### End of stacktrace.
=====================
====== THREAD 00000e00 == Thread-15
State: WAITING, NONDAEMON, GCABLE
Prio: 0 (5)
Timestamp: 2209 before current stamp
Stack: 0x00000000
Code: 0x00000000
LastJava: 0x7FD5FEC8
ThreadID: 0x000001C2
### Stacktrace:
--- End of stack trace
### End of stacktrace.
=====================
====== THREAD 00000e80 == Thread-16
State: WAITING, NONDAEMON, GCABLE
Prio: 0 (5)
Timestamp: 2208 before current stamp
Stack: 0x00000000
Code: 0x00000000
LastJava: 0x7FD4FEC8
ThreadID: 0x0000078E
### Stacktrace:
--- End of stack trace
### End of stacktrace.
=====================
====== THREAD 00000f00 == Schemalõggare
State: ACTIVE, NONDAEMON, GCABLE
Prio: 0 (5)
Timestamp: 2207 before current stamp
Stack: 0x00000000
Code: 0x00000000
LastJava: 0x7FD3FA0C
ThreadID: 0x00000AC0
### Stacktrace:
at se.sj.otm.vagnstyrningsplanering.optimeringsmodell.AggregeradTomvagns
fordelningsmodell.minskaReservationerUtanBehovspaverkan(Compiled Code)@5f5e6678
at se.sj.otm.vagnstyrningsplanering.optimeringsmodell.AggregeradTomvagns
fordelningsmodell.anpassaReservationerTillKapacitetsminskning(CompiledCode)@5f5
e6945
at se.sj.otm.vagnstyrningsplanering.tomvagnstyrning.impl.Godsvagnstyrnin
gsplanImpl.forandradTillgangligKapacitetITaglagen(Compiled Code)@5d33750a
at java.lang.reflect.Method.invoke(Native Method)@5a0c225e
at se.sj.otm.verksamhetsobjekt.trafikoperator.impl.ArgumentFormedlareImp
l.invokeMethod(Compiled Code)@5a5f545e
at se.sj.otm.vagnstyrningsplanering.tomvagnstyrning.impl.Godsvagnstyrnin
gsplanImpl.anropaVagnstyrningsplanerare(Optimized Code)@5f8fdba5
at se.sj.otm.verksamhetsobjekt.fordon.impl.GodsvagnparkImpl.anropaVagnst
yrningsplanerare(Compiled Code)@5a5f511f
at se.sj.otm.verksamhetsobjekt.fordon.impl.GodsvagnparkImpl.forandradTil
lgangligKapacitetITaglagen(Compiled Code)@5d337101
at se.sj.otm.verksamhetsobjekt.fordon.impl.GodsvagnparkImpl.genomforRese
rvationslistor(Optimized Code)@5f8fee98
at se.sj.otm.verksamhetsobjekt.fordon.impl.GodsvagnparkImpl.genomforOnsk
adeReservationer(Optimized Code)@5f7a4c4a
at se.sj.otm.verksamhetsobjekt.fordon.impl.GodsvagnparkImpl.hanteraSvarF
ranPlaneraren(Compiled Code)@5d330a01
at se.sj.otm.verksamhetsobjekt.fordon.impl.GodsvagnparkImpl.forberedFixe
raTomtransporter(Optimized Code)@5f799aab
at se.sj.otm.verksamhetsobjekt.fordon.impl.GodsvagnparkImpl.fixeraTomtra
nsporter(Compiled Code)@5f5c81d1
at se.sj.otm.verksamhetsobjekt.tidtabell.impl.TidtabellImpl.utforFortida
Fixering(Compiled Code)@5f74b166
at java.lang.reflect.Method.invoke(Native Method)@5a0c225e
at se.sj.otm.ramverk.scheduler.OTAssignment.perform(OptimizedCode)@5f76
b227
at se.sj.otm.ramverk.scheduler.OTScheduler.performNextAssignment(Optimiz
ed Code)@5f900796
at se.sj.otm.ramverk.scheduler.OTScheduler.execute(OptimizedCode)@5f904
b9d
at se.sj.otm.basobjekt.Poll.run(Compiled Code)@5a35db6f
at java.lang.Thread.startThreadFromVM(Compiled Code)@59e33134
--- End of stack trace
### End of stacktrace.
=====================
====== THREAD 00000f80 == TidsstyrdUppdragsk÷
State: WAITING, NONDAEMON, GCABLE
Prio: 0 (5)
Timestamp: 2206 before current stamp
Stack: 0x00000000
Code: 0x00000000
LastJava: 0x7FD2FEC0
ThreadID: 0x00000B34
### Stacktrace:
--- End of stack trace
### End of stacktrace.
=====================
====== THREAD 00001000 == TidsstyrdUppdragsk÷
State: WAITING, NONDAEMON, GCABLE
Prio: 0 (5)
Timestamp: 2205 before current stamp
Stack: 0x00000000
Code: 0x00000000
LastJava: 0x7FD1FEC0
ThreadID: 0x00000AC2
### Stacktrace:
--- End of stack trace
### End of stacktrace.
=====================
====== THREAD 00001080 == AWT-EventQueue-0
State: WAITING, NONDAEMON, GCABLE
Prio: 0 (5)
Timestamp: 2200 before current stamp
Stack: 0x00000000
Code: 0x00000000
LastJava: 0x7FD0FEA0
ThreadID: 0x000001B1
### Stacktrace:
--- End of stack trace
### End of stacktrace.
=====================
====== THREAD 00001100 == SunToolkit.PostEventQueue-0
State: WAITING, NONDAEMON, GCABLE
Prio: 0 (5)
Timestamp: 2199 before current stamp
Stack: 0x00000000
Code: 0x00000000
LastJava: 0x7FCFFED4
ThreadID: 0x00000E2E
### Stacktrace:
at sun.awt.PostEventQueue.run(Compiled Code)@5a3bde4e
at java.lang.Thread.startThreadFromVM(Compiled Code)@59e33134
--- End of stack trace
### End of stacktrace.
=====================
====== THREAD 00001180 == Thread-20
State: CREATED, DAEMON, GCABLE
Prio: 0 (6)
Timestamp: 2232 before current stamp
Stack: 0x00000000
Code: 0x00000000
LastJava: 0x7FCEFF58
ThreadID: 0x000000A2
### Stacktrace:
No stack trace for unstarted threads.
### End of stacktrace.
=====================
====== THREAD 00001200 == AWT-Windows
State: ACTIVE, DAEMON, GCABLE
Prio: 0 (6)
Timestamp: 2197 before current stamp
Stack: 0x00000000
Code: 0x00000000
LastJava: 0x7FCDFEBC
ThreadID: 0x00000D0A
### Stacktrace:
at COM.jrockit.awt.WToolkit.run(Compiled Code)@5a3bdfe9
at java.lang.Thread.run(Compiled Code)@59e3328e
at java.lang.Thread.startThreadFromVM(Compiled Code)@59e33134
--- End of stack trace
### End of stacktrace.
=====================
====== THREAD 00001280 == RMI LeaseChecker
State: WAITING, DAEMON, GCABLE
Prio: 0 (5)
Timestamp: 346 before current stamp
Stack: 0x00000000
Code: 0x00000000
LastJava: 0x7FCCFEBC
ThreadID: 0x000007C0
### Stacktrace:
--- End of stack trace
### End of stacktrace.
===================== -
Hello,
i have installed Tomcat in a path with whitespaces. Our Application use RMI (as server componend) to communicate with other Applications.
when I start Tomcat i get an Exception like this:
(by the way: no protocol: Audit -> Audit is a part of the path with whitespaces and it is nessessary that the tool runs with whitespaces in the path e.g. Program Files)
java.rmi.ServerException: RemoteException occurred in server thread; nested exce
ption is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
tion is:
java.net.MalformedURLException: no protocol: Audit
at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:352
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:207)
at sun.rmi.transport.Transport$1.run(Transport.java:148)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
i have write a system parameter with -djava lfor rmi.server.codebase ike this and qoute the whitespaces with %20 but it doesn' t work.
file://d:/test/Tool%20Audit/
Please help me, its urgent.
Best regards
ChrisHi Chris,
the Exception java.net.MalformedURLException: no protocol: Audit means that your path is incorrect, try
<protocol>://<path>/
for Example
http://.../Audit
ftp:/.../Audit
file://../Audit -
Rmid activation fails if rmi codebase host down.
Dear activation/rmid gurus.
I have trouble with rmid activation when the host storing the codebase is down. I understand that it can't activate as long as the codebase host is down but should'nt rmid keep trying in regular intervals in case the codebase host appears.
Imagine a restart of a rmid host machine have the codebase on a local webserver (on the same host). If the rmid service is started before the webserver is up and running the activation system will not start correctly. In this case its pretty easy to fix the codebase host dependency by making sure the webserver is started before the rmi service.
Its more troublesome when the codebase is located on another host on the network. If the machines goes down, e.g. due to a powerfailure, and the rmid host machine restarts faster than the codebase host the activatable object will be out of business.
Is there some way to ensure that the rmid deamon keep trying activation its activatable objects?
\MagnusAfter some tests I finally got it working...
It appears as as the java.rmi.server.hostname property needs to be set on the java interpreter running rmid. This is achieved by passing
-J-Djava.rmi.server.hostname=yoda as argument to rmid.
\Magnus -
REF.: trouble with site in flash that should be visualized in
FULL screen as width/height parameters are set
'width','100%','height','100%' - however some people report to have
seen it very small as a “miniature”
I simply cannot explain why some people report to see the
flash site very small with Internet Explorer as I visualize it here
in full screen.
To be honest with Firefox 2 the same happens here , it does
not open in full screen.
I´ve pasted bellow the html source code employed ; The
script is Adobe´s AC_RunActiveContent.js //v1.0
Could someone please help me out ?
Thank you
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<title> </title>
<META NAME="description" CONTENT="">
<META NAME="keywords" CONTENT="">
<meta http-equiv="Content-Type" content="text/html;">
<script src="scripts/AC_RunActiveContent.js"
type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href
="giovannirocco_css/giovannirocco.css" />
</head>
<body>
<div align="center">
<script type="text/javascript">
AC_FL_RunContent( 'codebase','
http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0','wid th','100%','height','100%','src','flash/giovannirocco_0','quality','high','pluginspage','h ttp://www.macromedia.com/go/getflashplayer','movie','flash/giovannirocco_0'
); //end AC code
</script>
<noscript>
<object
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="
http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0"
width="100%" height="100%">
<param name="movie" value="flash/giovannirocco_0.swf"
/>
<param name="quality" value="high" />
<embed src="flash/giovannirocco_0.swf" quality="high"
pluginspage="
http://www.macromedia.com/go/getflashplayer"
type="application/x-shockwave-flash" width="100%" height="100%">
</embed>
</object>
</noscript>
</div>
</body>
</html>Hey ! anyone to help me please ?
-
Trouble: java.rmi.ServerException:
Hi all,
I tried to execute the example given in Sun tutorial.
I am getting the following error
Trouble: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: CalculatorImpl_Stub
ThanksHi,
This exception means the client attempted to download a stub from the server and couldn't find it.
You can get this exception for a variety of reasons:
1) The server-side doesn't have the stub. This is done by running the rmic tool against the implementation of a remote Interface
2) The server doesn't store the stub where the client can find it. This may be due to setting the System property java.rmi.server.codebase incorrectly, or not at all.
3) The server doesn't serve ("export") the stub. The server must have rmiregistry runnning on the server, and must make sure the rmiregistry CANNOT see the exportable object via its CLASSPATH.
3) The client is looking in the wrong place for the stub.
Anil.
Developer Technical Support
Sun Microsystem Inc,
http://www.sun.com/developers/support -
Trouble with java security manager
I have set up a security manager for my webapp running on Tomcat. The application enables the user to write his own scripts using Javascript, that's why I need to set up a security manager.
Using Rhino as script interpreter, it is possible to use the standard java security mechanisms, e.g. using the security manager to handle the scripts' rights.
I've added the following lines to my policy file:
// give server all rights
grant codeBase "file:webapp/WEB-INF/-" {
permission java.security.AllPermission;
//rights granted to scripts
grant codeBase "file:restrictedClient" {
permission java.io.FilePermission "webapp/WEB-INF/lib/js.jar", "read";
I've assigned the scripts to the "restrictedClient" code base. However, the script execution fails as the script does not have the permission to access or define classes of any package (even standard java packages like java.lang or java.math).
In java.security, I have found the following comment:
# List of comma-separated packages that start with or equal this string
# will cause a security exception to be thrown when
# passed to checkPackageDefinition unless the
# corresponding RuntimePermission ("defineClassInPackage."+package) has
# been granted.
# by default, no packages are restricted for definition, and none of
# the class loaders supplied with the JDK call checkPackageDefinition.
#package.definition=
I now wonder, why the checkPackageDefinition is checked though there's no entry for any package to be checked.
Extending the policy file like
grant codeBase "file:restrictedClient" {
permission java.lang.RuntimePermission "accessClassInPackage.webapp/WEB-INF/classes/org/mozilla/javascript";
permission java.io.FilePermission "webapp/WEB-INF/lib/js.jar", "read";
permission java.lang.RuntimePermission "defineClassInPackage.java.io";
permission java.lang.RuntimePermission "defineClassInPackage.java.util";
permission java.lang.RuntimePermission "defineClassInPackage.java.net";
permission java.lang.RuntimePermission "defineClassInPackage.java.sql";
permission java.lang.RuntimePermission "defineClassInPackage.java.lang";
permission java.lang.RuntimePermission "defineClassInPackage.java.math";
permission java.lang.RuntimePermission "de.methodpark.pkit.facade.impl";
works, but an unpleasant feeling remains :-).
Rhino creates an own classloader for script execution. Could that be the source of the strange behaviour?
Any help would be appreciated!
Regards,
MatthiasDavid,
I was glad to see your post regarding WLS 9.2 and the troubles with enabling Java Security Manager.
Were you able to learn any more on things like - why doesn't the admin console work when the security manager is enabled with the default policy file. Also, why is it so difficult to add permissions for your own applications and get them to actually work.
I'd be curious to see if you were able to get it to work or if you have any insights or resources that can help with this as we are really struggling to get a restrictive policy file that works.
Thanks,
D -
Having trouble with my signed applet(if it's properly signed that is)
hi
I'm having trouble with my supposedly signed applet. I'm trying to execute a specific program in this case trilian from my browser. i'm using firefox
first my java code
package applet;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.io.*;
public class RunApplet extends JApplet {
JButton jButton = new JButton();
FlowLayout flowLayout1 = new FlowLayout();
public RunApplet() {
try {
init();
} catch (Exception ex) {
ex.printStackTrace();
private void init() throws Exception {
try {
this.getContentPane().setLayout(flowLayout1);
this.setSize(new Dimension(100, 200));
jButton.setText("Trillian");
jButton.addActionListener(new RunApplet_jButton_actionAdapter(this,
"\"C:\\Program Files\\Trillian\\trillian.exe\""));
this.getContentPane().add(jButton, null);
} catch (Exception e) {
e.printStackTrace();
class RunApplet_jButton_actionAdapter implements ActionListener {
private RunApplet adaptee;
private String programPath;
RunApplet_jButton_actionAdapter(RunApplet adaptee, String programPath) {
this.adaptee = adaptee;
this.programPath = programPath;
public void actionPerformed(ActionEvent e) {
try {
Runtime.getRuntime().exec(this.programPath);
} catch (IOException ex) {
}And my applet code
<html>
<body>
<!--"CONVERTED_APPLET"-->
<!-- HTML CONVERTER -->
<object
classid = "clsid:CAFEEFAC-0015-0000-0005-ABCDEFFEDCBA"
codebase = "http://java.sun.com/update/1.5.0/jinstall-1_5_0_05-windows-i586.cab#Version=5,0,50,5"
>
<PARAM NAME = CODE VALUE = "applet.RunApplet.class" >
<PARAM NAME = ARCHIVE VALUE = "myfile.jar" >
<param name = "type" value = "application/x-java-applet;jpi-version=1.5.0_05">
<param name = "scriptable" value = "false">
<comment>
<embed
type = "application/x-java-applet;jpi-version=1.5.0_05" \
CODE = "applet.RunApplet.class" \
ARCHIVE = "myfile.jar"
scriptable = false
pluginspage = "http://java.sun.com/products/plugin/index.html#download">
<noembed>
</noembed>
</embed>
</comment>
</object>
<!--
<applet CODE = "applet.RunApplet.class" ARCHIVE = "myfile.jar">
</applet>
-->
<!--"END_CONVERTED_APPLET"-->
</body>
</html>Creating my key:
keytool -genkey -alias sitekey -keystore "C:\Program Files\Java\jdk1.5.0_05\jre\lib\security\cacerts"Now the process of creating the jar file and signing it:
1. jar cf myfile.jar *.class
2. jarsigner -keystore "C:\Program Files\Java\
jdk1.5.0_05\jre\lib\security\cacerts" myfile.jar sitekeyNow this is the way i've been using then and the first time i get the "do you want to trust" screen but still i get a security exception.
Exception in thread "AWT-EventQueue-10" java.security.AccessControlException: access denied (java.io.FilePermission <<ALL FILES>> execute)
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.checkExec(Unknown Source)
at java.lang.ProcessBuilder.start(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at applet.RunApplet_jButton_actionAdapter.actionPerformed(RunApplet.java:73)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)Is there anybody who have an idea what can be wrong?
regards
thallishok i solved i myself. i assigned a different and thereby correct keystore and now it works like it should
regards
thallish -
I am having a lot of trouble with my classpath, I think. Whenever I open a html file that I wrote, it shows up class appletName not found. I'm pretty sure I am doing something wrong in my classpath. Here is my autoexec.bat file..
SET COMSPEC=C:\WINDOWS\COMMAND.COM
SET windir=C:\WINDOWS
SET winbootdir=C:\WINDOWS
SET PATH=C:\j2sdk1.4.2_01\bin;C:\WINDOWS;C:\WINDOWS\COMMAND
SET PROMPT=$p$g
SET TEMP=C:\WINDOWS\TEMP
SET TMP=C:\WINDOWS\TEMP
SET JAVA_HOME=C:\j2sdk1.4.2_01
SET CATALINA_HOME=C:\windows\desktop\apache
SET CLASSPATH=.;c:\windows\desktop;C:\windows\desktop\eclipse\resin-3.0.6\lib\jsdk-24.jar;C:\windows\desktop\eclipse\resin-3.0.6\dob\WEB-INF\classes;
SET RESIN_HOME=c:\windows\desktop\eclipse\resin-3.0.6
What am I doing wrong? Please help.. (I do set the values into regestry by opening the system information utility thingy).I can't say much about the M$ VM.
But I'll bet the applet is ignoring that CLASSPATH. It's a useless environment variable.
You've got to put your Java classes in a JAR, set that JAR equal to the codebase, and put it in the right place on the server. When a user requests the page with the applet, the codebase is downloaded from the server.
What machine have you set the CLASSPATH on? The server or the client? How would the value on one affect the other? The right thing to do is set up the codebase. - MOD -
You'll have to excuse me if I am asking stupid questions, but I can't find the information I want in the documentation. I am working on an RMI client-server project with 3 jars client.jar, common.jar, server.jar. The common jar contains a Remote interface which the client looks up, and the server implements. The stub class is contained in the server jar (obviously).
Currently our method of distribution is to distribute all 3 jars to the client machines - I want to avoid this as it is unnecessary. I would therefore like to set java.rmi.codebase property in the server so that clients can download the stub classes at run-time. OK.
Our RMI app is being distributed on an internal network - suppose on the server machine (call it "ourserver.london.uk.ourco.com", the relevant Jar file would be at /usr/bin/my_app/jars/server.jar (or wherever).
The clients lookup rmi://ourserver.london.uk.ourco.com:1099/MY_EXPORTED_REMOTE. Questions:
1. Is this RMI "system" dependent on the server having an Http server?
2. If it isn't, how do I define the codebase other than "http://..."?
3. If it is (and the machine certainly does have an http server on it), how do I specify the codebase URL for the clients, given that the server is not "under" the http server (IYSWIM)?
I'd be glad of answers to these (reasonably simple) questions.
ChrisFirst of all, I would arrange things a bit differently. In both of the cases below, we assume a http server, it's location is unimportent, but it has to be reachable from the the client. It could be the same host as the server, or a third machine.
Option #1:
client.jar -- All client class files, including all class files of remote interfaces called by the client.
server.jar -- All server class files, including all stubs, and remote interfaces implemented and their implementations.
server_dl.jar -- Just the stubs.
The client host would contain just client.jar in the classpath.
The server host would contain server.jar and server_dl.jar in its classpath
server_dl.jar would also be placed on the http server and it's url would be the server's codebase.
Option #2:
client.jar -- All client class files, but none of the remote interfaces.
server.jar -- All server class files, but none of the stubs and no remote interfaces.
interfaces.jar -- The remote interfaces shared by client and server.
server_dl.jar -- just the stubs.
The client host would need client.jar and interfaces.jar in its classpath.
The server host would need server.jar, interfaces.jar and server_dl.jar in its classpath.
server_dl.jar would also be placed on the http server and it's url would be the server's codebase.
Now to answer your questions.
1. Is this RMI "system" dependent on the server having an Http server?If you want to have the client download the server stubs, then they have to be on an http server (I think a ftp url for the codebase may also work, but I have not tried it).
2. If it isn't, how do I define the codebase other than "http://..."?
You may be able to use a ftp url in which case the url would be "ftp://....."
3. If it is (and the machine certainly does have an http server on it), how do I > specify the codebase URL for the clients, given that the server is not "under"
the http server (IYSWIM)?The downloaded class files do not have to be on a http server that is on the same host as the RMI server. The RMI server's codebase can be any valid url (reachable from the clients) The only requirement is that the class files be reachable via the codebase. You do have to configure the client's network security so that it has permission to open connections to the codebase server. -
IllegalAccessError passing object with RMI
Hi,
I am playing with RMI at the moment.
I have a Remote class that implements a Remote interface
The interface has one method which the class implements and this is to get a TestSerial object.
If I run without using a Securitymanager then there are no problems.
When I do use the SecurityManager then there is an error.
This error remains even if set the permissions in the policy file to java.security.AllPermissions
Does anyone know why this is?
thanks in advance,
J
//Start the server....
java -Djava.security.policy=policy HelloServer
In main....
HelloImpl bound in registry....
//Run the client
java -Djava.security.policy=policy HelloClient
Exception in thread "main" java.lang.IllegalAccessError: tried to access TestSerial from class $Proxy0
at $Proxy.getTestSerial(Unknown Source)
at HelloClient.main(HelloClient.jav:23)
* Remote interface
public interface Hello extends java.rmi.Remote {
TestSerial getTestSerial() throws java.rmi.RemoteException;
* Remote class
public class HelloImpl implements Hello {
public HelloImpl() {
public TestSerial getTestSerial(){
return new TestSerial();
* Server class
import java.io.*;
import java.rmi.*;
import java.rmi.server.*;
import java.rmi.registry.*;
public class HelloServer {
public HelloServer() {
public static void main(String args[]) {
System.out.println("In main....");
if (System.getSecurityManager() == null) {
System.setSecurityManager(new SecurityManager());
try {
HelloImpl obj = new HelloImpl();
Hello stub = (Hello) UnicastRemoteObject.exportObject(obj, 0);
Registry registry = LocateRegistry.createRegistry(Registry.REGISTRY_PORT);
registry.bind("Hello", stub);
System.out.println("HelloImpl bound in registry....");
catch (Exception e) {
System.out.println("HelloImpl exception: " + e.getMessage());
e.printStackTrace();
* Client class
import java.rmi.*;
import java.rmi.registry.*;
import java.io.*;
public class HelloClient {
public static void main(String args[]) {
if (System.getSecurityManager() == null) {
System.setSecurityManager(new SecurityManager());
try {
Registry registry = LocateRegistry.getRegistry();
Hello obj = (Hello) registry.lookup("Hello");
TestSerial x = obj.getTestSerial();
System.out.println(x.getName());
catch (Exception e) {
System.out.println("HelloClient exception: " + e.printStackTrace();
* TestSerial class
class TestSerial implements java.io.Serializable {
public TestSerial(){
public String getName(){
return "TestSerial";
* Policy file
grant codeBase "file:." {
permission java.net.SocketPermission "*:1024-", "accept,connect";
};class TestSerial implements java.io.Serializable {
public class TestSerial implements java.io.Serializable { -
Help with RMI tutorial (and Eclipse)
Hi!
I need a little help with RMI tutorial. I have all source files from tutorial downloaded, but I never did anything like this and don't know, how to run it. I somehow did Building a JAR File of Interface Classes from [http://download.oracle.com/docs/cd/E17409_01/javase/tutorial/rmi/compiling.html], but got stuck on simple HTTP server, I didn't understand, what to do.
Bonus question: is it possible to do those commands from Eclipse? How?
Thanks a lot!It seems that the example provided (in the link) requires a web serverNo it doesn't. It requires an HTTP server.
tomcat will be a better option which you can useThe Apache HTTP server might be more to the point.
But If you are new to RMI and need to understand the exact flow of RMI I think this will not be a better exercise to start withI agree. I would get it running without the codebase feature. This isn't as widely used as you might think, and anyway it is a deployment option not something you need to engage with much when developing.
@OP: ignore the HTTP stuff and the codebase feature and build 3 JAR files:
(a) the common stuff (remote interface, stubs if any, and any classes referecned by the remote interface)
(b) the server (the remote object itself and anything server-side it uses)
(c) the client.
The common JAR file should be deployed to both the server and the client, and both the other JARs should name it in their Class-Path entry in the manifest. -
Help! Trouble with property name="jnlp.versionEnabled" value="true"/
Trouble with <property name="jnlp.versionEnabled" value="true"/> and file: protocol.
I can't get the versionEnabled flag to work with local file system URL's.
Here is code example (NanoHTTPD.java came from here -> http://elonen.iki.fi/code/nanohttpd/) :
C:\test>dir
Volume in drive C has no label.
Volume Serial Number is CCC7-E05D
Directory of C:\test
05/08/2008 10:08 AM <DIR> .
05/08/2008 10:08 AM <DIR> ..
05/08/2008 09:44 AM 109 hello.java
05/08/2008 09:57 AM 542 hello.jnlp
04/10/2008 09:52 AM 20,547 NanoHTTPD.java
3 File(s) 21,198 bytes
2 Dir(s) 26,610,700,288 bytes free
C:\test>type hello.java
public class hello
public static void main(String[] args)
System.out.printf("Hello world\n");
C:\test>type hello.jnlp
<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="6.0+" codebase="http://localhost/" >
<!-- codebase="file:///C:/test" -->
<!-- codebase="http://localhost/" -->
<information>
<title>hello</title>
<vendor>hello</vendor>
<description>hello</description>
</information>
<resources>
<j2se version="1.6" />
<property name="jnlp.versionEnabled" value="true"/>
<jar href="hello.jar" version="1.0" />
</resources>
<application-desc main-class="hello"/>
</jnlp>
C:\test>javac NanoHTTPD.java hello.java
Note: NanoHTTPD.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: NanoHTTPD.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
C:\test>jar cvf hello__V1.0.jar hello.class
added manifest
adding: hello.class(in = 459) (out= 299)(deflated 34%)
C:\test>start java -cp . NanoHTTPD
C:\test>javaws http://localhost/hello.jnlpjava console output :
Java Web Start 1.6.0_10-beta
Using JRE version 1.6.0_10-beta Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\4381
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
m: print memory usage
o: trigger logging
p: reload proxy configuration
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
v: dump thread stack
0-5: set trace level to <n>
Hello worldchange hello.jnlp, jnlp start element to this:
<jnlp spec="6.0+" codebase="file:///C:/test" >
javaws hello.jnlpjava console output:
Java Web Start 1.6.0_10-beta
Using JRE version 1.6.0_10-beta Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\4381
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
m: print memory usage
o: trigger logging
p: reload proxy configuration
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
v: dump thread stack
0-5: set trace level to <n>
#### Java Web Start Error:
#### helloStacktrace in detail :
Detail ST:
java.lang.ClassNotFoundException: hello
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at com.sun.jnlp.JNLPClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
at com.sun.javaws.Launcher.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)Take version out of file name:
C:\test>move hello__V1.0.jar hello.jar
C:\test>javaws hello.jnlp
java console output:
Java Web Start 1.6.0_10-beta
Using JRE version 1.6.0_10-beta Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\4381
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
m: print memory usage
o: trigger logging
p: reload proxy configuration
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
v: dump thread stack
0-5: set trace level to <n>
Hello worldThe short answer is that e4x XML rocks!
Beyond that, consider that you are sending xml to Flex. For
any format other than e4x, Flex has to convert the xml into that
format. The precise algorithms Flex uses for this are not obvious
or published. This is why I have never liked using mx:Model. It
converts the xml into nested objects, but i have never been
comfortable predicting exactly what the resulting structure will
be.
Once you get an e4x xml node identified (toXMLString()), you
CAN predict exactly whate the data you want is going to be because
there is no conversion. And I and just very comfortable with xml.
Tracy -
Im a little stuck with RMI please help
Ok from the beginning
Im running jdk1.5.0_09 its located in C:\Program FIles\Java
The files are held in C:\java
I have created a simple calculator program Code below:
Calculator.java
Calculator.class
(code)
public interface Calculator
extends java.rmi.Remote {
public long add(long a, long b)
throws java.rmi.RemoteException;
public long sub(long a, long b)
throws java.rmi.RemoteException;
public long mul(long a, long b)
throws java.rmi.RemoteException;
public long div(long a, long b)
throws java.rmi.RemoteException;
} (/code)
CalculatorImpl.java
CalculatorImpl.class
(code)
public class CalculatorImpl
extends
java.rmi.server.UnicastRemoteObject
implements Calculator{
// Implementations must have an
//explicit constructor
// in order to declare the
//RemoteException exception
public CalculatorImpl()
throws java.rmi.RemoteException {
super();
public long add(long a, long b)
throws java.rmi.RemoteException {
return a + b;
public long sub(long a, long b)
throws java.rmi.RemoteException {
return a - b;
public long mul(long a, long b)
throws java.rmi.RemoteException {
return a * b;
public long div(long a, long b)
throws java.rmi.RemoteException {
return a / b;
(/code)
calculatorserver.java
calculatorserver.class
(code)
import java.rmi.Naming;
public class CalculatorServer {
public CalculatorServer() {
try {
Calculator c = new CalculatorImpl();
Naming.rebind("rmi://localhost:1099/CalculatorService", c);
} catch (Exception e) {
System.out.println("Trouble: " + e);
public static void main(String args[]) {
new CalculatorServer();
(/code)
calculatorclient.java
calculatorclient.class
(code)
import java.rmi.Naming;
import java.rmi.RemoteException;
import java.net.MalformedURLException;
import java.rmi.NotBoundException;
public class CalculatorClient {
public static void main(String[] args) {
try {
Calculator c = (Calculator)
Naming.lookup(
"rmi://localhost/CalculatorService");
System.out.println( c.sub(4, 3) );
System.out.println( c.add(4, 5) );
System.out.println( c.mul(3, 6) );
System.out.println( c.div(9, 3) );
catch (MalformedURLException murle) {
System.out.println();
System.out.println(
"MalformedURLException");
System.out.println(murle);
catch (RemoteException re) {
System.out.println();
System.out.println(
"RemoteException");
System.out.println(re);
catch (NotBoundException nbe) {
System.out.println();
System.out.println(
"NotBoundException");
System.out.println(nbe);
catch (
java.lang.ArithmeticException
ae) {
System.out.println();
System.out.println(
"java.lang.ArithmeticException");
System.out.println(ae);
(/code)
Okies now you have my code ill start with the first error
1. When i try to rmic calculatorimpl i get this error:
error: Class calculatorimpl not found.
2. I read somwhere that it auto creates the stubs for you, so i tried running: rmiregistry which ran up fine
so i ran the server and got this:
Trouble: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: Calculator
can you please helpCode tags are with brackets [] not ().
You need to specify a classpath either as an ENVIRONMENT value (CLASSPATH=) or with the command line when you start your application (-cp).
Then you are going to need a policy file or you'll get security errors. Use the standard "policy all" file found in the documentation.
grant {
permission java.security.AllPermission "", "";
};start java
-Djava.security.manager
-Djava.security.policy=%YOUR_HOME%\Security\policy.all
-cp %YOUR_HOME%
name_of_your_class -
As it says above, i have been having a lot f trouble with my ipod classic and the latest itunes update, i was unable to sync songs or anything to it and have tried every conceivable 'fix' i could find. i have run an itunes diagnostic and the results are posted below. a major problem is that when i try and view my ipod through my computer it displays nothing at all on the ipod, no files or anything, this may be the problem but i have no idea how it has happened or how i could resolve it.
This ipod holds huge sentimental value and i am loathe to buy a new one! If anybody can help it is greatly appreciated, than kyou in advanced.
Microsoft Windows 7 x64 Home Premium Edition Service Pack 1 (Build 7601)
ASUSTeK Computer Inc. K50IJ
iTunes 11.1.5.5
QuickTime not available
FairPlay 2.5.16
Apple Application Support 3.0.1
iPod Updater Library 11.1f5
CD Driver 2.2.3.0
CD Driver DLL 2.1.3.1
Apple Mobile Device 7.1.1.3
Apple Mobile Device Driver 1.64.0.0
Bonjour 3.0.0.10 (333.10)
Gracenote SDK 1.9.6.502
Gracenote MusicID 1.9.6.115
Gracenote Submit 1.9.6.143
Gracenote DSP 1.9.6.45
iTunes Serial Number 0038B8600B98D1E0
Current user is not an administrator.
The current local date and time is 2014-03-21 16:52:39.
iTunes is not running in safe mode.
WebKit accelerated compositing is enabled.
HDCP is not supported.
Core Media is supported.
Video Display Information
Intel Corporation, Mobile Intel(R) 4 Series Express Chipset Family
Intel Corporation, Mobile Intel(R) 4 Series Express Chipset Family
**** External Plug-ins Information ****
No external plug-ins installed.
Genius ID: 2fd81a1f13cf3ff25a8b4f0e8e725116
**** Device Connectivity Tests ****
iPodService 11.1.5.5 (x64) is currently running.
iTunesHelper 11.1.5.5 is currently running.
Apple Mobile Device service 3.3.0.0 is currently running.
Universal Serial Bus Controllers:
Intel(R) ICH9 Family USB Universal Host Controller - 2934. Device is working properly.
Intel(R) ICH9 Family USB Universal Host Controller - 2935. Device is working properly.
Intel(R) ICH9 Family USB Universal Host Controller - 2936. Device is working properly.
Intel(R) ICH9 Family USB Universal Host Controller - 2937. Device is working properly.
Intel(R) ICH9 Family USB Universal Host Controller - 2938. Device is working properly.
Intel(R) ICH9 Family USB Universal Host Controller - 2939. Device is working properly.
Intel(R) ICH9 Family USB2 Enhanced Host Controller - 293A. Device is working properly.
Intel(R) ICH9 Family USB2 Enhanced Host Controller - 293C. Device is working properly.
No FireWire (IEEE 1394) Host Controller found.Here is what worked for me:
My usb hub, being usb2, was too fast. I moved the wire to a usb port directory on my pc. That is a usb1 port which is slow enough to run your snyc.
Maybe you are looking for
-
ITunes 10 will not open / Reinstalled etc but Nothing Happens!!!
I was asked to upgrade in iTunes 9.2 yesterday. Update downloaded and installed ok but the program didn't open, so i tried a few things then started on reinsatlling again and again... I've reinstalled many times, removed everything with ccleaner,clea
-
I have an iPhone 4 with iOS 5.1. I want to upgrade it to iOS 6. How can I do that when iOS 7 is available in the market. I fear upgrading to ios 7 will make my phone pretty slow. Gene I want to upgrade to iOS 6. Pls advise
-
Hi All, I need to decode(sub string(field,instr(field)..... is there any equivalent function in OBIEE Regards, Guru
-
I'm new to DW CS3. I'm using a frameset structure but the frame names do not list in the target field of the properties panel (shows "_blank, _parent" etc. defaults only but no created frames). Frame names are also missing from the "GoTo URL" list of
-
Changing from 8859_1 charset to iso-8859-1
With Netscape Enterprise 4.1 the default charset seems to be 8859_1. How to change the default charset to iso-8859-1. Thanks in advance. -K.Selvakumar