Is this a classpath problem?
My application runs fine from withion my IDE (Jcreator), however, when I move the .java files and compile all the files ( C:\FCPRo javac *.java ) and then try and run the driver file ( C:\FCPro java Driver ) I get null pointer exceptions all over the place.
As the wise old sage said: "Whaddup wit dat?"
Pete
Thanks for the idea, unfortunately still not having any luck.
I've got a .bat file in C:\FCPro\classes which I'm launching via a
desktop shortcut, the file looks like this:
javaw -classpath .;C:\FCPro\classes Driver2
Still getting same behavior, 3 class not found exceptions when launching
this way, however, the program runs fine within JCreator.
I added a few paths to my CLASSPATH environment variable so that it now
looks like:
.;C:\FCPro\classes;C:\java\FoodCoster\classes;C:\j2sdk1.4.1
\jre\lib\rt.jar;C:\j2sdk1.4.1\lib\tools.jar;C:\j2sdk1.4.1
\jre\lib\ext\mysql-connector-j-2.0.14-bin.jar
Any more ideas? I'd be grateful,
Pete
Change your mail options at http://p2p.wrox.com/manager.asp or
to unsubscribe send a blank email to [email protected]
Similar Messages
-
i am here stuck..
my dir structure is
c:\my\xxx\yyy\zzz
i have a code ...
package xxx.yyy.zzz;
class A
// some code
}i have compiled sucessfully and put the clsss file into c:\my\xxx\yyy\zzz folder.
now i want to import it in another class
like...
package xxx.yyy; // note this
import xxx.yyy.zzz.*; // note this
class B
// some code
// creating instance of class A here
}question is how do i compile and run it ?
i am at c:\my---> what should be the command to compile and run the above code?
plz give me the explicit command so that i can test and verify . i have given the dir structure.
i have tried several ways but got class not found exception and errors . i know its a classpath problem but i could not figure out what should i type at the c:\my prompt.
can u give exact command to run and compile the above code in steps ?
thanxquestion is how do i compile and run it ?You don't with that code. You've defined class A to have "package visibility," meaning it can't be used from outside its package. You should declare it with public visibility instead, like "public class A {...".
Once you change that, use these commands to compile and run:c:\my\>javac xxx/yyy/zzz/A.java
c:\my\>javac xxx/yyy/B.java
c:\my\>java xxx.yyy.B -
Classpath Problem (Using JSAPI)
Hi,
I using IBM Via Voice as a the implementation of the JSAPI on my system. I've downloaded the speech for java pack from IBM Alphaworks and put it in the directory of
c:\ibmjs
This gives you access to the speech packages for utilisation in your programs so I should be able to import javax.speech in my programs. However the system doesn't see these classes.
Heres my Autoexec...
path=%path%;c:\jdk1.3.1_01\bin;c:\ibmjs\lib;
CLASSPATH=%CLASSPATH%;c:\ibmjs\lib\ibmjs.jar;
I presume the whole thing is just a classpath problem, does anybody have any idea from the above paths where I am going wrong?i guess you have to put some of ibm's dll files coming with speech for java in the path (not classpath). it's not sufficient to have the directories in the path.
anyway, there come's an installation manual with speech for java which explaines all that. -
Hi everybody,
I'm having problem setting up my classpath .
I'm using mac os x (tcsh shell)..
whenever I try to set the classpath like this:
setenv CLASSPATH /Library/Tomcat/common/lib/servlet-api.jar
or anything that has CLASSPATH in front of it, would give me the following error whenever I started the shell :
CLASSPATH. :Undefined variable.
Any idea ?...I'm kinda stuck with this thing now...
Thanks in advance!
-keretabajakHi everybody,
I'm having problem setting up my classpath .
I'm using mac os x (tcsh shell)..
whenever I try to set the classpath like this:
setenv CLASSPATH
/Library/Tomcat/common/lib/servlet-api.jar
or anything that has CLASSPATH in front of it, would
give me the following error whenever I started the
shell :
CLASSPATH. :Undefined variable.
Any idea ?...I'm kinda stuck with this thing now...
Thanks in advance!
-keretabajakHi,
to see effect you should EXPORT classpath. Also you should put the setenv line in your .login file. Make backup copy first and doublecheck everything with source .login.
http://galileo.spaceports.com/~ibidris/ -
Fragment Bundle Classpath problems
Does anyone have any tips for solving classpath problems in fragment bundles? I'm getting a no-class-def that I can't explain.
I've used maven to create a fragment, hosted by com.day.crx.sling.server, to create a custom login. It needs to call a web service, so I've included httpclient-4.2.3.jar. I can see this jar listed on the deployed fragment's Bundle-ClassPath, via the osgi>bundle console. When I inspect the bundle that maven created, I can find this jar contained in the bundle jar, in the directory specified in the Bundle-ClassPath. I even oppened the httpclient jar to ensure that the offending class (org/apache/http/client/HttpClient) is there.
This is the first fragment that I've tried to build. Is there something I don't know about how they load classes?
Does anyone have any tips or tricks on solving osgi classpath problems? I read that felix has some tools, but I haven't found any documentation about them.I'm still not sure why the classes didn't load, but I have a solution to my problem - don't try to include the jars in the fragment bundle. I tracked down osgi-ready versions of the libraries that I needed and and installed them.
-
Another simple classpath problem question
Hi All
Yes I know, there are a lots of questions about this matter, but I couldn't found a solution to my problem.
I have a simple program:
public class prueba {
public static void main(String[] args) {
System.out.println("Ahi va...");
}placed in /tmp/javier/prueba.java
After compiled, I've tried to run it from / and then problems started:
cd /
java /tmp/javier/prueba
Exception in thread "main" java.lang.NoClassDefFoundError: /tmp/javier/prueba (wrong name: prueba)
I said, ok...it could be a classpath problem...then:
java -cp /tmp/javier/ /tmp/javier/prueba
Exception in thread "main" java.lang.NoClassDefFoundError: /tmp/javier/prueba
Damn, another try...
java -cp .:/tmp/javier/ /tmp/javier/prueba
Exception in thread "main" java.lang.NoClassDefFoundError: /tmp/javier/prueba (wrong name: prueba)
Jesus Christ....may be the last slash....
java -cp .:/tmp/javier /tmp/javier/prueba
Exception in thread "main" java.lang.NoClassDefFoundError: /tmp/javier/prueba (wrong name: prueba)
Oh...no.... may be classpath to java classes..
java -cp .:/usr/java/j2sdk1.4.2_01/lib/jre/:/tmp/javier/ /tmp/javier/prueba
Exception in thread "main" java.lang.NoClassDefFoundError: /tmp/javier/prueba (wrong name: prueba)
Well, I don't know why this error happens....
Please, could somebody help me !!!
Thanks in advance...
<jl>It's not too early to start following the Sun coding
conventions for Java:
http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.
tmlHi
thanks for your reply.
Yes, I agree. I use conventions with my programs. But my real problem was with a real application and then I did quickly this simple code to help others to understand the problem and give a fast reply...
Let me know if that works. (It was fine on my
machine.) - MODYes it works fine, thanks.... and Damn...Murphys law again, the only option I didn't tried is the solution to my problem... :)
Thanks again... -
Classpath problems in EAR packaging?
I try to access an EJB from a JSP. The JSP resides in web.war and the bean is in ejb.jar, and both of these are packaged together in an ear.
I get a compile error when I try opening a JSP. I've had this problem in all my attempts to use my bean classes from JSP.
My browser reports that the compiler cannot find the beans package. I have servlets within the war-file that are able to find the beans package, but the JSPs aren't.
My ear-file contains 3 files
ejb.jar
web.war
META-INF\MANIFEST.MF
The manifest classpath points to ejb.jar and web.war
My guess is that this has something to do with the way this is deployed by GlassFish.
The application is deployed in the
domains\mydomain\applications\j2ee-apps\myear\
This directory contains the expanded files:
ejb_jar\
web_war\
META-INF
So the Java classes under web_war\ are able to see the Java classes under ejb_jar\ (i.e. my servlets)
However; when GlassFish creates Java files from the JSPs and then tries to compile them, these files are placed under
domains\mydomain\generated\jsp\j2ee-apps\myear\web_war\org\apache\jsp\jsp
This might be correct for all I know, but apparently the compiler is unable to find the Java classes located under the mydomain\applications\.. directory when compiling classes located under the mydomain\generated\.. directory. There are no other files from my ear anywhere in the "generated" directory.
So to me this seems to be some kind of classpath problem, as the compiler cannot find the needed files.
Does this make any sense to anyone?
PS
In my ear, the JSPs are placed in the web.war. The war file looks like this:
jsp\
myjsp.jsp
META-INF
MANIFEST.MF
WEB-INF
web.xml
lib\
mylib.jarThanks
\\MariusMarius,
If you want communicate the bean you have to do following things.
. Create a factory for the correct protocol
. Obtain a Home
. Use the Home to create stubs to the remote object
So you want to call the Home and Remote interfaces to access the bean. When you run the client program, it will create the remote object that time it has to search the Home and Remote interfaces. So you have included those files for references in following location
WEB-INF/classes
-- <Home Interface File Name>.class
-- <Remote Interface File Name>.class
Or
WEB-INF/lib
-- <Bean Jar file name>.jar
I think you will understand.
-Mani -
again classpath problem.... i have tried to solve it in many ways but all failed. here is one
instance of my effort which did not give me success.
i have a FOLDER > c:/com/abc/def/ijk
and files......
MyClass.java
==============
package com.abc.def.ijk
class MyClass
// blah
// blah
}c:\com\abc\def\ijk>javac MyClass.java ===>compiled fine and created a class file.
and also one more file.....
OneMoreClass.java
=================
import com.abc.def.ijk.MyClass
class OneMoreClass
// blah
// blah
}c:\com\abc\def\ijk>javac OneMoreClass.java ===> Error!!! package com.abc.def.ijk does not exist !!!!
how can i solve it ?yea, this works....eariler i also usued to do this
way. but this time i forgot.
by the way, why individually it did not work !!!.Because you were in the package directory itself, and the classpath was set to the cwd, so java was looking for package directories at this level.
and also when i specify directly by
c:\com\abc\def\ijk
javac -classpath c:\com\abc\def\ijk\MyClass
OneMoreClass.java ...it does not work!!.
STRANGE! why ?Because by stating the package directory as classpath, you do the same as explained above. Stay out of package directories, stay one level above them, don't regard them as common directories. When declaring classpaths, don't mention package directories but the directories that contain them. -
Compiler Errors: Classpath Problems
I am working on a new project, and am getting a number of
compiler errors, such as the ones below.
The class or interface 'flash.geom.Matrix' could not be
loaded.
The class or interface 'flash.display.BitmapData' could not
be loaded.
The class or interface 'flash.geom.Point' could not be
loaded.
These errors are occurring since installing Sandy and adding
a new classpath
(Edit>Preferences>ActionScript>ActionScript 2.0 Settings).
My classpaths are as follows.
$(LocalData)/Classes
C:\Program Files\Adobe\Adobe Flash CS3\ASLibraries
Have I messed up my standard Flash classpaths, or is this
likely a problem specific to Sandy? Does the order of the addresses
in the classpath list matter?
Thanks for any assistance.Thanks for the fast response clbeech.
I deleted all 3 paths and tested the movie.
I got 1 compiler error (see below).
The file 'toplevel.as', which is required for typechecking
ActionScript 2.0, could not be found. Please make sure the
directory '$(LocalData)/Classes' is listed in the global classpath
of the ActionScript Preferences.
Then, I added 1 address to the classpaths: “.”.
I got 1 compiler error (see below).
The file 'toplevel.as', which is required for typechecking
ActionScript 2.0, could not be found. Please make sure the
directory '$(LocalData)/Classes' is listed in the global classpath
of the ActionScript Preferences.
Next I added a second address to the classpaths:
“$(LocalData)/Classes”.
I got 4 compiler errors (see below).
The class or interface 'Camera3D' could not be loaded.
The class or interface 'Group' could not be loaded.
The class or interface 'Group' could not be loaded.
The class or interface 'Object3D' could not be loaded.
Then I added the third address (this is the address to the
Sandy files): “C:\Program Files\Adobe\Adobe Flash
CS3\ASLibraries”.
I got 34 compiler errors (below are the first two errors).
The class or interface 'flash.geom.Matrix' could not be
loaded.
The class or interface 'flash.display.BitmapData' could not
be loaded.
The set of four errors (Camera3D, Group, etc.) are all Sandy
related. I don’t understand why adding the last address to
the classpath list creates the errors that it does. Shouldn’t
it tell Flash where to find Camera3D, Group, etc? Any thoughts? -
JDBC and Classpath problems on OpenVMS
Hello,
I'm working on an OpenVMS server and I got a simpler Java application that needs to establish a connection to an Oracle database, the application works perfectly well on Windows but when I moved to OpenVMS I got some problems with the oracle driver.
I believe I�m using the correct driver, I already checked on the oracle site according to my java version (1.4.2) and my database version (oracle 9i 9.2.0.7.0)
This is the error:
$java -jar miss.jar "DnBProcess"
About to start loading parameters for the MISS Proxy.
Successfully load parameters for the MISS Proxy.
About to load interface settings for DnBProcess
Settings for DnBProcess succesffully loaded.
About to load interface DnBProcess
About to start loading parameters for DnB Interface.
Successfully load parameters for DnB Interface.
Interface DnBProcess succesffully loaded.
About to execute interface DnBProcess
Connecting to the database...
java.lang.NoClassDefFoundError: oracle/jdbc/OracleDriver
at miss.DnBProcess.ExecuteQueryToFile(DnBProcess.java:85)
at miss.DnBProcess.Execute(DnBProcess.java:178)
at miss.Proxy.ExecuteInterface(Proxy.java:160)
at miss.Proxy.main(Proxy.java:207)
I know is a classpath problem, and my classpath on VMS looks like this:
define JAVA$CLASSPATH .,SYS$COMMON:[JAVA$142.LIB]TOOLS.JAR,SYS$COMMON:[JAVA$142.LIB]DT.JAR,SYS$COMMON:[JAVA$142.JRE.LIB]RT.JAR, USER1:[MONTEALEGRE.TEST.LIBS]OJDBC14.JAR,USER1:[MONTEALEGRE.TEST.MISS.LIBS]OJDBC14.JAR,[]
As you can see I added the �ojdbc14.jar� in different folders but my application seems not to find it.
Does anyone know how to set the classpath properly on VMS? Or maybe give me some tips that could lead me to find a solution to this problem.
Thanks.
Ileana.I would try googling for OpenVMS classpath. Unfortunatley the first result is this thread but there are a bunch of resources from IBM and HP listed and maybe they can help you.
-
Help classpath problem j2sdk1.4.2_04
help classpath problem j2sdk1.4.2_04
how can i run the java program with specify the file location
such as :
-----this one is fine ok and return HelloWorld.class-----
[root@localhost root]javac /serverData/studentAC/s001/HelloWorld.java
-----but this one cause exception-----
[root@localhost root]java /serverData/studentAC/s001/HelloWorld
-----result-----
Exception in thred "main" java.lang.NoClassDefFoundError: /serverData/studentAC/s001/HelloWorld
[root@localhost root]
I have tried a lot of classpath setting:
I just want to compile and run the java program without specify the classpath only !! please help !!! and give suggest !! if you have this exp!!
# ---1
#PATH=/usr/java/j2sdk1.4.2_04/bin:$PATH:$HOME/bin:./
#export PATH
#export JAVA_HOME=/usr/java/j2sdk1.4.2_04/
#export #CLASSPATH=/usr/java/j2sdk1.4.2_04/lib/tools.jar:/usr/java/j2sdk1.4.2_04/jre/lib/rt.jar:./
# ---2
#set java environment
# Java Setup Section START
export JAVA_HOME="/usr/java/j2sdk1.4.2_04"
export JRE="$JAVA_HOME/jre"
export CLASSPATH="$JAVA_HOME/lib:$JRE/lib:$JAVA_HOME/lib/tools.jar:."
export PATH="$PATH:$JAVA_HOME/bin"
# Java Setup Section END
# ---3
#PATH=$PATH:/usr/java/j2sdk1.4.2_04/bin
#JAVA_HOME=/usr/java/j2sdk1.4.2_04/
#export PATH
# ---4
# Java Setup Section START
#JAVA_HOME=/usr/java/j2sdk1.4.2_04
#export JAVA_HOME
#CLASSPATH=$CLASSPATH:/usr/java/j2sdk1.4.2_04/lib:/usr/java/j2sdk1.4.2_04/jre/lib:./
#export CLASSPATH
#PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin
#export PATH
# Java Setup Section END
# ---5
#export PATH=$PATH:/usr/java/j2sdk1.4.2_04/bin
#export JAVA_HOME=/usr/java/j2sdk1.4.2_04
#export CLASSPATH=/usr/java/j2sdk1.4.2_04/lib:$CLASSPATH:.
# ---6
#====================================================
#export JAVA_HOME=/usr/java/j2sdk1.4.2_04
#export PATH=$JAVA_HOME/bin:$PATH
#export CLASSPATH=/usr/java/j2sdk1.4.2_04/lib:$CLASSPATH
#====================================================I think this will work. java -classpath /serverData/studentAC/s001 HelloWorld
-
I'm trying to find out the status of the servicegen classloading problem
(specifying a classpath in a servicegen task causes class cast exceptions).
We are currently using the workaround described in this group which is
putting the weblogic jars in the system classpath. This workaround is very
unwieldy in our build environment. Is there any estimate on when the
problem will be fixed?And was it? I am using 7.0sp4 and am getting classpath problems in servicegen.
The problem I am having is that the type generation fails to find any of the weblogic
utility classes, sug as weblogic.xml.schema.binding.util.runtime.PropertyInfo
(and many many others)
"Neal Yin" <[email protected]> wrote:
This will be fixed in 7.0sp3 and 8.1sp1.
Thanks,
-Neal
"John Horner" <[email protected]> wrote in message
news:[email protected]..
I'm trying to find out the status of the servicegen classloading problem
(specifying a classpath in a servicegen task causes class castexceptions).
We are currently using the workaround described in this group whichis
putting the weblogic jars in the system classpath. This workaroundis
very
unwieldy in our build environment. Is there any estimate on when the
problem will be fixed? -
Hi folks,
Using this tutorial;
http://java.sun.com/j2se/1.5.0/docs/guide/rmi/hello/hello-world.html
I was able to get the example working when I had all of my classes in the same directory as I ran it. E.g.
$pwd
/home/jmcparla/RMI2/server
$ ls
Hello.class Server.class
$rmiregistry 2000 &
$ java Server
Server ready
$ pwd
/home/jmcparla/RMI2/client
$ ls
Client.class Hello.class
$ java Client
response: Hello, world!So I decided to bundle the code into two Jars, Server.jar (containing Hello.class and Server.class) and Client.jar (Hello.class and Client.class). However this time when I went to start the Server;
$ pwd
/home/jmcparla/RMI2
$ ls
Server.jar bin client policy server src
$ rmiregistry 2000 &
[1] 2848
$ java -jar Server.jarI got these exceptions;
Server exception: java.rmi.ServerException: RemoteException occurred in server t
hread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
tion is:
java.lang.ClassNotFoundException: Hello
java.rmi.ServerException: RemoteException occurred in server thread; nested exce
ption is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
tion is:
java.lang.ClassNotFoundException: Hello
at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:396
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:250)
at sun.rmi.transport.Transport$1.run(Transport.java:159)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:5
35)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTranspor
t.java:790)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
.java:649)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
utor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:908)
at java.lang.Thread.run(Thread.java:619)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknow
n Source)
at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at sun.rmi.registry.RegistryImpl_Stub.bind(Unknown Source)
at Server.main(Server.java:22)
Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested ex
ception is:
java.lang.ClassNotFoundException: Hello
at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:386
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:250)
at sun.rmi.transport.Transport$1.run(Transport.java:159)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:5
35)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTranspor
t.java:790)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
.java:649)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
utor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassNotFoundException: Hello
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at sun.rmi.server.LoaderHandler.loadProxyInterfaces(LoaderHandler.java:7
11)
at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:655)
at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:592)
at java.rmi.server.RMIClassLoader$2.loadProxyClass(RMIClassLoader.java:6
28)
at java.rmi.server.RMIClassLoader.loadProxyClass(RMIClassLoader.java:294
at sun.rmi.server.MarshalInputStream.resolveProxyClass(MarshalInputStrea
m.java:238)
at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1531)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1493)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1
732)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
... 12 moreIt seems to be that it cannot find the Hello class file but this is bundled in Server.jar. Putting Server.jar on the classpath makes no difference.
Any ideas?Cheers, using createRegistry(int) did the trick (along with a few other bits and pieces).
For the sake of aiding others with this kind of problem here's what I did. Remember most of it came from the Sun Java 5 RMI tutorial (http://java.sun.com/j2se/1.5.0/docs/guide/rmi/hello/hello-world.html).
1. Download and compile SUN's class file server (http://java.sun.com/javase/technologies/core/basic/rmi/class-server.zip). You'll need this to serve up the classes. Place this in a different directory to the one your going to use for the RMI tutorial.
2. Download the source files for the tutorial.
3. Use this directory structure (relative to /home/<username>)
| RMI/
| src/
| example/
| hello/
| bin/4. Change the server to the following. The main points to note are the registry is now created (rather than located) and the port number used.
package example.hello;
import java.rmi.registry.Registry;
import java.rmi.registry.LocateRegistry;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
public class Server implements Hello {
public Server() {}
public String sayHello() {
return "Hello, world!";
public static void main(String args[]) {
try {
System.out.println("Starting Server");
Server obj = new Server();
Registry registry = LocateRegistry.createRegistry(2000);
System.out.println("Created registry");
Hello stub = (Hello) UnicastRemoteObject.exportObject(obj, 0);
System.out.println("Exported Server");
// Bind the remote object's stub in the registry
registry.rebind("Hello", stub);
System.out.println("Bound Server to \"Hello\"");
System.out.println("Server ready");
} catch (Exception e) {
System.err.println("Server exception: " + e.toString());
e.printStackTrace();
}5. In the src dir compile with the following;
javac -d ../bin example/hello/*.java6. In the bin dir create the server jar with the following;
jar cvfe Server.jar example.hello.Server example/hello/Server* example/hello/Hello*7. In the bin dir create the client jar with the following;
jar cvfe Client.jar example.hello.Client example/hello/Client* example/hello/Hello*8. Move both Jars out of the bin directory to the parent one (e.g. /home/<username>RMI/) (to prevent the rmi registry / server using the current dir in the classpath if you've set it up that way).
9. Create the policy file in the RMI directory (see above directory structure);
grant codeBase * {
permission java.security.AllPermission;
permission java.net.SocketPermission "*", "accept, connect, listen, resolve";
};10. Start the class file server (read the notes that come with it) in its own directory. Note the port number used (different from RMI registry) and the Jar file on the end of the path.
java ClassFileServer 2001 /home/<username>/RMI/Server.jar11. If this has worked you should be able to visit the URL http://localhost:2001 and get a blank page (as opposed to a broken link notification).
12. Start the RMI server in the bin dir. Note the port is the same as the one used to launch the class file server.
java -Djava.security.policy=policy -Djava.rmi.codebase=http://localhost:2001/ -jar Server.jar13. You should see the following output;
Starting Server
Created registry
Exported Server
Bound Server to "Hello"
Server ready14. Start the client
java -jar Client.jar15. You should see the following output;
response: Hello, world! -
Is this an Apple Problem or a Denon Problem?
I use the most recent Mac Mini as a media center in my living room. Using a DVI to HDMI adapter the Mac Mini video feeds into my Denon AVR-4306 Receiver. The audio is pumped out of the standard headphone jack. At the end of each viewing session, the TV and receiver are powered off, but the Mac Mini stays on.
Prior to upgrading to Snow Leopard this setup worked great - but after the upgrade, I'm now having a video display issue and I'm not sure if I should call Apple or Denon to help resolve this.
I set Snow Leopard to use the 1080p resolution setting. I've confirmed that both my reciever and my TV are indeed 1080p and upon first boot things work perfect. The problem starts when I turn off the TV and Receiver. What happens is, after the TV and Receiver are turned off, the Mac Mini is reverting to the 720P display setting. The next time the TV and receiver are turned on, I'm looking at a 720P display setting.
I don't understand why it's flipping to this lower resolution and am wondering if anyone has a fix that will prevent this from happening?
I have found two workarounds - neither are any good. The first is after turning back on the TV and receiver, using the keyboard shortcut to log out. Logging out triggers the display check and it reverts back to the 1080p setting. A reboot also fixes this issue.
Secondly, is this an Apple problem or a Denon Receiver problem?After much discussion back and forth between Apple and Denon, it was discovered that the Denon receiver does not support 1080p - only 1080i - this was not the information I orginally received from Denon.
Setting the Apple to use 1080i for the resolution, then configuring the Denon Receiver to use HDMI pass through for the HDMI output resolved this problem. -
Has anyone in this Forum had problems with installing and running Adobe apps on the new MacPro?
I have been trying to install Photoshop CS6 & CC and Acrobat Pro XI on my Mac Pro (late 2013). I keep getting a 'configuration' error message and wondered if the problem was wide spread.
TIA,
JerryThanks, Martin.
Good to hear someone has had success. The lack of it here is frustrating and depressing.
Thanks again,
Jerry
Maybe you are looking for
-
Is there a way to disable the Thunderbolt Display?
Hey Guys, I recently got a Thunderbolt Display and connected it up to my iMac (i bought the iMac in Jan 2013) and everything is working just as perfect as i thought it would apart from one thing. I have had a search around to see if there is any way
-
SOA Suite 10.1.3.4 loses instances in the BPEL console
Hello, One of my BPEL processes loses instnaces in the BPEL console. OS: AIX 5.3 oslevel –s:5300-04-02 SOA Suite 10.1.3.4 I feel I hit the same problem as this thread, process is supposed to be in a jta transaction But I have set following 3 values (
-
PsCC asking for serial number. Don't have one.
I ppayed 980yen/manth in Japan. But Photshop CC requesut enter Sirial No. I don't knomy sirial No. Why not ? Can't use PsCC. Where is my payment?
-
Powerpoint 2008 and displays?
Hi, does anyone know how to show a powerpoint on a projector but on your MBP you see the powerpoint presenter tools (ie. notes for each slide) whereas on the screen of the projector there is just the presentation? I did a search in powerpoint 2008 an
-
Advantages of 11i over 11.0.3
Hi Everyone, I need some quick information...Hope I get some help here.. Can someone please point me to any white papers/blogs/notes which explain on the feature differences and advantages of 11i over 11.0.3..? Any pointers would be greatly appreciat