Unseen exception (RMI)

I am using RMI to create a client server hotel booking system applet.
My client sends the server a new booking by calling the addBooking() method that the server provides. iI get the following error when I try to send it to the server that I don't understand.
MalformedURLException
java.rmi.MarshalException: error marshalling arguments; nested exception is:
        java.io.NotSerializableException: BookingCan anyone help?

It didn't but I added the "implements seriailizable" bit and now get this exception.
MalformedURLException
java.rmi.ServerException: RemoteException occurred in server thread; nested exce
ption is:
        java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
tion is:
        java.io.InvalidClassException: Booking; class invalid for deserializatio
nI don't want to paste all my code since it is quite a lot. Does anyone know what my problem might be?
Andy

Similar Messages

  • Error in exception(RMI)

    Hi all, im trying to run so many codes using java RMI and nothing seems to work. im on the point of banging my head on the PC.
    Im sure evryone is aware of the popular Calculator example: Calcuator.java, CalcuatorImpl.java, CalcuatorClient.java and CalcuatorServer.java. I hae done this and other examples at University and they executed and compiled all fine but when I run them on my own PC, I get the following error. could some one help me please.
    java.rmi.ServerException: RemoteException occurred in server thread;
    nested exception is:
    java.rmi.UnmarshalException: error unmarshalling arguments;
    nested exception is:
    java.lang.classNotFoundException: Calculator

    What happened to the bank, did you sort it out?ya man.... at least let us know did the bank thing worked out or not? these are common ettiquets...

  • Unseen exception before

    Hi All,
    I am building an RMI application based on a server and a client which is an applet (with a callback).
    The whole thing is working fine whe I use Applet viewer.
    But when I use it in IE5.5 with the JAVA 1.3 plugin I get this Exception:
    RemoteException:
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
         java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
         java.net.MalformedURLException: no protocol: de
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
         java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
         java.net.MalformedURLException: no protocol: de
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
         java.net.MalformedURLException: no protocol: de
    java.net.MalformedURLException: no protocol: de
         at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
         at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
         at sun.rmi.server.UnicastRef.invoke(Unknown Source)
         at RMIServer_Stub.registerTimeMonitor(Unknown Source)
         at Applet1.init(Applet1.java:56)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)This happens when I try to call on of the remote method after binding to the server.
    Any Ideas ???
    Raph

    How do you make the client stub class available to the Server? Is it present in Server JVM's classpath or are you relying upon the dynamic class loading of the stub class from the client to the server?
    If you're using dynamic class loading (and from your description it seems so) then make sure that the java.rmi.server.codebase property has been set appropriately in the client side so that the server can get the Stub class definition of the client when you register the client as a remote object to the server. From the stack trace it looks like the server can't unmarshall the remote reference passed by the client because of a malformed URL while trying to get the client Stub class.
    Try this first. Keep the client stub (generated by rmic) in the server's classpath and code just the way you're doing now. I think the problem will then disappear.
    Of course that may not be a desirable solution (especially if your client is an applet). In that case you'll have to figure out ways of making the client stub available to the server JVM. You may end up writing your own custom RMIClassLoader or explicitly use RMIClassLoader.loadClass() method.

  • Exception when using RMI in tomcat 5.5, after reloading webapp

    When I freshly start tomcat and deploy my web app, I can use RMI by creating a local registry and binding my objects.
    However, as soon as I reload the web application, RMI no longer works and gives me this exception:
    RMI error: error unmarshalling return; nested exception is:
            java.io.EOFException
    java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
            java.io.EOFException
            at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
            at java.rmi.Naming.lookup(Naming.java:84)
            at nl.heliotrope.tropebiz.tools.NutchRestarter.main(NutchRestarter.java:33)
    Caused by: java.io.EOFException
            at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2498)
            at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1273)
            at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
            at sun.rmi.server.MarshalInputStream.readLocation(MarshalInputStream.java:285)
            at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:167)
            at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1544)
            at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1466)
            at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1699)
            at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
            at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
            ... 3 moreThe code to register my RMI object:
            logger.debug("Setting up RMI");
            //bind remote manager object to rmi resource
            RemoteManager remoteManager = new RemoteManager();
            try {
                Naming.rebind(rmiResource, remoteManager);
            } catch (MalformedURLException e) {
                throw new RuntimeException("Cannot happen: " + e.getMessage());
            } catch (RemoteException e) {
                /* perhaps the registry was not started yet? Attempt.
                 * Cannot create registry automatically at web application startup,
                 * because another app may have done so already.
                logger.debug("Error registering remote manager to RMI, " +
                        "service not running? Starting the registry.");
                try {
                    LocateRegistry.createRegistry(1099);
                    Naming.rebind(rmiResource, remoteManager);
                    logger.debug("RMI Registry started and remote manager registered");
                } catch (RemoteException e2) {
                    logger.error("Failed to start RMI registry or register RemoteManager!");
                    throw new RemoteException("rebind: " + e2.getMessage());
                } catch (MalformedURLException e2) {
                    throw new RuntimeException("Cannot happen: " + e.getMessage());
            logger.debug("RMI set up successfully");And client code:
                IRemoteManager remoteManager = (IRemoteManager)Naming.lookup(RemoteManager
                        .getRMIResource("127.0.0.1", 1099));Trying set a RMISecurityManager breaks tomcat horribly by the way, but since RMI works with a fresh tomcat startup, I suppose there's no problems there.

    Hi all!
    I get the same Exception using Tomcat 5.5. When registering an object outside tomcat lookup works fine. Only when registering an object inside a webapp!
    Would be great if anyone got a tip to solve it!
    Greetings...

  • RMI ClassNotFoundException:HelloImpl_stub

    Hi there,
    I'm trying to start my Rmi Server but I always get this exception:
    RMI ClassNotFoundException:HelloImpl_Stub
    In the rmiregistry window the following message appears:
    File not found when looking for: HelloImpl_stub
    All my class files are in the dir c:\mysrc, and I started rmiregistry there, with no classpath setted. The classes aren't inside packages.
    Then, I used the following command line, with the CLASSPATH including c:\mysrc :
    java -Djava.rmi.server.codebase=file:c:\mysrc -Djava.rmi.server.hostname=computer07 HelloImpl
    When I do that I get those messages showed above.
    I'm using Windows NT Workstation and I'm not using a Web Server.
    I would aprecciate any help.
    Thanks,
    Nei

    java -Djava.rmi.server.codebase=file:c:\mysrc
    -Djava.rmi.server.hostname=computer07 HelloImpl
    try using file:/c:\mysrc

  • Change of ip in wireless networks - urgent!

    hi everyone!
    i am developing an application using rmi in a wlan network and face the following problem:
    my application is distributed among a notebook and a pda, uses rmi for all transfer and method invokation and works fine after setup.
    but when my pda changes its ip address (dhcp), problems come up.
    i do rebind and export correctly, but still receive a java.rmi.ConnectException because rmi still tries to send the objects to the old ip address, which is not valid any more.
    does rmi cache this ip somewhere? how can i work around this problem?
    what do i have to do to make rmi recognize the new ip?
    any cure???
    thanks for help!!
    kirk

    hi ejp!
    thanks for reply, but i do exactly want you tell me to do:
    program works like this:
    export object
    rebind
    lookup
    change of ip new object
    export
    rebind
    lookup stub
    i cannot unexport the old object, since i have to use personal java on the pda, so i create a new object and still receive a connect exception.
    rmi cannot make a connection to old ip address and is not recognizing that my device changed its location.
    still any ideas?
    thx a lot!
    kirk

  • Tutorial problems

    Hi!
    I'm trying to learn how to use RMI, but I'm stuck even with tutorial. I just can't compile that simple HTTP server, I get error:
    ClassFileServer.java:22:cannot find symbol
    symbol: class ClassServer
    public class ClassFileServer extends ClassServer {
    I'm sure it's something simple, I just never worked with this suff.
    Thanks!

    I followed everything in the tutorial as written. But to be honest, either I'm doing something really wrong, or there is problem with this tutorial, because even before I tried to run that server, I noticed warnings in interface Compute and class ComputePi, which I think shouldn't be there, since it's copy-paste tutorial...
    Never mind, I found another one [http://java.sun.com/developer/onlineTraining/rmi/exercises/BootstrapExample/index.html] and started HTTP server successfuly. But when I tried to start RMIServer, I got exception
    "RMI TCP Connection(idle)" java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:3285 accept,resolve)
    Is it problem with the port? I'm not sure what to set there, when I'm trying to do it on localhost.
    Edited by: Herald85 on Jul 21, 2010 3:57 PM
    Edited by: Herald85 on Jul 21, 2010 4:01 PM

  • Client can't access Serializable classes on Server

    Hi there, i have created a very simple client server model and had it running fine. I then added a new serializable class to the server and return it in a new method. Now when i try to run that method on the client side it complains it cannot find my new serializable class ("no class def found exception: rmi/server/ServerObject.class"). This is how it's setup at the moment:
    Server
    -ServerFront extends Remote
    -Server implements ServerFront
    -ServerObject implements Serializable
    The server binds itself to the registry as such:
    ServerFront engine = new Server();
    String name = "Server";
    ServerFront stub = (ServerFront)UnicastRemoteObject.exportObject(engine, 0);
    Registry registry = LocateRegistry.getRegistry();
    registry.rebind(name, stub);The ServerObject class looks like this:
    public class ServerObject implements Serializable
        private static final long serialVersionUID = 10L;
        //methods
    }The ServerFront interface has a method as such:
    ServerObject getServerObject () throws RemoteException;    Client
    -Client
    The client gets a reference to the server as follows:
    String name = "Server";
    Registry registry = LocateRegistry.getRegistry("127.0.0.1");
    server = (ServerFront)registry.lookup(name);Then tries to run the getServerObject() method:
    ServerObject = server.getServerObject();I run the client and server from jar files using the following commands:
    start java -Djava.rmi.server.codebase="http://www.xenwars.com/Server.jar" -Djava.security.policy=security.policy -jar Server.jar
    java -Djava.security.policy=security.policy -jar Client.jar"security.policy" allows all access, and the codebase URL points to my webserver where i uploaded an identical copy of the Server jar file that i'm trying to run.
    So... i've read all the Sun documentation and such and i'm massively confused why my client isn't simply downloading the serializable class as it's supposed to. Any help is massively appreciated, thanks :D
    Edited by: Aldarn on Feb 8, 2009 10:03 AM
    Edited by: Aldarn on Feb 8, 2009 10:05 AM

    By a mirrored interface i mean i just created an interface based off my existing serializable classes, i.e. copied the method constructors into an interface class and made the serializable class implement that interface.
    I think that must have been the problem then, that i wasn't giving the client an interface to the serializable classes on the server that it was attempting to download. I thought by using RMI on a serializable class it would just download that class when it needs it and so wouldn't need an interface pre-defining it.
    Thanks for the help! I'm now working on a system with 3 servers and one client, where two servers have various methods implemented and the third one acts as a bridge between the other two servers and the client - so the client only has to deal with one server. It's working fine but it's pretty annoying having to mirror all the methods from both servers' interface classes in the server that acts as a bridge's interface class - is there any way that the bridge server can inherit the other two servers interfaces into its own so i don't need to make loads of duplicate "shell" methods like this:
    // second server
    public ArrayList<Thing> getAllThings ()
        return things;
    // bridge server
    private SecondServerFront secondServer; // reference loaded in constructor
    public ArrayList<Thing> getAllThings () throws RemoteException
        return secondServer.getAllThings();
    }  

  • OS Signal Handling problem

    Hi, I have a problem trying to handle operating system signals. The exception I get is: Exception already handled by de JVM.
    The enviroment that runs my application is:
    -IBM AIX 4.3
    -IBM JRE 1.3.0
    The process is launched with "nohup"
    The complete line is: nohup java -jar -Dlog4j.configuration=log.xml etec.jar >/dev/null 2>/dev/null &The code is:
    try
      if (senyalInterrupcion != null)
        Signal.handle(new Signal (signalName), new SignalHandler ()
          public void handle(Signal arg0)
            System.exit(0);
    catch (IllegalArgumentException ex)
      ex.printStackTrace ();
    }I know that the use of com.sun.* classes is not recommended by Sun, but I need to communicate the JVM in wich my application run with the shell, if anyone knows a better method (except RMI) please let me know.
    P.S. Sorry for my english
    Thanks in advance,
    Juanjo

    As of jdk1.3, run w/ Java -Xrs option (i.e., java -Xrs myProg) so default JVM signal handlers are not run. Then, you can install your own signal handlers using sun.misc.Signal and SignalHandler and they will not conflict with the JVM's handlers. See the following article for excellent coverage of the topic:
    http://www-106.ibm.com/developerworks/ibm/library/i-signalhandling/

  • Exception occured: java.rmi.NotBoundException: ebillRMIImplInstance

    Hi pls help me ...
    this is the exception i got while running my client jar file...
    i;m not able to correct it...i'm using netbeans 6..
    my client method is as given below...
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {      
    System.setSecurityManager(new RMISecurityManager());
    int itemid;
    String serverName ="";
    String itid="";
    serverName = "localhost";
                        ResultSet res=null;
    itid=jTextField1.getText();
    //itemid=Integer.parseInt(itid);
    System.out.println(itid);
    try
    //bind server object to object in client//rmi://host:<port>/correlator
    ebillRMIInterface ebillserver = (ebillRMIInterface) Naming.lookup("rmi://"+serverName+"/ebillRMIImplInstance");
    System.out.println("asd");
    //invoke method on server object
    /*Date d = myServerObject.getDate();
    System.out.println("Date on server is " + d);*/
                                  String str="select * from Stock where itemid='"+itid+"'";
                                  res=ebillserver.select(str);
    while(res.next())
    jTextField2.setText(res.getString(2));
    Float price=res.getFloat(4);
    String pr=String.valueOf(price);
    jTextField3.setText(pr);
    String str1="update Stock set itemname='Tea250' where itemid='1'";
                   ebillserver.insert(str1);System.out.println("updated ");
    catch(Exception e)
    System.out.println("Exception occured: " + e);
    //System.exit(0);
    System.out.println("RMI connection successful");
    }

    The remote object hasn't bound itself to that registry under that name.

  • Rmi-iiop: calling secured method on Ejb -- NO PERMISSION Exception

    In WL6.1, I have an Ejb with secured methods. The (Swing) client application accesses the Ejb through rmi-iiop using the JDK1.3.1 Orb.
    Unfortunately, it seems that the caller identity (which was supplied in the InitialContext lookup) is not propagated
    to the server: any call to a secured method
    fails with a CORBA NO_PERMISSION Exception.
    Using the t3 protocol the program works fine, but that would require the 25Mb weblogic.jar on all clients, which is unattainable for us.
    Any ideas how this situation can be corrected?
    -Allard Siemelink

    Hi Allard,
    Please pose this in the weblogic.developer.interest.rmi-iiop.
    Thanks,
    Allard Siemelink wrote:
    In WL6.1, I have an Ejb with secured methods. The (Swing) client application accesses the Ejb through rmi-iiop using the JDK1.3.1 Orb.
    Unfortunately, it seems that the caller identity (which was supplied in the InitialContext lookup) is not propagated
    to the server: any call to a secured method
    fails with a CORBA NO_PERMISSION Exception.
    Using the t3 protocol the program works fine, but that would require the 25Mb weblogic.jar on all clients, which is unattainable for us.
    Any ideas how this situation can be corrected?
    -Allard Siemelink--
    Apurb Kumar
    Developer Relations Engineer
    BEA Support

  • 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

  • RMI exception calling web service from proxy class

    I am getting the following error attempting to call a web service from a proxy. It appears to relate to the type of objects I am trying to send vs the type that is expected. Following the exception I am adding a copy of the control where calling the web service is sucessful, a copy of the proxy class that I am using to make this unsucessful call, and the controller.jpf that has the formBean where I am creating my objects
    Caught Exception Calling the Web Service from the Proxy. The Exception is the f
    ollowing: java.rmi.RemoteException: web service invoke failed: javax.xml.soap.SO
    APException: failed to serialize class org.openuri.www.CreateAccountCheckingReq
    uestweblogic.xml.schema.binding.SerializationException: type mapping lookup fail
    ure on class=class controls.CheckingService$anyType TypeMapping=TYPEMAPPING SIZE
    =5
    ENTRY 1:
    class: org.openuri.www.CreateAccountCheckingResponse
    xsd_type: ['http://www.openuri.org/']:lcl0:CreateAccountCheckingResponse
    ser: org.openuri.www.CreateAccountCheckingResponseCodec@c0f4da
    deser: org.openuri.www.CreateAccountCheckingResponseCodec@b1dd4
    ENTRY 2:
    class: org.openuri.www.FundingInfoAnonType
    xsd_type: ['http://www.openuri.org/']:lcl0:FundingInfoAnonType
    ser: org.openuri.www.FundingInfoAnonTypeCodec@1d36711
    deser: org.openuri.www.FundingInfoAnonTypeCodec@13a59e
    ENTRY 3:
    class: org.openuri.www.AccountInfoAnonType
    xsd_type: ['http://www.openuri.org/']:lcl0:AccountInfoAnonType
    ser: org.openuri.www.AccountInfoAnonTypeCodec@1de5959
    deser: org.openuri.www.AccountInfoAnonTypeCodec@bbf788
    ENTRY 4:
    class: org.openuri.www.CustomerInfoAnonType
    xsd_type: ['http://www.openuri.org/']:lcl0:CustomerInfoAnonType
    ser: org.openuri.www.CustomerInfoAnonTypeCodec@7824f9
    deser: org.openuri.www.CustomerInfoAnonTypeCodec@1c35fe1
    ENTRY 5:
    class: org.openuri.www.CreateAccountCheckingRequest
    xsd_type: ['http://www.openuri.org/']:lcl0:CreateAccountCheckingRequest
    ser: org.openuri.www.CreateAccountCheckingRequestCodec@1cbcd7b
    deser: org.openuri.www.CreateAccountCheckingRequestCodec@11f60ce
    ; nested exception is:
    javax.xml.soap.SOAPException: failed to serialize class org.openuri.www
    .CreateAccountCheckingRequestweblogic.xml.schema.binding.SerializationException:
    type mapping lookup failure on class=class controls.CheckingService$anyType Typ
    eMapping=TYPEMAPPING SIZE=5
    ENTRY 1:
    class: org.openuri.www.CreateAccountCheckingResponse
    xsd_type: ['http://www.openuri.org/']:lcl0:CreateAccountCheckingResponse
    ser: org.openuri.www.CreateAccountCheckingResponseCodec@c0f4da
    deser: org.openuri.www.CreateAccountCheckingResponseCodec@b1dd4
    ENTRY 2:
    class: org.openuri.www.FundingInfoAnonType
    xsd_type: ['http://www.openuri.org/']:lcl0:FundingInfoAnonType
    ser: org.openuri.www.FundingInfoAnonTypeCodec@1d36711
    deser: org.openuri.www.FundingInfoAnonTypeCodec@13a59e
    ENTRY 3:
    class: org.openuri.www.AccountInfoAnonType
    xsd_type: ['http://www.openuri.org/']:lcl0:AccountInfoAnonType
    ser: org.openuri.www.AccountInfoAnonTypeCodec@1de5959
    deser: org.openuri.www.AccountInfoAnonTypeCodec@bbf788
    ENTRY 4:
    class: org.openuri.www.CustomerInfoAnonType
    xsd_type: ['http://www.openuri.org/']:lcl0:CustomerInfoAnonType
    ser: org.openuri.www.CustomerInfoAnonTypeCodec@7824f9
    deser: org.openuri.www.CustomerInfoAnonTypeCodec@1c35fe1
    ENTRY 5:
    class: org.openuri.www.CreateAccountCheckingRequest
    xsd_type: ['http://www.openuri.org/']:lcl0:CreateAccountCheckingRequest
    ser: org.openuri.www.CreateAccountCheckingRequestCodec@1cbcd7b
    deser: org.openuri.www.CreateAccountCheckingRequestCodec@11f60ce
    Java Control for the web service:
    package controls;
    import weblogic.webservice.context.WebServiceContext;
    * @jc:location http-url="http://localhost:7001/Checking.jws"
    * @jc:wsdl file="#CheckingWsdl"
    * @jc:handler callback="MessageHandler" operation="MessageHandler"
    public interface CheckingService extends com.bea.control.ControlExtension, com.bea.control.ServiceControl
    public static class CustomerInfo
    implements java.io.Serializable
    public java.lang.String FirstName;
    public java.lang.String LastName;
    public java.lang.String MiddleName;
    public int SSN;
    public int CustomerNumber;
    public java.util.Calendar CreationDate;
    public java.util.Calendar LastModifiedDate;
    public static class FundingInfo
    implements java.io.Serializable
    public float Amount;
    public java.util.Calendar CurrentDate;
    public int AccountNumber;
    public static class anyType
    implements java.io.Serializable
    public com.bea.xml.XmlObject[] t;
    public static class AccountInfo
    implements java.io.Serializable
    public int AccountNumber;
    public float Balance;
    public int CustomerNumber;
    public java.util.Calendar LastModifiedDate;
    public WebServiceContext context = CheckingService.context;
    * @jc:protocol form-post="false" form-get="false"
    public AccountInfo CreateAccountChecking (CustomerInfo CustomerInfo, FundingInfo FundingInfo, anyType CommonHeader);
    static final long serialVersionUID = 1L;
    /** @common:define name="CheckingWsdl" value::
    <?xml version="1.0" encoding="utf-8"?>
    <!-- @editor-info:link autogen="false" source="" -->
    <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:conv="http://www.openuri.org/2002/04/soap/conversation/" xmlns:cw="http://www.openuri.org/2002/04/wsdl/conversation/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:jms="http://www.openuri.org/2002/04/wsdl/jms/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="http://www.openuri.org/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" targetNamespace="http://www.openuri.org/">
    <types>
    <s:schema targetNamespace="http://www.openuri.org/" xmlns:s="http://www.w3.org/2001/XMLSchema">
    <s:element name="CreateAccountCheckingRequest">
    <s:complexType>
    <s:sequence>
    <s:element name="CustomerInfo">
    <s:complexType>
    <s:sequence>
    <s:element name="FirstName" type="s:string" nillable="false"/>
    <s:element name="LastName" type="s:string" nillable="false"/>
    <s:element name="MiddleName" type="s:string" nillable="true"/>
    <s:element name="SSN" type="s:int"/>
    <s:element name="CustomerNumber" type="s:int"/>
    <s:element name="CreationDate" type="s:dateTime"/>
    <s:element name="LastModifiedDate" type="s:dateTime"/>
    </s:sequence>
    </s:complexType>
    </s:element>
    <s:element name="FundingInfo">
    <s:complexType>
    <s:sequence>
    <s:element name="Amount" type="s:float"/>
    <s:element name="CurrentDate" type="s:dateTime"/>
    <s:element name="AccountNumber" type="s:int"/>
    </s:sequence>
    </s:complexType>
    </s:element>
    <s:element name="CommonHeader" type="s:anyType"/>
    </s:sequence>
    </s:complexType>
    </s:element>
    <s:element name="CreateAccountCheckingResponse">
    <s:complexType>
    <s:sequence>
    <s:element name="AccountInfo">
    <s:complexType>
    <s:sequence>
    <s:element name="AccountNumber" type="s:int"/>
         <s:element name="Balance" type="s:float"/>
         <s:element name="CustomerNumber" type="s:int"/>
         <s:element name="LastModifiedDate" type="s:dateTime"/>
    </s:sequence>
    </s:complexType>
    </s:element>
    </s:sequence>
    </s:complexType>
    </s:element>
    <s:element name="string" nillable="true" type="s:string"/>
    </s:schema>
    </types>
    <message name="CreateAccountCheckingSoapIn">
    <part name="parameters" element="s0:CreateAccountCheckingRequest"/>
    </message>
    <message name="CreateAccountCheckingSoapOut">
    <part name="parameters" element="s0:CreateAccountCheckingResponse"/>
    </message>
    <portType name="CheckingSoap">
    <operation name="CreateAccountChecking">
    <input message="s0:CreateAccountCheckingSoapIn"/>
    <output message="s0:CreateAccountCheckingSoapOut"/>
    </operation>
    </portType>
    <binding name="CheckingSoap" type="s0:CheckingSoap">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
    <operation name="CreateAccountChecking">
    <soap:operation soapAction="http://www.openuri.org/CreateAccountChecking" style="document"/>
    <input>
    <soap:body use="literal"/>
    </input>
    <output>
    <soap:body use="literal"/>
    </output>
    </operation>
    </binding>
    <service name="Checking">
    <port name="CheckingSoap" binding="s0:CheckingSoap">
    <soap:address location="http://localhost:7001/Checking.jws"/>
    </port>
    </service>
    </definitions>
    FOLLOWING IS THE PROXY CLASS THAT IS UNSUCCESSFUL
    import controls.CheckingService.anyType;
    import java.util.ArrayList;
    import java.util.List;
    import javax.xml.namespace.QName;
    import javax.xml.rpc.handler.HandlerInfo;
    import javax.xml.rpc.handler.HandlerRegistry;
    import org.openuri.CreateAccountCheckingResponseDocument.CreateAccountCheckingResponse;
    import org.openuri.www.CustomerInfoAnonType;
    import org.openuri.www.FundingInfoAnonType;
    import weblogic.jws.proxies.*;
    import weblogic.webservice.context.WebServiceContext;
    import weblogic.webservice.context.WebServiceSession;
    import weblogic.webservice.core.handler.WSSEClientHandler;
    import weblogic.webservice.tools.pagegen.result;
    import weblogic.xml.security.UserInfo;
    import weblogic.xml.security.wsse.Security;
    import weblogic.xml.security.wsse.SecurityElementFactory;
    //import weblogic.jws.proxies.WebServiceB;
    //import weblogic.jws.proxies.WebServiceB_Impl;
    //import weblogic.jws.proxies.WebServiceBSoap;
    public class CheckingWSProxy
    public static void CallWS(Controller.CreateAccountCheckingForm form)
    String user;
    String pass;
    try{
    * Instantiate the main proxy class. The proxy class has the same name as the
    * web service, with "_Impl" appended.
    Checking myservice = new Checking_Impl("http://localhost:7001/ConsumerAccountApp/schemas/CheckingService.wsdl");
    WebServiceContext context = myservice.context();
    WebServiceSession session = context.getSession();
    * Registers a handler for the SOAP message traffic.
    HandlerRegistry registry = myservice.getHandlerRegistry();
    List list = new ArrayList();
    list.add(new HandlerInfo(WSSEClientHandler.class, null, null));
    registry.setHandlerChain(new QName("Checking"), list);
    * Set the username and password token for SOAP message sent from the client, through
    * the proxy, to the web service.
    user = form.getUsername();
    pass = form.getPassword();
    UserInfo ui = new UserInfo(user, pass);
    session.setAttribute(WSSEClientHandler.REQUEST_USERINFO, ui);
    * Adds the username / password token to the SOAP header.
    SecurityElementFactory factory = SecurityElementFactory.getDefaultFactory();
    Security security = factory.createSecurity(null);
    security.addToken(ui);
    session.setAttribute(WSSEClientHandler.REQUEST_SECURITY, security);
    * Get the protocol-specific proxy class.
    CheckingSoap msg=myservice.getCheckingSoap();
    * Invoke the web service method
    msg.createAccountChecking((CustomerInfoAnonType)form.getProxyCustomerInfo(), (FundingInfoAnonType)form.getProxyFundingInfo(), (Object)form.get_CommonHeader());
    catch (Exception ex)
    System.out.println("Caught Exception Calling the Web Service from the Proxy. The Exception is the following: " + ex.toString());
    FOLLOWING IS THE FORMBEAN IN THE CONTROLLER.JPF FILE
    * FormData get and set methods may be overwritten by the Form Bean editor.
    public static class CreateAccountCheckingForm extends FormData
    private anyType _CommonHeader;
    private controls.CheckingService.FundingInfo _FundingInfo;
    private controls.CheckingService.CustomerInfo _CustomerInfo;
    private java.util.Date dOut;
    private java.util.Calendar cOut;
    private CustomerInfo proxyCustomerInfo;
    private FundingInfo proxyFundingInfo;
    private String stringDate;
    private String currentDate;
    private String lastModifiedDate;
    private String creationDate;
    private String systemMessage;
    private String username;
    private String password;
    private String accountType;
    private String trashTransferAccount;
    private String trashAccountNumber;
    private boolean secureFlag;
    public void set_CustomerInfo(controls.CheckingService.CustomerInfo _CustomerInfo)
    _CustomerInfo.CreationDate = parseDate(getCreationDate());
    _CustomerInfo.LastModifiedDate = parseDate(getLastModifiedDate());
    this._CustomerInfo = _CustomerInfo;
    public controls.CheckingService.CustomerInfo get_CustomerInfo()
    if(this._CustomerInfo == null)
    this._CustomerInfo = new controls.CheckingService.CustomerInfo();
    _CustomerInfo.CreationDate = dateNow();
    _CustomerInfo.LastModifiedDate = dateNow();              
    return this._CustomerInfo;
    public CustomerInfo getProxyCustomerInfo()
    this.proxyCustomerInfo = (CustomerInfo)this._CustomerInfo;
    return this.proxyCustomerInfo;
    public void set_FundingInfo(controls.CheckingService.FundingInfo _FundingInfo)
    _FundingInfo.CurrentDate = parseDate(getCurrentDate());
    this._FundingInfo = _FundingInfo;
    public controls.CheckingService.FundingInfo get_FundingInfo()
    if(this._FundingInfo == null)
    this._FundingInfo = new controls.CheckingService.FundingInfo();
    _FundingInfo.CurrentDate = dateNow();
    return this._FundingInfo;
    public FundingInfo getProxyFundingInfo()
    this.proxyFundingInfo = (FundingInfo)this._FundingInfo;
    return this.proxyFundingInfo;
    public void set_CommonHeader(anyType _CommonHeader)
    this._CommonHeader = _CommonHeader;
    public anyType get_CommonHeader()
    if(this._CommonHeader == null)
    this._CommonHeader = new anyType();
    return this._CommonHeader;
    public java.util.Calendar dateNow()
    this.dOut = new Date();
    Calendar cOut = this.cOut.getInstance();
    cOut.setTime(this.dOut);
    this.cOut = cOut;
    return this.cOut;
    public java.util.Calendar parseDate( String strDate )
    SimpleDateFormat df4 = new SimpleDateFormat( "MM/dd/yyyy" );
    Calendar cOut = this.cOut;
    df4.setLenient( false );
    try
    this.dOut = df4.parse( strDate );
    } catch ( ParseException e )
    cOut.getInstance();
    cOut.setTime(dOut);
    this.cOut = cOut;
    return this.cOut;
    public void setStringDate( String stringDate )
    this.stringDate = stringDate;
    public String getStringDate()
    return this.stringDate;
    public void setCurrentDate( String currentDate )
    this.currentDate = currentDate;
    public String getCurrentDate()
    SimpleDateFormat df4 = new SimpleDateFormat( "MM/dd/yyyy" );
    this.currentDate = df4.format(_FundingInfo.CurrentDate.getTime());
    return this.currentDate;
    public void setLastModifiedDate( String lastModifiedDate )
    this.lastModifiedDate = lastModifiedDate;
    public String getLastModifiedDate()
    SimpleDateFormat df4 = new SimpleDateFormat( "MM/dd/yyyy" );
    this.lastModifiedDate = df4.format(_CustomerInfo.LastModifiedDate.getTime());
    return this.lastModifiedDate;
    public void setCreationDate( String creationDate )
    this.creationDate = creationDate;
    public String getCreationDate()
    SimpleDateFormat df4 = new SimpleDateFormat( "MM/dd/yyyy" );
    this.creationDate = df4.format(_CustomerInfo.CreationDate.getTime());
    return this.creationDate;
    public void setUsername( String username )
    this.username = username;
    public String getUsername()
    return this.username;
    public void setPassword( String password )
    this.password = password;
    public String getPassword()
    return this.password;
    public void setAccountType( String accountType )
    this.accountType = accountType;
    public String getAccountType()
    return this.accountType;
    public void setTrashTransferAccount( String trashTransferAccount )
    this.trashTransferAccount = trashTransferAccount;
    public String getTrashTransferAccount()
    return this.trashTransferAccount;
    public void setTrashAccountNumber( String trashAccountNumber )
    this.trashAccountNumber = trashAccountNumber;
    public String getTrashAccountNumber()
    return this.trashAccountNumber;
    public void setSystemMessage( String systemMessage )
    this.systemMessage = systemMessage;
    public String getSystemMessage()
    return this.systemMessage;
    public void setSecureFlag( boolean secureFlag )
    this.secureFlag = secureFlag;
    public boolean getSecureFlag()
    return this.secureFlag;
    }

    This exception means that xml namespaces are different.
    Etc. soap has xml element which doesn't belong to namespace of parent xml element and namespace is set without prefix.
    I had such problem.
    Try to set namespace prefix for this element.
    Example:
    <el1>
    <el2 xmlns="http://..."/>
    </el1>
    Should be
    <el1>
    <q:el2 xmlns:q="http://..."/>
    </el1>

  • Crazy Exception blocked my RMI server

    Hi all one crazy exception is thrown when I try to start the server. Plz reply me the the possible cause and solution.
    thanks in advance
    The exception is :
    Error starting service
    java.rmi.server.ExportException: Listen failed on port: 0; nested exception is:
    java.net.SocketException: JVM_Bind (code=10055)

    You cant listen / bind on port 0. Try a different port number greater than 1024. That should work out.

  • Connection to CRX via RMI and getting WeakReference value..... with an exception!

    Hi there,
    I have the following problem.
    I opened a ticket in Day Care Support system, about CRX users/group membership that got lost while synchronization with our LDAP server.
    Although when the user and the group had been created (and therefore taken from that same LDAP server), the membership was good.... but after some time the membership got lost......
    So what i am trying to do now is a Java program that connects to CRX via RMI.
    And gets the list of all the users from a group (aka membership).
    The idea is to monitor the membership each seconds.
    But when trying to get the property "rep:members" of the group, I have the following exception :
    javax.jcr.ValueFormatException: Unknown value type 10
              at org.apache.jackrabbit.rmi.server.ServerObject.getRepositoryException(ServerObject.java:13 9)
              at org.apache.jackrabbit.rmi.server.ServerProperty.getValues(ServerProperty.java:71)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
              at java.lang.reflect.Method.invoke(Method.java:611)
              at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322)"
    I searched a little bit and found that "10" is the number for type WeakReference.
    That's normal to me because memberships are stored in the group as a list reference to users linked to that group....
    Anyways, what's not normal to me is that when the type is "10" the API does not let me get the Value (cf. ServerProperty.getValues() method)
    Here is the program:
    import java.util.HashMap;
    import java.util.Iterator;
    import java.util.Map;
    import javax.imageio.spi.ServiceRegistry;
    import javax.jcr.Node;
    import javax.jcr.NodeIterator;
    import javax.jcr.Property;
    import javax.jcr.PropertyIterator;
    import javax.jcr.Repository;
    import javax.jcr.RepositoryException;
    import javax.jcr.RepositoryFactory;
    import javax.jcr.Session;
    import javax.jcr.SimpleCredentials;
    import javax.jcr.Value;
    public class Test {
              public static void main(String[] args) {
                        String uri = "rmi://sma11c02.............:1234/crx";
                        String username = "admin";
                        char[] password = {....................};
                        String workspace = "crx.default";
                        String nodePath = "/home/groups/a";
                        Repository repository = null;
                        Session session = null;
                        try {
                                  // Connection to repository via RMI
                                            Map<String, String> jcrParameters = new HashMap<String, String>();
                                            jcrParameters.put("org.apache.jackrabbit.repository.uri", uri);
                                            Iterator<RepositoryFactory> iterator = ServiceRegistry.lookupProviders(RepositoryFactory.class);
                                            while (null == repository && iterator.hasNext()) {
                                                      repository = iterator.next().getRepository(jcrParameters);
                                  if (repository == null) {
                                            throw new IllegalStateException("Problem with connection to the repository...");
                                  // Creation of a session to the workspace
                                  session = repository.login(new SimpleCredentials(username, password), workspace);
                                  if (session == null) {
                                            throw new IllegalStateException("Problem with creation of session to the workspace...");
                                  // Get the targetted node
                                  Node node = session.getNode(nodePath);
                                  System.out.println("Node : " + node.getName());
                                  System.out.println();
                                  PropertyIterator properties = node.getProperties();
                                  System.out.println("List of properties for this node :");
                                  while (properties.hasNext()) {
                                            Property property = properties.nextProperty();
                                            System.out.print("\t"+property.getName() + " : ");
                                            if (property.isMultiple()) {
                                                      Value[] values = property.getValues();
                                                      for (int i = 0; i < values.length; i++) {
                                                                System.out.print(values[i]);
                                                                if (i+1 != values.length) {
                                                                          System.out.print(", ");
                                                      System.out.println();
                                            } else {
                                                      Value value = property.getValue();
                                                      System.out.println(value);
                                  System.out.println();
                                  NodeIterator kids = node.getNodes();
                                  System.out.println("List of children nodes for this node :");
                                  while (kids.hasNext()) {
                                            Node kid = kids.nextNode();
                                            System.out.println("\tChild node : "+kid.getName());
                                            PropertyIterator kidProperties = kid.getProperties();
                                            System.out.println("List of properties for this child :");
                                            while (kidProperties.hasNext()) {
                                                      Property property = kidProperties.nextProperty();
                                                      System.out.print("\t"+property.getName() + " : ");
                                                      if (property.isMultiple()) {
                                                                Value[] values = property.getValues();
                                                                for (int i = 0; i < values.length; i++) {
                                                                          System.out.print(values[i]);
                                                                          if (i+1 != values.length) {
                                                                                    System.out.print(", ");
                                                                System.out.println();
                                                      } else {
                                                                Value value = property.getValue();
                                                                System.out.println(value);
                                            System.out.println();
                        } catch (RepositoryException e) {
                                  e.printStackTrace();
                        } finally {
                                  if (session != null) {
                                            session.logout();
    Here is the output of the below program:
    Node : a
    List of properties for this node :
              jcr:createdBy : admin
              jcr:mixinTypes : mix:lockable
              jcr:created : 2011-10-25T16:58:48.140+02:00
              jcr:primaryType : rep:AuthorizableFolder
    List of children nodes for this node :
              Child node : administrators
    List of properties for this child :
              jcr:createdBy : admin
              rep:principalName : administrators
              rep:members : javax.jcr.ValueFormatException: Unknown value type 10
              at org.apache.jackrabbit.rmi.server.ServerObject.getRepositoryException(ServerObject.java:13 9)
              at org.apache.jackrabbit.rmi.server.ServerProperty.getValues(ServerProperty.java:71)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
              at java.lang.reflect.Method.invoke(Method.java:611)
              at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322)
              at sun.rmi.transport.Transport$1.run(Transport.java:171)
              at java.security.AccessController.doPrivileged(AccessController.java:284)
              at sun.rmi.transport.Transport.serviceCall(Transport.java:167)
              at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:547)
              at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:802)
              at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:661)
              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:897)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:919)
              at java.lang.Thread.run(Thread.java:736)
              at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
              at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
              at sun.rmi.server.UnicastRef.invoke(Unknown Source)
              at org.apache.jackrabbit.rmi.server.ServerProperty_Stub.getValues(Unknown Source)
              at org.apache.jackrabbit.rmi.client.ClientProperty.getValues(ClientProperty.java:173)
              at Test.main(Test.java:96)
    Here is the list of jar files i'm using with this program:
              2862818581          61388           crx-rmi-2.2.0.jar
              732434195           335603           jackrabbit-jcr-commons-2.4.0.jar
              1107929681           411330           jackrabbit-jcr-rmi-2.4.0.jar
              3096295771           69246           jcr-2.0.jar
              1206850944           367444           log4j-1.2.14.jar
              685167282           25962           slf4j-api-1.6.4.jar
              2025068856           9748           slf4j-log4j12-1.6.4.jar
    Finally, we are using CQ 5.4 (CRX 2.2) with the latest hotfix and under Websphere 7.0
    Best regards,
    Vincent FINET

    Je suis absent(e) du bureau jusqu'au 17/04/2012
    Je suis absent.
    Je répondrai à votre sollicitation à mon retour le 17 avril 2012.
    Cordialement,
    Vincent FINET
    Remarque : ceci est une réponse automatique à votre message  "[CQ5]
    Connection to CRX via RMI and getting WeakReference value..... with an
    exception!" envoyé le 13/4/12 0:32:14.
    C'est la seule notification que vous recevrez pendant l'absence de cette
    personne.
    Le papier est un bien precieux, ne le gaspillez pas. N'imprimez ce document que si vous en avez vraiment besoin !
    Ce message est confidentiel.
    Sous reserve de tout accord conclu par ecrit entre vous et La Banque Postale, son contenu ne represente en aucun cas un engagement de la part de La Banque Postale.
    Toute publication, utilisation ou diffusion, meme partielle, doit etre autorisee prealablement.
    Si vous n'etes pas destinataire de ce message, merci d'en avertir immediatement l'expediteur.

Maybe you are looking for

  • Change color of data in a column

    Hello experts, i am trying to change the color of data being displayed in a column based on the condition that it the value is 0 then it should be in red i have tried the following but it does not work. when-validate-item trigger on data block level

  • Last Init request deletion

    Hi, Is there any way to know which user deleted last init request status from BI ? Thanks dipika

  • How can I dynamically change the Application Date Format?

    Hi everyone... In my application (v 3.2) I let the user set the application date format dynamically through a "preference" value they can change on the go. I then take the format they pick and assign their value (ie: DD-MON-YYYY) and pad 'HH:MI' to i

  • Can't download latest version of HP assistant in chrome

    HP Pavillion g6-2009AX     Product No. B6U15PA#ABG I have uninstalled HP assistant because it wasn't working (saying "an error has occurred") Now when I try to download the latest version, a new tab opens in Google Chrome with the correct address but

  • Reg: Stack intialisation

    Hi, Im new to J2ME. Problem background: I am creating an application to run on NOKIA bluetooth and java enabled phones. This application sends a words through interface provided by J2ME application to computer. Computer would look in for files with g