I've watched a lot of posts about playing YouTube videos, and also watched Oracle learning tutorials. They used this code and it worked perfectly to them, but I get errors. And can't find a way to fix it.
#Override
public void start(Stage window) throws Exception
{
Media media = new Media("https://www.youtube.com/watch?v=Q0oIoR9mLwc");
MediaPlayer player = new MediaPlayer(media);
MediaView view = new MediaView(player);
player.setAutoPlay(true);
StackPane sp = new StackPane(view);
Scene sc = new Scene(sp,500,500);
window.setScene(sc);
window.show();
}
ERRORS I GET
Exception in Application start method
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(Unknown Source)
at com.sun.javafx.application.LauncherImpl.launchApplication(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.launcher.LauncherHelper$FXHelper.main(Unknown Source)
Caused by: java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(Unknown Source)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$155(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.UnsupportedOperationException: Unsupported protocol "https"
at com.sun.media.jfxmedia.locator.Locator.<init>(Unknown Source)
at javafx.scene.media.Media.<init>(Unknown Source)
at PlayVideo.Main.start(Main.java:34)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$162(Unknown Source)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$175(Unknown Source)
at com.sun.javafx.application.PlatformImpl.lambda$null$173(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(Unknown Source)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$148(Unknown Source)
... 1 more
Exception running application PlayVideo.Main
I also checked this link on stackoverflow but couldn't find solution. Link
Also tried it this way but video won't load.
#Override public void start(Stage stage) throws Exception {
WebView webview = new WebView();
webview.getEngine().load(
"https://www.youtube.com/watch?v=jaPUbzfJx2A"
);
webview.setPrefSize(640, 390);
stage.setScene(new Scene(webview));
stage.show();
}
}
Related
I'm writing a simple application with java and trying to play sounds but I can't get it to work when I create the Media object it throws
java.lang.reflect.InvocationTargetException , the file name is correct , and i tried the full file path name and i get the same error
my code is :
`
public class Try extends Application {
#Override
public void start(Stage primaryStage) throws Exception {
Pane pane = new Pane () ;
Button b = new Button("click here ") ;
Media m = new Media ("music.mp3");
MediaPlayer md = new MediaPlayer(m) ;
b.setOnAction(e -> {
md.play();
System.out.println("clicked");
});
pane.getChildren().add(b) ;
Scene s = new Scene(pane , 300 ,300 ) ;
primaryStage.setScene(s);
primaryStage.show();
}
public static void main(String[] args) {
Application.launch(args);
}
i tried .wav files and get same error .
the full error :
`
Exception in Application start method
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:389)
at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.launcher.LauncherHelper$FXHelper.main(Unknown Source)
Caused by: java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$159(LauncherImpl.java:182)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalArgumentException: uri.getScheme() == null! uri == 'music.mp3'
at com.sun.media.jfxmedia.locator.Locator.<init>(Locator.java:218)
at javafx.scene.media.Media.<init>(Media.java:393)
at ttry.Try.start(Try.java:17)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$166(LauncherImpl.java:863)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$179(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$177(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$178(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$152(WinApplication.java:177)
... 1 more
Exception running application ttry.Try
`
I want to dynamically load JAR Files using a ClassLoader from a ByteArray. It works fine with every executable JAR Files I've tried it with so far, except a Program using WebLaF. I always get the following set of Errors:
javax.xml.parsers.FactoryConfigurationError: Provider for class javax.xml.parsers.DocumentBuilderFactory cannot be created
at javax.xml.parsers.FactoryFinder.findServiceProvider(Unknown Source)
at javax.xml.parsers.FactoryFinder.find(Unknown Source)
at javax.xml.parsers.DocumentBuilderFactory.newInstance(Unknown Source)
at com.thoughtworks.xstream.io.xml.DomDriver.<init>(DomDriver.java:64)
at com.thoughtworks.xstream.io.xml.DomDriver.<init>(DomDriver.java:56)
at com.thoughtworks.xstream.io.xml.DomDriver.<init>(DomDriver.java:48)
at com.alee.utils.XmlUtils.initializeXStream(XmlUtils.java:90)
at com.alee.utils.XmlUtils.getXStream(XmlUtils.java:77)
at com.alee.utils.XmlUtils.processAnnotations(XmlUtils.java:141)
at com.alee.laf.WebLookAndFeel$2.propertyChange(WebLookAndFeel.java:855)
at java.beans.PropertyChangeSupport.fire(Unknown Source)
at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
at javax.swing.event.SwingPropertyChangeSupport.firePropertyChange(Unknown Source)
at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
at javax.swing.UIManager.setLookAndFeel(Unknown Source)
at com.alee.laf.WebLookAndFeel.install(WebLookAndFeel.java:932)
at com.alee.laf.WebLookAndFeel.install(WebLookAndFeel.java:918)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at xx.ByteCodeClassLoader.main(ByteCodeClassLoader.java:178)
Caused by: java.lang.RuntimeException: Provider for class javax.xml.parsers.DocumentBuilderFactory cannot be created
... 24 more
Caused by: java.util.ServiceConfigurationError: javax.xml.parsers.DocumentBuilderFactory: Error locating configuration files
at java.util.ServiceLoader.fail(Unknown Source)
at java.util.ServiceLoader.access$100(Unknown Source)
at java.util.ServiceLoader$LazyIterator.hasNextService(Unknown Source)
at java.util.ServiceLoader$LazyIterator.hasNext(Unknown Source)
at java.util.ServiceLoader$1.hasNext(Unknown Source)
at javax.xml.parsers.FactoryFinder$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 24 more
Caused by: java.io.IOException: Cannot fetch URL out of res
at xx.ByteCodeClassLoader.findResources(ByteCodeClassLoader.java:72)
at java.lang.ClassLoader.getResources(Unknown Source)
... 29 more
java.lang.NullPointerException
at com.alee.utils.XmlUtils.processAnnotations(XmlUtils.java:141)
at com.alee.laf.WebLookAndFeel$2.propertyChange(WebLookAndFeel.java:855)
at java.beans.PropertyChangeSupport.fire(Unknown Source)
at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
at javax.swing.event.SwingPropertyChangeSupport.firePropertyChange(Unknown Source)
at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
at javax.swing.UIManager.setLookAndFeel(Unknown Source)
at com.alee.laf.WebLookAndFeel.install(WebLookAndFeel.java:932)
at com.alee.laf.WebLookAndFeel.install(WebLookAndFeel.java:918)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at xx.ByteCodeClassLoader.main(ByteCodeClassLoader.java:178)
After this, the JAR runs successfully until it has to load the GUI. Then it crashes with another error:
javax.xml.parsers.FactoryConfigurationError: Provider for class javax.xml.parsers.DocumentBuilderFactory cannot be created
My Code is the following:
public class ByteCodeClassLoader extends ClassLoader {
final Map<String, byte[]> classes;
final Map<String, byte[]> res;
-snip-
#Override
protected Class<?> findClass(String name) throws ClassNotFoundException {
byte[] code = classes.get(name);
if (code != null){
return defineClass(name, code, 0, code.length);
}
return super.findClass(name);
}
#Override
public URL getResource(String name) {
URL ur = ByteCodeClassLoader.class.getResource(name);
if (ur != null) {
return ur;
}
try {
return new URL(null, "bytes:///" + name, new BytesHandler());
} catch (MalformedURLException e) {
throw new RuntimeException(e);
}
}
#Override
public InputStream getResourceAsStream(String name) {
return new ByteArrayInputStream(res.get(name));
}
#Override
protected Enumeration<URL> findResources(String name) throws IOException {
throw new IOException("Cannot fetch URL out of res");
}
-snip-
If you know a solution to this issue, it would help me greatly. Even just a lead in the right direction would be awesome. I hope I supplied all the important information.
I'm looking for a way around the problem with showAndWait call.
I've thought onFinishedProperty is fired when the animation process is over, still im unable to call showAndWait because of error saying that im trying to call it during animation process. Is there anyway to call my dialog right after finish of animation?
TextInputDialog dialog = new TextInputDialog("Litera");
dialog.setTitle("");
dialog.setHeaderText("");
dialog.setContentText("Wybierz literÄ™:");
for(int i = 0 ; i<pieChartData.size();i++)
System.out.println(pieChartData.get(i));
RotateTransition rotateTransition = new RotateTransition();
rotateTransition.setDuration(Duration.millis(5000));
rotateTransition.setNode(fortuna);
rotateTransition.setCycleCount(1);
rotate.setOnAction(
(e)->{
fortuna.setRotate(0);
rotate.setDisable(true);
rotateTransition.setAutoReverse(false);
rotateTransition.setByAngle((int)(Math.random()*10800+360));
rotateTransition.play();
rotateTransition.onFinishedProperty().set(new EventHandler<ActionEvent>() {
#Override
public void handle(ActionEvent event) {
System.out.println(fortuna.getRotate());
Optional<String> result = dialog.showAndWait();
rotate.setDisable(false);
}
}
);
});
Exception in thread "JavaFX Application Thread" java.lang.IllegalStateException: showAndWait is not allowed during animation or layout processing
at javafx.controls/javafx.scene.control.Dialog.showAndWait(Unknown Source)
at Main$1.handle(Main.java:78)
at Main$1.handle(Main.java:1)
at javafx.graphics/javafx.animation.Animation.finished(Unknown Source)
at javafx.graphics/javafx.animation.AnimationAccessorImpl.finished(Unknown Source)
at javafx.graphics/com.sun.scenario.animation.shared.SingleLoopClipEnvelope.timePulse(Unknown Source)
at javafx.graphics/javafx.animation.Animation.doTimePulse(Unknown Source)
at javafx.graphics/javafx.animation.Animation$1.lambda$timePulse$0(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/javafx.animation.Animation$1.timePulse(Unknown Source)
at javafx.graphics/com.sun.scenario.animation.AbstractMasterTimer.timePulseImpl(Unknown Source)
at javafx.graphics/com.sun.scenario.animation.AbstractMasterTimer$MainLoop.run(Unknown Source)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.pulse(Unknown Source)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.pulse(Unknown Source)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.pulseFromQueue(Unknown Source)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$11(Unknown Source)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
I'm getting a big trace when trying to run this code which display an image, however I'm not sure why the code isn't running. Any ideas?
public class SplashScreen extends Application {
public static void main(String[] args) {
Application.launch(args);
}
#Override
public void start(Stage stage) throws Exception {
//Parent rootNode = null;
Group root = new Group();
Scene scene = new Scene(root, 500, 500);
GridPane gridpane = new GridPane();
gridpane.setPadding(new Insets(5));
gridpane.setHgap(10);
gridpane.setVgap(10);
ImageView algLogo = new ImageView();
Image logo = new Image("D:/Users/Tozu/workspace/ACA 5 OOJP/AlgonquinCollegeLogo.jpg");
algLogo.setImage(logo);
final HBox pictureRegion = new HBox();
pictureRegion.getChildren().add(algLogo);
gridpane.add(pictureRegion, 1, 1);
root.getChildren().add(gridpane);
stage.setTitle("ACA 5");
stage.setScene(scene);
stage.show();
}
I've also tried a little test class that confirms whether I have the path for the JPG correct and it seems to work fine, so I don't think the problem lies with the JPG path.
For clarification the JPG is located in the class folder, not in the src folder
Exception in Application start method
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:389)
at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.launcher.LauncherHelper$FXHelper.main(Unknown Source)
Caused by: java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$155(LauncherImpl.java:182)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalArgumentException: Invalid URL: unknown protocol: d
at javafx.scene.image.Image.validateUrl(Image.java:1121)
at javafx.scene.image.Image.<init>(Image.java:620)
at splashPkg.SplashScreen.start(SplashScreen.java:39)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$162(LauncherImpl.java:863)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$175(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
... 1 more
Caused by: java.net.MalformedURLException: unknown protocol: d
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at javafx.scene.image.Image.validateUrl(Image.java:1115)
... 11 more
Exception running application splashPkg.SplashScreen
You have to set the URL file protocol
Image logo = new Image("file:D:/Users/Tozu/workspace/ACA 5 OOJP/AlgonquinCollegeLogo.jpg");
^ here
From the documentation of Image https://docs.oracle.com/javafx/2/api/javafx/scene/image/Image.html
// load an image and resize it only in one dimension, to the height of 100 and
// the original width, without preserving original aspect ratio
// The image is located in the current working directory
Image image4 = new Image("file:flower.png", 0, 100, false, false);
A better way to do the same thing is to use a File object (As suggested by James_D)
File f = new File("D:/Users/Tozu/workspace/ACA 5 OOJP/AlgonquinCollegeLogo.jpg");
Image logo = new Image(f.toURI().toString());
I'm trying to build simple echo server as RMI application (step by step as it's described in Sun tutorial).
All source code is shown below, it's very simple:
package test;
import java.rmi.Remote;
import java.rmi.RemoteException;
public interface EchoServer extends Remote {
public String sendString (String str) throws RemoteException;
}
package test;
import java.rmi.server.UnicastRemoteObject;
import java.rmi.RemoteException;
public class EchoServerImpl extends UnicastRemoteObject implements EchoServer {
public EchoServerImpl () throws RemoteException {
super ();
}
public String sendString (String str) throws RemoteException {
return str.toUpperCase();
}
}
package test;
import java.rmi.Naming;
public class RMIServer {
public RMIServer () {
try {
EchoServer eServer = new EchoServerImpl ();
Naming.rebind ("rmi://localhost:1099/EchoService", eServer); // <--exception
} catch (Exception e) {
e.printStackTrace ();
}
}
public static void main(String[] args) {
new RMIServer ();
}
}
I compile code with rmic and I see file EchoServerImpl_Stub.class. After that I run 'rmiregistry' and then I start RMIServer. And at that moment I see ServerException:
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: test.EchoServerImpl_Stub
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)
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 Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
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)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:359)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at java.rmi.Naming.rebind(Naming.java:160)
at test.RMIServer.(RMIServer.java:10)
at test.RMIServer.main(RMIServer.java:17)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: test.EchoServerImpl_Stub
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)
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 Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
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)
Caused by: java.lang.ClassNotFoundException: test.EchoServerImpl_Stub
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 java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
at java.rmi.server.RMIClassLoader$2.loadClass(Unknown Source)
at java.rmi.server.RMIClassLoader.loadClass(Unknown Source)
at sun.rmi.server.MarshalInputStream.resolveClass(Unknown Source)
at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
... 12 more
I think it's a common problem and it's probably connected with wrong deploying. How to fix it?
I think it's your rmiregistry classpath. The test.EchoServer interface needs to be accessible to the rmiregistry itself. Set your CLASSPATH environment variable before you run up the rmiregistry e.g.
C:\>set CLASSPATH="MyBinFolder"
C:\>rmiregistry
Also, rmic is a hangover from before Java 5. It isn't necessary to run it anymore. Just run your server and client as normal and the proxies will be created dynamically.
Regards,
MK