New to Java RMI

I am having problems with the following code that I am currently trying to understand RMI from Java head First, the following are meant to be part of an universal browser that the browser downloads and displays interactive Java GUIs. Can someone explain what I am doing wrong as I am still new to Java please?
import java.awt.*;
import javax.swing.*;
import java.rmi.*;
import java.awt.event.*;
public class ServiceBrowser {
   JPanel mainPanel;
   JComboBox serviceList;
   ServiceServer server;
   public void buildGUI() {
      JFrame frame = new JFrame("RMI Browser");
      mainPanel = new JPanel();
      frame.getContentPane().add(BorderLayout.CENTER, mainPanel);
      Object[] services = getServicesList();
      serviceList = new JComboBox(services);
      frame.getContentPane().add(BorderLayout.NORTH, serviceList);
      serviceList.addActionListener(new MyListListener());    
      frame.setSize(500,500);
      frame.setVisible(true);
   void loadService(Object serviceSelection) {
       try {
          Service svc = server.getService(serviceSelection);
          mainPanel.removeAll();
          mainPanel.add(svc.getGuiPanel());
          mainPanel.validate();
          mainPanel.repaint();
        } catch(Exception ex) {
           ex.printStackTrace();
   Object[] getServicesList() {
      Object obj = null;
      Object[] services = null;
      try {
          obj = Naming.lookup("rmi://127.0.0.1/ServiceServer");   
     catch(Exception ex) {
       ex.printStackTrace();
     server = (ServiceServer) obj;
      try {
        services = server.getServiceList();
      } catch(Exception ex) {
         ex.printStackTrace();
     return services;
   class MyListListener implements ActionListener {
      public void actionPerformed(ActionEvent ev) {
          // do things to get the selected service
          Object selection =  serviceList.getSelectedItem();
          loadService(selection);
  public static void main(String[] args) {
     new ServiceBrowser().buildGUI();
}I am able to compile the code but come up with the following error messages at runtime
java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is:
     java.net.ConnectException: Connection refused
     at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:601)
     at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198)
     at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)
     at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:322)
     at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
     at java.rmi.Naming.lookup(Naming.java:84)
     at ServiceBrowser.getServicesList(ServiceBrowser.java:53)
     at ServiceBrowser.buildGUI(ServiceBrowser.java:19)
     at ServiceBrowser.main(ServiceBrowser.java:82)
Caused by: java.net.ConnectException: Connection refused
     at java.net.PlainSocketImpl.socketConnect(Native Method)
     at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
     at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
     at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
     at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:432)
     at java.net.Socket.connect(Socket.java:529)
     at java.net.Socket.connect(Socket.java:478)
     at java.net.Socket.<init>(Socket.java:375)
     at java.net.Socket.<init>(Socket.java:189)
     at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
     at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
     at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:595)
     ... 8 more
java.lang.NullPointerException
     at ServiceBrowser.getServicesList(ServiceBrowser.java:64)
     at ServiceBrowser.buildGUI(ServiceBrowser.java:19)
     at ServiceBrowser.main(ServiceBrowser.java:82)
Exception in thread "main" java.lang.NullPointerException
     at javax.swing.DefaultComboBoxModel.<init>(DefaultComboBoxModel.java:53)
     at javax.swing.JComboBox.<init>(JComboBox.java:175)
     at ServiceBrowser.buildGUI(ServiceBrowser.java:21)
     at ServiceBrowser.main(ServiceBrowser.java:82)
The code for the remote implementation compile and runs, but the other code for services compiles but come back with the following error message at runtime:
Exception in thread "main" java.lang.NoSuchMethodError: main
I have included one of the services code below this happens with:
import javax.swing.*;
import java.awt.event.*;
import java.io.*;
public class DiceService implements Service {
    JLabel label;
    JComboBox numOfDice;
    public JPanel getGuiPanel() {
       JPanel panel = new JPanel();
       JButton button = new JButton("Roll 'em!");
       String[] choices = {"1", "2", "3", "4", "5"};
       numOfDice = new JComboBox(choices);
       label = new JLabel("dice values here");
       button.addActionListener(new RollEmListener());
       panel.add(numOfDice);
       panel.add(button);
       panel.add(label);
       return panel;
   public class RollEmListener implements ActionListener {
      public void actionPerformed(ActionEvent ev) {
         // roll the dice
         String diceOutput = "";
         String selection = (String)  numOfDice.getSelectedItem();
         int numOfDiceToRoll = Integer.parseInt(selection);
         for (int i = 0; i < numOfDiceToRoll; i++) {
            int r = (int) ((Math.random() * 6) + 1);
            diceOutput += (" " + r);
        label.setText(diceOutput);
}

how I do get suitable server running, can I not test the code on a local ip address first, i have included the remote implementation code below, can you advise how I can resolve this please or point me in the right direction?
import java.rmi.*;
import java.util.*;
import java.rmi.server.*;
public class ServiceServerImpl extends UnicastRemoteObject implements ServiceServer  {
    HashMap<String, Service> serviceList;
    public ServiceServerImpl() throws RemoteException {
       // start and set up services
       setUpServices();
   private void setUpServices() {
       serviceList = new HashMap<String, Service>();
       serviceList.put("Dice Rolling Service", new DiceService()); 
       serviceList.put("Day of the Week Service", new DayOfTheWeekService()); 
       serviceList.put("Visual Music Service", new MiniMusicService());  
    public Object[] getServiceList() {
       System.out.println("in remote");
       return serviceList.keySet().toArray();
    public Service getService(Object serviceKey) throws RemoteException {       
       Service theService = (Service) serviceList.get(serviceKey);      
       return theService;
    public static void main (String[] args) {
       try {
         Naming.rebind("ServiceServer", new ServiceServerImpl());
        } catch(Exception ex) { }
        System.out.println("Remote service is running");
}

Similar Messages

  • New @ RMI need help with  java.rmi.UnmarshalException: error unmarshalling

    Hi @ all out there,
    I'm new with Java RMI and have to write a EventSystem for an college project where clients can subscribe to a topic and get notified when someone publishes a message to the subscribed topic.
    At server-side I have a class called EventSystem that provides methods for subscribing and unsubscribing from topics, and also for posting messages (for publishers).
    To subscribe i thought that the client must specify the topic and also itself ( means that a client calls in this way: obj.subscribe("mytopic", this).
    The EventSystem handles a list of all clients, and whenever a new message is posted it goes trough all clients and invokes the handleMessage(String msg) method that all Clients have to provide.
    On my local machine without RMi this concept works just great.
    I now tried to get it working using RMI , but I get the following Exception when starting the client (the server starts fine) :
    Looking up for rmiregistry at 138.232.248.22:1099
    Subscriber exception:
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
            java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
            java.io.InvalidClassException: SubscriberImpl; SubscriberImpl; class invalid for deserialization
            at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:336)
            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:535)
            at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
            at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
            at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
            at java.lang.Thread.run(Thread.java:619)
            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:142)
            at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:178)
            at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:132)
            at $Proxy0.subscribe(Unknown Source)
            at SubscriberImpl.main(SubscriberImpl.java:48)
    Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
            java.io.InvalidClassException: SubscriberImpl; SubscriberImpl; class invalid for deserialization
            at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:293)
            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:535)
            at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
            at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
            at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
            at java.lang.Thread.run(Thread.java:619)
    Caused by: java.io.InvalidClassException: SubscriberImpl; SubscriberImpl; class invalid for deserialization
            at java.io.ObjectStreamClass.checkDeserialize(ObjectStreamClass.java:713)
            at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1733)
            at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
            at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
            at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:306)
            at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:290)
            ... 9 more
    Caused by: java.io.InvalidClassException: SubscriberImpl; class invalid for deserialization
            at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:587)
            at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1583)
            at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
            at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)
            ... 13 moreI googled now for 2 hours but can't resolve the problem alone. As far as I can understand I have to serialize Objects that I want to send to the server, right?
    So how can i do this? I've never used serialization till now.
    any ideas how to solve this problem?
    greets from italy and sorry for my very weak english
    bd_italy

    A class has been modified after deployment. Stop the Registry, clean, recompile, and redeploy.

  • RemoteException: java.rmi.UnmarshalException in jdk 1.4.2

    i'm implementing an RMI over the jdk 1.4.2 (can't do it in the 1.5 or 1.6) i've seen this topic [http://forum.java.sun.com/thread.jspa?threadID=370196&messageID=1808449] but it didn't help me, or i'm doing something wrong...
    i know the RMI code is ok because it runs on java 1.6 (with the automatic generation of stubs and skeletons) but when i change the platform to 1.4 it throws the exception:
    RemoteException: java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
    java.lang.ClassNotFoundException: servidor.MensageiroImpl_Stub
    the VM is configured to use the -Djava.security.policy=C:\Projecto\Policy\permissions.policy both in the client and server
    please help me :S i've been burning my head with this for 3 days
    i leave my code here:
    The interface:
    package rmiinterface;
    import java.rmi.Remote;
    import java.rmi.RemoteException;
    public interface Mensageiro extends Remote {
        public void sendMsg(String msg) throws RemoteException;
        public String readMsg() throws RemoteException;
    }the implementation:
    package servidor;
    import rmiinterface.Mensageiro;
    import java.rmi.RemoteException;
    import java.rmi.server.UnicastRemoteObject;
    public class MensageiroImpl extends UnicastRemoteObject implements Mensageiro {
        public MensageiroImpl() throws RemoteException {
            super();
        public void sendMsg(String msg) throws RemoteException {
            System.out.println(msg);
        public String readMsg() throws RemoteException {
            return "This is not a Hello World! message";
    }the server:
    package servidor;
    import rmiinterface.Mensageiro;
    import java.rmi.Naming;
    import java.rmi.RMISecurityManager;
    public class MensageiroServer {
        public MensageiroServer() {
            System.setSecurityManager(new RMISecurityManager());
            try {
                Mensageiro m = new MensageiroImpl();
                java.rmi.registry.LocateRegistry.createRegistry(1099);
                System.out.println("RMI registry successfully initiated");
                Naming.rebind("MensageiroService", m);
                System.out.println("Servidor Online");
            } catch (Exception e) {
                System.out.println("Trouble: " + e.getMessage());
        public static void main(String[] args) {
            new MensageiroServer();
    }and the client:
    package cliente;
    import rmiinterface.Mensageiro;
    import java.rmi.RMISecurityManager;
    import java.rmi.Naming;
    import java.rmi.RemoteException;
    import java.rmi.NotBoundException;
    import java.net.MalformedURLException;
    public class MensageiroClient {
        public MensageiroClient() {
        public static void main(String args[]) {
            System.setSecurityManager(new RMISecurityManager());
            try {
                Mensageiro m = (Mensageiro) Naming.lookup("//localhost/MensageiroService");
                System.out.println(m.readMsg());
                m.sendMsg("Hello World!");
            } catch (MalformedURLException e) {
                System.out.println();
                System.out.println("MalformedURLException: " + e.toString());
            } catch (RemoteException e) {
                System.out.println();
                System.out.println("RemoteException: " + e.toString());
            } catch (NotBoundException e) {
                System.out.println();
                System.out.println("NotBoundException: " + e.toString());
            } catch (Exception e) {
                System.out.println();
                System.out.println("Exception: " + e.toString());
    }NOTE: my IDE is Netbeans 6.1. and the client and server are in diffrent projects
    thanks in advance
    Best Regards,
    Carlos Daniel Ribeiro

    the stub and the skeleton are being generated, and they are there, in the server project! i don't know why the class defs for the stub filearen't downloded by the client project...I don't know why you think they will be downloaded. They won't be, unless you're using the codebase feature. The client needs the remote interface and the stub on its classpath, and all classes that the remote interface depends on, and so on recursively until closure. You have to do something about that.
    It works under 1.6 because it doesn't need the stub at all.

  • Reply to client by setting properties of java.rmi

    Hi All,
    I am very new to JAVA RMI.
    Is it possible for me to send a reply to client by setting the properties of java.rmi ?. I mean the reply string , if i am returning a string to client program ?.
    Shammi

    I will be more specific.
    What I meant by properties is system properties applied to the classes in java.rmi.* which we can set. For example,
    System.setProperty("java.rmi.server.codebase", "file://home/shammi/test");
    For the second portion, for example, if my server returns the string "Hello World" to the client, I will have a server method some what similar to the one given below
    public String SayHello()     {
              return "Hello World\n";
    Is it possible for me to do this in another way rather than explicitly specifying the return string.
    Shammi

  • Java.rmi.RemoteException: EJB Exception: while calling an EJB method,

    Hi
    I am getting below error while calling a stateless EJB method. There is some validation checks while performing ejb's modify() method and a RuntimeException is thrown in case of validation failure.The modify() method internally calls other stateless ejb as well.
    The problem I'm facing is, instead of getting the expected RuntimeException in the Servlet, i am getting RemoteException. I am using WLS 9 MP1, all participating ejbs are stateless and i am using default transaction attributes(Supports) for these ejbs.
    The interesting part is, at the ejb layer RuntimeException is thrown as expected, but this exception changed to RemoteException at the servlet's end where i am catching the ejb call exceptions.
    I am new to WLS, please suggest/help me out of this exception.
    Any help is truly appreciated.
    java.rmi.RemoteException: EJB Exception: ; nested exception is: java.lang.RuntimeException:
         at weblogic.ejb.container.internal.EJBRuntimeUtils.throwRemoteException(EJBRuntimeUtils.java:95)
         at weblogic.ejb.container.internal.BaseEJBObject.handleSystemException(BaseEJBObject.java:713)
         at weblogic.ejb.container.internal.BaseEJBObject.handleSystemException(BaseEJBObject.java:681)
         at weblogic.ejb.container.internal.BaseEJBObject.postInvoke1(BaseEJBObject.java:447)
         at weblogic.ejb.container.internal.StatelessEJBObject.postInvoke1(StatelessEJBObject.java:72)
         at weblogic.ejb.container.internal.BaseEJBObject.postInvokeTxRetry(BaseEJBObject.java:374)
         at com.mycomp.base.BaseController_8x2e52_EOImpl.modify(BaseController_8x2e52_EOImpl.java:149)
         at com.mycomp.webgui.servlet.FrontComponent.service(FrontComponent.java:207)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:223)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3245)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2003)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1909)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1359)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
    Thanks!
    Edited by: user10721298 on Feb 23, 2009 4:16 AM

    Hi,
    If i don't misunderstand, you are using the RuntimeException as an application exception, right?
    Have you annotated it or denoted it in deployment descriptor?
    Thanks,
    Amy

  • Java.rmi.ServerException:

    I am new to RMI concept
    i stuck with the below problem
    when i execute
    E:\MyProjects\StockRMI>java -Djava.security.policy=policy.all StockMarketServerStockMarketServer is as shown below
    import java.rmi.*;
    import java.rmi.server.UnicastRemoteObject;
    import SimpleStocks.*;
    public class StockMarketServer {
      public static void main(String[] args) throws Exception {
        if(System.getSecurityManager() == null) {
          System.setSecurityManager( new RMISecurityManager() );
        StockMarketImpl myObject = new StockMarketImpl( "NASDAQ" );
        System.out.println( "RMI StockMarketServer ready..." );
    } i got the following error
    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: SimpleStocks.StockMarketImpl_Stub
    RMI StockMarketServer ready...Interface class, Interface implementation class and stub all reside in MyProjects\StockRMI\SimpleStocks directory
    where as Server class(StockMarkerServer) is in MyProjects\StockRMI
    even i place the stub in MyProjects\StockRMI directory i got the same error.
    Can any one please save me out of this problem

    hurry!
    Thank u First of all
    I got it.. finally after 2 days
    The error is in CLASSPATH only , i set it
    Thanks once again

  • Java.rmi.ServerException: RuntimeException

    Hi All,
    i had an issue related to sockets.Please see the code below where am getting the following exception,
    java.rmi.ServerException: RuntimeException; nested exception is:
    java.lang.RuntimeException: java.io.EOFException
    what my concern is while debugging am not getting this issue.
    code comes here-----------------------------------------------
    Socket s = null;
    byte[] readBytes1 = null;
    try {
    s = new Socket(txControlServer, 7777);
    SocketObject sob = makeSocketObject(pFromFiles, pToFiles, pCorrStylesheets,
    pHTMLUtilityServer, pOrientation, pDocumentClassif, pClientInfo, pFormats,
    pCorrCode, images);
    ObjectOutputStream oos = new ObjectOutputStream(s.getOutputStream());
    oos.writeObject(sob);
    ObjectInputStream ois = new ObjectInputStream(s.getInputStream());
    readBytes1 = ((SocketObject) ois.readObject()).getFileData();
    System.out.println("The byte length " + readBytes1.length);
    ois.close();
    oos.close();
    s.close();
    System.out.println("\n----------------The length of the bytes read first ----- "
    + readBytes1.length);
    catch (Exception e) {
    ExceptionUtil.wrap(e);
    Am getting the exception at this line in the above code
    ObjectInputStream ois = new ObjectInputStream(s.getInputStream());
    Can any one help me out why this problem occurs and how to resolve.
    Thanks in Advance,
    vamsy.

    The other side has closed the socket before sending you an object.

  • Java.rmi.ServerException: Missing port information

    when i call the service ,i got the error:
    run-test-client:
    [java] java.rmi.ServerException: Missing port information
    [java] at com.sun.xml.rpc.client.StreamingSender._raiseFault(StreamingS
    ender.java:382)
    [java] at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.
    java:234)
    [java] at sys.SetIF_Stub.getdeviceid(SetIF_Stub.java:68)
    [java] at sys.StockPriceFetcher.getdeviceid(Unknown Source)
    [java] at sys.TestPriceFetcher.main(Unknown Source)
    what cause it??
    in my SetImpl.java i use wurfltags.jar
    //SetImpl.java
    package sys;
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import net.sourceforge.wurfl.wurflapi.*;
    public class SetImpl implements SetIF {
         private String ret="";
    private ProConf pc;
    private MyObjectsManager mom;
         public SetImpl(){}
    public String getdeviceid(String request)
    String result="";           
    try{              
    mom=new MyObjectsManager();
    mom.wurflWebInit();
    UAManager uam =mom.getUAManagerInstance();
    result=uam.getDeviceIDFromUA("MOT-T720/05.08.41R MIB/2.0 Profile/MIDP-1.0 Configuration/CLDC-1.0");
    System.out.println(result);
    catch(Exception e){}
    return result;     
    and, i generate the wsdl file and deploy it successfully. but in the client
    when i call the service it will be error.
    the client code is:
    /////////StockPriceFetcher.java
    package sys;
    import javax.xml.rpc.*;
    import com.sun.xml.rpc.client.*;
    public final class StockPriceFetcher {
    public static final String getdeviceid(String req,String endpoint) {
    String result="";
    try {
    SetIF_Stub stub =(SetIF_Stub)(new SystemConfiguration_Impl().getSetIFPort());
    stub._setProperty(javax.xml.rpc.Stub.ENDPOINT_ADDRESS_PROPERTY,endpoint);
    result = stub.getdeviceid(req);
    } catch (Exception ex) {
    ex.printStackTrace();
    return result;
    } // getLonNowItem
    //////////////////////TestPriceTetcher.java
    package sys;
    import java.math.BigDecimal;
    import java.util.*;
    public class TestPriceFetcher {
    public static void main(String[] args) {
    try {
    // String result=StockPriceFetcher.endsetinfo("ball=5&srv=7&pcode=500001","http://192.152.251.224:8080/jaxrpc-sys/jaxrpc");
    String result=StockPriceFetcher.getdeviceid("ball=5&srv=7&pcode=500001","http://192.152.251.224:8080/jaxrpc-sys/jaxrpc");
    System.out.println(result+"bb");
    } catch (Exception ex) {
    ex.printStackTrace();
    when i run the testpricefetcher.java it will raise the above error infomation.
    it spent 2 days for me to find the problem, but i cannot solve it.
    i think it does matter with the wurfl package.because i doesnt use the method of the package in the SetImpl.java it will be ok. How to call the package?please give me a hand.

    can you give me a hand!thank you

  • Java.rmi.ServerException: JAXRPCSERVLET28: Missing port information

    Hi
    We are getting errors when we run the webservice client..
    With this we have also provided the webservice code.
    Please any one help us to resolve this issue...
    Thanks in advance.
    We are using
    J2EE 1.4
    Error:
    java.rmi.ServerException: JAXRPCSERVLET28: Missing port information
    at com.sun.xml.rpc.client.StreamingSender._raiseFault(StreamingSender.ja
    va:510)
    at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:307
    at com.sun.xml.rpc.client.dii.CallInvokerImpl.doInvoke(CallInvokerImpl.j
    ava:103)
    at com.sun.xml.rpc.client.dii.BasicCall.invoke(BasicCall.java:492)
    at com.sun.xml.rpc.client.dii.CallInvocationHandler.doCall(CallInvocatio
    nHandler.java:121)
    at com.sun.xml.rpc.client.dii.CallInvocationHandler.invoke(CallInvocatio
    nHandler.java:85)
    at $Proxy0.flowrequest(Unknown Source)
    at dynamicproxy.MathClient.main(MathClient.java:52)
    Web service Client Code:
    package dynamicproxy;
    import java.net.URL;
    import javax.xml.rpc.Service;
    import javax.xml.rpc.JAXRPCException;
    import javax.xml.namespace.QName;
    import javax.xml.rpc.ServiceFactory;
    //import com.ibm.ctg.client.JavaGateway;
    //import com.ibm.ctg.client.ECIRequest;
    import dynamicproxy.*;
    public class MathClient
    static String message;
    static String err=null;
         static StringBuffer sb = null;
         public String s1;
         public static int iValidationFailed = 0;
    public static void main(String[] args)
    try {
    String nameSpaceUri = "urn:Foo";
    String serviceName = "CtgService";
    String portName = "MathFacePort";
    // Specify the location of the WSDL file
    URL url = new URL("http://localhost:8080/math-ctgservice/math?WSDL");
    // Create an instance of service factory
    ServiceFactory serviceFactory = ServiceFactory.newInstance();
    // Create a service object to act as a factory for proxies.
    Service mathService = serviceFactory.createService(url,
    new QName(nameSpaceUri, serviceName));
    // Create a proxy
    dynamicproxy.MathFace
    myProxy = (dynamicproxy.MathFace) mathService.getPort(new
                             QName(nameSpaceUri,
    portName), dynamicproxy.MathFace.class);
    // Invoke the add method
    //System.out.println(myProxy.add(23, 12));
              //get the input value and pass it to the function
                   String a = args[0]+"~"+"------------------------------------------------------------";
                   //String a = b.toUpperCase();
                   // Invoke the add method
                   myProxy.flowrequest(a);
                   System.out.println("Message:"+message);
         catch (Exception ex)
    ex.printStackTrace();
    }

    As is so often the case, Google is your friend.
    Googling for the exception message (JAXRPCSERVLET28: Missing port information) yields the following list.
    http://www.google.com/search?hl=en&q=JAXRPCSERVLET28%3A+Missing+port+information&btnG=Google+Search
    Follow the bouncing link, it will lead you to the solution.
    PS.

  • Java.rmi.ServerException: RemoteException occurred in server thread

    I have written a simple CMP Entity Bean,While Running the Client I am getting the Exception,I have included all jars needed.
    EXCEPTION IS
    err in HomeCreatejava.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
    java.rmi.ServerException: Could not instantiate bean; nested exception is:
    java.lang.InstantiationException; nested exception is:
    java.rmi.ServerException: Could not instantiate bean; nested exception is:
    java.lang.InstantiationException
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
    java.rmi.ServerException: Could not instantiate bean; nested exception is:
    java.lang.InstantiationException; nested exception is:
    java.rmi.ServerException: Could not instantiate bean; nested exception is:
    java.lang.InstantiationException
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:287)
    at sun.rmi.transport.Transport$1.run(Transport.java:151)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:147)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:463)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:704)
    at java.lang.Thread.run(Thread.java:539)
    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:250)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:226)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:136)
    at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
    at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:128)
    at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:108)
    at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:73)
    at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:76)
    at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:185)
    at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76)
    at $Proxy0.create(Unknown Source)
    at StudentClient.main(StudentClient.java:39)
    Caused by: java.rmi.ServerException: Could not instantiate bean; nested exception is:
    java.lang.InstantiationException; nested exception is:
    java.rmi.ServerException: Could not instantiate bean; nested exception is:
    java.lang.InstantiationException
    at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:140)
    at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:167)
    at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:52)
    at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:104)
    at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:109)
    at org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:487)
    at org.jboss.ejb.Container.invoke(Container.java:726)
    at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:1055)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
    at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:362)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:42)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:28)
    at java.lang.reflect.Method.invoke(Method.java:313)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:256)
    at sun.rmi.transport.Transport$1.run(Transport.java:151)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:147)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:463)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:704)
    at java.lang.Thread.run(Thread.java:539)
    Caused by: java.rmi.ServerException: Could not instantiate bean; nested exception is:
    java.lang.InstantiationException
    at org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.java:211)
    at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:122)
    at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:79)
    at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:44)
    at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:98)
    ... 20 more
    Caused by: java.lang.InstantiationException
    at sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(InstantiationExceptionConstructorAccessorImpl.java:33)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:263)
    at java.lang.Class.newInstance0(Class.java:301)
    at java.lang.Class.newInstance(Class.java:254)
    at org.jboss.ejb.plugins.BMPPersistenceManager.createBeanClassInstance(BMPPersistenceManager.java:145)
    at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.createBeanClassInstance(CachedConnectionInterceptor.java:251)
    at org.jboss.ejb.EntityContainer.createBeanClassInstance(EntityContainer.java:294)
    at org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.java:208)
    ... 24 more
    Pls explain what can i do now.
    regards,
    NaveenBabu.A
    my client code is
    import javax.ejb.*;
    import javax.naming.*;
    import java.rmi.*;
    import javax.rmi.*;
    import java.util.*;
    import student.student1.*;
    public class StudentClient
    public static void main(String args[])
    System.out.println("i am in start");
    StudentHome home= null;
    try{
    System.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
    System.setProperty("java.naming.provider.url", "localhost:1099");
    Context context = new InitialContext();
    try{
    home = (StudentHome)PortableRemoteObject.narrow(context.lookup("Student"), StudentHome.class);
    }catch(Exception e){System.out.println("err in StudentHome"+e);}
    /* try{
    home.create("Ammamn","A01");
    }catch(Exception e){System.out.println("err in HomeCreate"+e);}*/
    }catch(Exception e){System.out.println("error in client"+e);}
    System.out.println("i am in end");
    }

    Try this,
    Context context = new InitialContext(System.getProperties());

  • Java.rmi.ServerException: Internal Server Error (serialization error....)

    Hi to all.
    I have two classes.
    The first is:
    public class FatherBean implements Serializable {
    public String name;
    public int id;
    /** Creates a new instance of ChildBean */
    public FatherBean() {
    this.name= null;
    this.id = 0;
    public String getName() {
    return name;
    public void setName(String name) {
    this.name = name;
    public int getId() {
    return id;
    public void setId(int id) {
    this.id = id;
    The second is :
    public class ChildBean extends FatherBean implements Serializable {
    public double number;
    /** Creates a new instance of ChildBean */
    public ChildBean() {
    super();
    this.number = 0.0;
    public double getNumber() {
    return number;
    public void setNumber(double number) {
    this.number = number;
    A test client class implements the following method that is exposed as web service:
    public java.util.Collection getBeans() {
    java.util.Collection beans = new ArrayList();
    ChildBean childBean1 = new ChildBean();
    ChildBean childBean2 = new ChildBean();
    childBean1.setId(100);
    childBean1.setName("pippo");
    childBean1.setNumber(3.9);
    childBean2.setId(100000);
    childBean2.setName("pluto");
    childBean2.setNumber(4.7);
    beans.add(childBean1);
    beans.add(childBean2);
    return beans;
    When I invoke the web service to url:
    http://localhost:8080/Prova
    and invoke the correspondent method on jsp client, throws exception:
    java.rmi.ServerException: Internal Server Error (serialization error: no serializer is registered for (class test.ChildBean, null))
         at com.sun.xml.rpc.client.StreamingSender._raiseFault(StreamingSender.java:357)
         at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:228)
         at ws.ProvaClientGenClient.ProvaRPC_Stub.getBeans(ProvaRPC_Stub.java:59)
         at ws.ProvaClientGenClient.getBeans_handler.doAfterBody(getBeans_handler.java:64)
         at jasper.getBeans_TAGLIB_jsp._jspService(_getBeans_TAGLIB_jsp.java:121)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.iplanet.ias.web.jsp.JspServlet$JspServletWrapper.service(JspServlet.java:552)
         at com.iplanet.ias.web.jsp.JspServlet.serviceJspFile(JspServlet.java:368)
         at com.iplanet.ias.web.jsp.JspServlet.service(JspServlet.java:287)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:720)
         at org.apache.catalina.core.StandardWrapperValve.access$000(StandardWrapperValve.java:118)
         at org.apache.catalina.core.StandardWrapperValve$1.run(StandardWrapperValve.java:278)
         at java.security.AccessController.doPrivileged(Native Method)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:274)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:203)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
         at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:157)
         at com.iplanet.ias.web.WebContainer.service(WebContainer.java:598)
    Where is the problem? Will be ChildBean that extends FatherBean? Wich settings on Sun Java Studio Enterprise 6 2004Q1?
    Thank you.

    Hi,
    This forum is for Sun Java Studio Creator related questions. Could you pls post your message in the appropriate forum.
    Thank you
    Cheers :-)

  • Java.rmi.ServerException: Internal Server Error (deserialization error: XML

    I am trying to transmit a document as a byte array to a web service using jax-rpc, and I get the following error:
    2004-05-25 08:04:39,468 exception [Thread-5] - [email protected]33fd java.rmi.ServerException: Internal Server Error (deserialization error: XML parsing error: com.sun.xml.rpc.sp.ParseException:58: Expected "</ns0:receivexmldocument>" to terminate element starting on line 2)
         at com.sun.xml.rpc.client.StreamingSender._raiseFault(StreamingSender.java:370)
         at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:231)
         at com.mobius.cmsl.client.contentindexlistener.ContentWebServiceListenerIF_Stub.receivexmldocument(ContentWebServiceListenerIF_Stub.java:63)
         at com.mobius.cmsl.adapters.convera.client.ContentWebServiceClient.sendxml(ContentWebServiceClient.java:89)
         at com.mobius.cmsl.adapters.convera.client.ContentInterceptor.doGet(ContentInterceptor.java:89)
         at com.mobius.cmsl.adapters.convera.client.ContentInterceptor.doPost(ContentInterceptor.java:110)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
         at java.lang.Thread.run(Thread.java:536)
    The code looks like:
    Client:
    clientStub = (ContentWebServiceListenerIF_Stub)new ContentIndexService_Impl().
    getContentWebServiceListenerIFPort();
    clientStub._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, endPoint);
    obj = clientStub.receivexmldocument(cd.externalLink.contents,inxml);
    Web Service:
    public String receivexmldocument(byte docstream[],
    String inxml
    ) throws RemoteException {
    The wsdl looks like:
    <message name="ContentWebServiceListenerIF_receivexmldocument">
    <part name="arrayOfbyte_1" type="xsd:base64Binary"/>
    <part name="String_2" type="xsd:string"/></message>
    <operation name="receivexmldocument" parameterOrder="arrayOfbyte_1 String_2">
    <input message="tns:ContentWebServiceListenerIF_receivexmldocument"/>
    <output message="tns:ContentWebServiceListenerIF_receivexmldocumentResponse"/></operation>
    The documents I am sending do contain special characters like maybe japanese or italian.

    Sounds like the xml you are sending is not well-formed. Please start with simple xml documents to see if it works.

  • RemoteException: 111 java.rmi.ServerError: Error occurred in server thread

    Hi,
    I'm just new to the RMI field of JAVA. I'm trying to write a program that import the math.jar file in the server side. And the client end can invoke the methods of math.jar and get the value.
    I got the error messages as below:
    RemoteException: 111 java.rmi.ServerError: Error occurred in server thread; nested exception is:
         java.lang.NoClassDefFoundError: org/mathwhizz/Heron
    It can work well if I use source classes(*.class) directly instead of importing math.jar. The failure only happened when I try to make use of jar file. Thus I guess my setup and configuration should be ok. Is there anything I should be very careful if I try to run RMI and import a jar file in the program of server side ?
    Do I need to use JNLP and web start application in this issue?
    I'm appreciated for your responses...thanks...
    Sincerely,
    Brandon

    I've got a problem with rmi, when I launch my server, I have this error:
    Erreur du remote: java.rmi.ServerError: Error occurred in server thread; nested exception is:
    java.lang.NoClassDefFoundError: com/borland/dx/dataset/DataSetData
    Help me please
    Thank you

  • WS - "java.rmi.MarshalException: (1)Missing end tag for Body or Envelope"

    HI All,
    I'm new of this forum but I really hope you could help me solving the problem I have to connect Web Services and midlets.
    Somehow my configuration works with some services I've found online but when I invoke very simple services deployed on my server(s) I always have "java.rmi.MarshalException: (1)Missing end tag for Body or Envelope" exception"
    Let me add some more information to the problem:
    System Configuration:
    - JBoss (but I also tried axis) - standard installation (http/1.1)
    - WTK 2.5 (but I also tried 2.2) - standard installation
    - I tried "trusted" and "untrusted" security configuration of the servlet
    - Netbeans IDE 5.0 (to create both Midlets and WS)
    - WS uses document/literal as expected by JSR 172
    The midlet is created with no problems but at the time of invocation the server throws the above exception (which is part of rmi. remoteException)
    By monitoring the network both at client and server side I noticed that the information received is chuncked after 768 bytes. However, If the (soap) reponse is less than such value, I still have the error.
    Using Http/1.1. at the mobile side, the service does not return me anything (0kb) while if I set the mobile device to http/1.0, I get the above error.
    I really have to make the midlet running so any type of help will be really appreciated!!
    Thanks in advance

    Hi all,
    as many developers I have encountered the famous "java.rmi.MarshallException:(1)Missing end tag for Body or Envelope" during the development of my WS app for J2ME (JSR 172).
    It is correct that is the empty tag <soapenv:Header /> causing this error.
    To fix this error, it is necessary to stop the server to generate this empty header in the response stream.
    I have fixed this error for Axis2: unfortunaly it is necessary to modify a class in Axiom library. This library is used in Axis2 to produce the SOAP response, you can download the source code at http://ws.apache.org/commons/axiom/source-repository.html.
    Here the class to modify:
    axiom\modules\axiom-impl\src\main\java\org\apache\axiom\soap\impl\llom\soap11\SOAP11Factory.java
    by commenting the line 273 in the method called getDefaultEnvelope() to prevent the empty header insertion in SOAP response:
    public SOAPEnvelope getDefaultEnvelope() throws SOAPProcessingException {
            OMNamespace ns =
                    new OMNamespaceImpl(
                            SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI,
                            SOAP11Constants.SOAP_DEFAULT_NAMESPACE_PREFIX);
            SOAPEnvelopeImpl env = new SOAPEnvelopeImpl(ns, this);
            //createSOAPHeader(env); the line to be commented
            createSOAPBody(env);
            return env;
        }Finally you have to recompile Axiom using Maven to obtain the fixed package axiom-impl.jar and to replace this package on the lib repository of your Axis2 server.
    A little tricky to fix this bug but now my app runs perfectly ;)
    Enjoy!
    Romain Pellerin
    http://www.gasp-mobilegaming.org

  • Java RMI & XML parsing.

    I'm new to Java so any help is greatly appreciated.
    I trying to develop a distributed application using Java RMI that allows a user to enter a users name and be returned their email address and telephone number.
    The details of users will be stored in an XML file. What the best way of developing this application? Should the XML file stay on the server side at all times and parse it from the server side, or is it best to send the whole XML document to the client and then parse the XML document for the information required at the client side?
    Sorry if this seems a little bit of a lame question but as I say, I'm a newbie to Java and any help would be much appreciated!!!

    I would suggest the data (the XML file in your case) should live on the server, and the client should send messages to the server saying "Here's the user's name, give me the e-mail address and phone number". Sending the entire data set to the client for every request would be very expensive in terms of network bandwidth; if you had 10,000 users, you would only want to send the information for the one user the client was interested in, not the information for all 10,000.

Maybe you are looking for

  • New Apple Tv will not connect with iPad Air 2

    My new Apple TV will not recognize my iPad Air or Air 2, but will recognize all other devices in the house (iPhone 5c, 5s,  6, iPad mini, MacBook, etc).  What am I missing that the new Airs will not connect? All software is up to date. they are on sa

  • Help - Could not load 'oracle.jdbc.driver.OracleDriver ...

    I'm using oci8 to connect to the Oracle database. URL: jdbc:oracle:oci8:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(PORT=1527)(HOST=testhost)))(CONNECT_DATA=(SID=fnoe2pa))) When I tried to start the weblogic server, I got the following errors

  • Transaction code for SAP reports

    Hello All, What is the transaction code which displays SAP reports? I saw in SDN forums but unable to track it down. Can somebody help me? Thanks. Best Regards, Subhakanth

  • Firefox sometimes takes 100% of one of my four CPUs under Windows (7)

    A few times a day I'll hear the CPU fan running, or my PC starts responding slowly. Sometimes it won't open (maximize) from the task bar. I usually have to Control-Alt-Delete to go to processes. When I do, Fire Fox is using 100% of of of my quad CPU'

  • ITunes has gone crazy in Mountain Lion - HELP!

    I just upgraded to Mountain Lion, and now iTunes appears to take over my computer whenever I have my iPhone, iPod or iPad attached. If I switch to another app, the computer switches back to iTunes after a few seconds. If I quit iTunes, it starts up a