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

Similar Messages

  • Setting properties using java?

    the varables:
    <%
         String ename;
         String skillname;
         String yearsexp;
    %>setting them when the button is clicked
         function search(main)
              ename = document.main.EmployeeName.options[document.main.EmployeeName.selectedIndex].value
              skillname = document.main.SkillName.options[document.main.SkillName.selectedIndex].value
              yearsexp = document.main.yearsExp.value
         }setting the jstl varables using the varables just set:
         <jsp:useBean id="empskill" class="com.Database.EmployeeSkill" scope="page">
              <jsp:setProperty name="empskill" property="ename" value="<%ename%>"/>
              <jsp:setProperty name="empskill" property="skillName" value="<%skillname%>"/>
              <jsp:setProperty name="empskill" property="yearsexperience" value="<%yearsexp%>"/>
         </jsp:useBean>but this doesnt work??? please help
    Message was edited by:
    h1400046

    what is the point in submitting a form if the jstl can read the value of the input parameters directly?
    how do i set the jstl to read the input parameters?
    therefore all it needs to do is re-fresh the page?
    if not, i have created a new form called 'search within the main form called 'main'
    <form name ="search">.....
                        <td>
                                       <INPUT TYPE=BUTTON VALUE="Search"onClick="search(this.search)">
                                  </td>
                             </tr>
                        </table>
                         <form name ="search">it contains two drop downs and one text box...
    the button submits the form.. what do i need to do with the submitted form to allow me to set the properties??

  • Why do we obtain a java.rmi.MarshalException during a stateless session bean method invocation from a client java program?

    Hello,
    we're using iAS SP3.
    We deployed a stateless session bean that has a business methods with a Vector as argument (put (vector, String)).
    If we call it from a servlet, it works fine. But when we try to call it from a thread, started in a standalone java client program, we obtain a java.rmi.MarshalException.
    We tried to use Vector and HashSet objects as arguments, but we always obtain this kind of exception. It seems strange because a similar
    method that returns a Collection of objects (getAll) works fine. This is the our bean Remote Interface:
    public interface Receive extends EJBObject {
    public void putMessage(Message message, java.lang.String la) throws RemoteException; // it works fine!!!
    public void putMessages(java.util.Vector messages, java.lang.String la) throws RemoteException; // it doesn't work!!!
    Collection getAll (java.lang.String la) throws RemoteException, EJBException; // it works fine!!!!
    This is the java client stack trace:
    java.rmi.MarshalException: CORBA MARSHAL 0 No; nested exception is:
    org.omg.CORBA.MARSHAL: minor code: 0 completed: No
    org.omg.CORBA.MARSHAL: minor code: 0 completed: No
    at java.lang.Class.newInstance0(Native Method)
    at java.lang.Class.newInstance(Class.java:241)
    at com.sun.corba.ee.internal.iiop.ReplyMessage.getSystemException(ReplyMessage.java:93)
    at com.sun.corba.ee.internal.iiop.ClientResponseImpl.getSystemException(ClientResponseImpl.java:82)
    at com.sun.corba.ee.internal.corba.ClientDelegate.invoke(ClientDelegate.java:199)
    at org.omg.CORBA.portable.ObjectImpl._invoke(ObjectImpl.java:248)
    at ejb._Receive_Stub.putMessages(_Receive_Stub.java:731)
    at commlayer.Receiver.run(Receiver.java:67)
    Does anyone know how to solve this problem?
    Thank you in advance,
    Maurizio

    This is big bug!
    This seems to occur when you try to return complex objects (e.g. a vector of classes or even the Date class).
    As a workaround you can add this Ejb or module to the iPlanet Classpath (NT via kregedit, Sun via iasenv skript.).
    This helps but i really don't know why.
    It should be fixed in 6.5, maybe. We'll see.
    Regards

  • UnmarshalException while using prop  java.rmi.server.ignoreStubClasses=true

    I have created a test program to check the behaviour of setting the java.rmi.server.ignoreStubClasses property to true on the server side and not setting this flag on the client side.
    This requirement is due to updation of an already running system, with stubs to a new version without stubs, without shutting down the system.
    The files used by me are given below.
    File Hello.java
    package example.hello;
    import java.rmi.Remote;
    import java.rmi.RemoteException;
    public interface Hello extends Remote {
    String sayHello() throws RemoteException;
    File Server.java
    package example.hello;
    import java.rmi.registry.LocateRegistry;
    import java.rmi.registry.Registry;
    import java.rmi.server.UnicastRemoteObject;
    public class Server implements Hello {
    public Server() {}
    public String sayHello() {
    return "Hello, world!";
    public static void main(String args[]) {
    try {
    LocateRegistry.createRegistry(1099);
    Server obj = new Server();
    Hello stub = (Hello) UnicastRemoteObject.exportObject(obj, 0);
    // Bind the remote object's stub in the registry
    Registry registry = LocateRegistry.getRegistry();
    registry.bind("Hello", stub);
    System.err.println("Server ready");
    catch (Exception e)
    System.err.println("Server exception: " + e.toString());
    e.printStackTrace();
    File Client.java
    package example.hello;
    import java.rmi.registry.LocateRegistry;
    import java.rmi.registry.Registry;
    public class Client {
    private Client() {}
    public static void main(String[] args) {
    String host = (args.length < 1) ? null : args[0];
    try {
    Registry registry = LocateRegistry.getRegistry(host);
    Hello stub = (Hello) registry.lookup("Hello");
    String response = stub.sayHello();
    System.out.println("response: " + response);
    } catch (Exception e) {
    System.err.println("Client exception: " + e.toString());
    e.printStackTrace();
    First I run file Server.java using the following script (server.bat)
    java -Djava.rmi.server.ignoreStubClasses=true -classpath .; example.hello.Server
    pause
    Then the client is run using the following script (client.bat)
    java -classpath .; example.hello.Client 132.186.96.210
    pause
    While running the client, the following exception is obtained.
    Client exception: java.rmi.ServerException: RemoteException occurred in server thread; nested except
    java.rmi.UnmarshalException: error unmarshalling call header; nested exception is:
    java.rmi.UnmarshalException: skeleton class not found but required for client version
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
    java.rmi.UnmarshalException: error unmarshalling call header; nested exception is:
    java.rmi.UnmarshalException: skeleton class not found but required for client version
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:325)
    at sun.rmi.transport.Transport$1.run(Transport.java:153)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
    at java.lang.Thread.run(Thread.java:595)
    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:343)
    at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
    at example.hello.Client.main(Client.java:52)
    Caused by: java.rmi.UnmarshalException: error unmarshalling call header; nested exception is:
    java.rmi.UnmarshalException: skeleton class not found but required for client version
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:250)
    at sun.rmi.transport.Transport$1.run(Transport.java:153)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
    at java.lang.Thread.run(Thread.java:595)
    Caused by: java.rmi.UnmarshalException: skeleton class not found but required for client version
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:243)
    ... 6 more
    I am not able to figure out why this thing is happening, If i also set the property java.rmi.server.ignoreStubClasses=true on the client side everything goes fine. But this I can't do. I can't set the property on the client side as the system is up and already running.
    I am using JDK version 1.5.0_06. Same exception comes under JDK 6.0
    Any help will be highly appreciated.

    I think this is a bug. When you exported the Registry from your server JVM it was also exported with java.rmi.server.ignoreStubClasses=true, but the Registry bootstrap at the client requires the 1.1 stub protocol for compatiblity reasons so you got this error. I would report this on the Bug Parade.
    You could get around it by setting java.rmi.server.ignoreStubClasses after exporting the Registry.
    BTW java.rmi.server.ignoreStubClasses isn't supposed to do anything at the client whether true or false so you can cut your testing space in half.

  • Java.rmi.server.codebase in JSP

    Hi,
    i have a system made from an RMI client and an RMI server. The users access the system through a JSP page, which creates an instance of the RMI client. In order for the system to work, i need to specify the java.rmi.server.codebase property.
    For testing purposes the client has a main(..) method. If i run just the client the server and specify java.rmi.server.codebase, everything works.
    If i don't specify it i get a java.rmi.UnmarshalException, with the nested exception of ClassNotFound. The same exception i get trying to access the jsp page. So, i guess, it's due to the lack of the property.
    I tried setting the property in the jsp page, but it doesn't work.
    Thank you.
    P.S. : maybe this is relevant: my jsp server is tomcat 6.0.

    it refers to where are your stubs and skeletons
    you can set it to point to the jar files or to the directory that contains them
    hope htis helps
    regards
    marco

  • 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.

  • Use wscompile to set properties in generated client.

    It seems to me that there should be an easy way to set properties in generated code.
    My client code generates properly, for instance:
            try {
                stub._initialize(super.internalTypeRegistry);
            } catch (JAXRPCException e) {
                throw e;
            } catch (Exception e) {
                throw new JAXRPCException(e.getMessage(), e);
            }      However, at this point, I am now having to insert the properties for user/pass (basic authentication) by hand.
            try {
                stub._initialize(super.internalTypeRegistry);
                stub._setProperty(javax.xml.rpc.Stub.USERNAME_PROPERTY,"any user");
                stub._setProperty(javax.xml.rpc.Stub.PASSWORD_PROPERTY,"any password");
            } catch (JAXRPCException e) {
                throw e;
            } catch (Exception e) {
                throw new JAXRPCException(e.getMessage(), e);
            }Simple enough.
    Has anyone done this automatically, using wscompile? Manually changing generated code just seems like bad form to me.
    Thanks,
    DaShaun

    Ok, don't do what I tried to do. Very bad form, my apologies. Instead of adding the authentication code to the generated classes, I should have been adding it to my client code.
    Each client then needs to authenticate itself. My approach would have allowed any client to use the code and be authenticated as 'any user'. This is not good.
    DaShaun

  • How to change a setting in the Java Control Panel with command line

    Hi,
    I am trying to figure out how to change a setting in the Java Control Panel with command line or with a script. I want to enable "Use SSL 2.0 compatible ClientHello format"
    I can't seem to find any documentation on how to change settings in the Java Control Panel via the command line
    Edited by: 897133 on Nov 14, 2011 7:15 AM

    OK figured it out. This is for the next person seeking the same solution.
    When you click on the Java Control Panel (found in the Control panel) in any version of Windows, it first looks for a System Wide Java Configuration (found here: C:\Windows\Sun\Java\Deployment). At this point you must be wondering why you don't have this folder (C:\Windows\Sun\Java\Deployment) or why its empty. Well, for an enterprise environment, you have to create it and place something in it - it doesn't exist by default. So you'll need a script (I used Autoit) to create the directory structure and place the the two files into it. The two files are "deployment.properties" and "deployment.config".
    Example: When you click on the Java Control Panel it first checks to see if this directory exists (C:\Windows\Sun\Java\Deployment) and then checks if there is a "deployment.config". If there is one it opens it and reads it. If it doesn't exist, Java creates user settings found here C:\Users\USERNAME\AppData\LocalLow\Sun\Java\Deployment on Windows 7.
    __deployment.config__
    It should look like this inside:
    *#deployment.config*
    *#Mon Nov 14 13:06:38 AST 2011*
    *# The First line below specifies if this config is mandatory which is simple enough*
    *# The second line just tells Java where to the properties of your Java Configuration*
    *# NOTE: These java settings will be applied to each user file and will overwrite existing ones*
    deployment.system.config.mandatory=True
    deployment.system.config=file\:C\:/WINDOWS/Sun/Java/Deployment/deployment.properties
    If you look in C:\Users\USERNAME\AppData\LocalLow\Sun\Java\Deployment on Windows 7 for example you will find "deployment.properties". You can use this as your default example and add your settings to it.
    How?
    Easy. If you want to add *"Use SSL 2.0 compatible ClientHello format"*
    Add this line:
    deployment.security.SSLv2Hello=true
    Maybe you want to disable Java update (which is a big problem for enterprises)
    Add these lines:
    deployment.javaws.autodownload=NEVER
    deployment.javaws.autodownload.locked=
    Below is a basic AutoIt script you could use (It compiles the files into the executable. When you compile the script the two Java files must be in the directory you specify in the FileInstall line, which can be anything you choose. It will also create your directory structure):
    #NoTrayIcon
    #RequireAdmin
    #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
    #AutoIt3Wrapper_UseX64=n
    #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
    Func _JavaConfig()
         $ConfigFile_1 = @TempDir & "\deployment.properties"
         $ConfigFile_2 = @TempDir & "\deployment.config"
         FileInstall ("D:\My Documents\Autoit\Java config\deployment.properties", $ConfigFile_1)
    FileInstall ("D:\My Documents\Autoit\Java config\deployment.config", $ConfigFile_2)
         FileCopy($ConfigFile_1, @WindowsDir & "\Sun\Java\Deployment\", 9)
         FileCopy($ConfigFile_2, @WindowsDir & "\Sun\Java\Deployment\", 9)
         Sleep(10000)
         FileDelete(@TempDir & "\deployment.properties")
         FileDelete(@TempDir & "\deployment.config")
    EndFunc
    _JavaConfig()
    Now if you have SCUP and have setup Self Cert for your organization, you just need to create a SCUP update for JRE.
    Edited by: 897133 on Nov 16, 2011 4:53 AM

  • Mojarra doesn't implement setting properties on declared converters?

    Hi,
    I tried to register a custom converter in faces-config, by means of the following declaration:
    <converter>
              <description>Formats a number with exactly two fractional digits.</description>
              <converter-id>numberformat.two</converter-id>
              <converter-class>javax.faces.convert.NumberConverter</converter-class>
              <property>
                   <property-name>maxFractionDigits</property-name>
                   <property-class>java.lang.Integer</property-class>
                   <default-value>2</default-value>
              </property>
              <property>
                   <property-name>minFractionDigits</property-name>
                   <property-class>java.lang.Integer</property-class>
                   <default-value>2</default-value>
              </property>
         </converter>I've used this kind of code before a long time ago when using MyFaces, and this always Just Worked. However, with Mojarra it just doesn't work.
    I used the converter on my view like this:
    <h:outputText value="#{bb.someVal}">
         <f:converter converterId="numberformat.two"/>
    </h:outputText>By putting a breakpoint in javax.faces.convert.NumberConverter, I can check that the converter is being called, but the properties just aren't set on the instance.
    I hunted the Mojarra source code, but I also can't find any code that is supposed to set these properties.
    For instance, the ApplicationImp.createConverter method consists of this code:
    public Converter createConverter(String converterId) {
            if (converterId == null) {
                String message = MessageUtils.getExceptionMessageString
                    (MessageUtils.NULL_PARAMETERS_ERROR_MESSAGE_ID, "convertedId");
                throw new NullPointerException(message);
            Converter returnVal = (Converter) newThing(converterId, converterIdMap);
            if (returnVal == null) {
                Object[] params = {converterId};
                if (logger.isLoggable(Level.SEVERE)) {
                    logger.log(Level.SEVERE,
                            "jsf.cannot_instantiate_converter_error", converterId);
                throw new FacesException(MessageUtils.getExceptionMessageString(
                    MessageUtils.NAMED_OBJECT_NOT_FOUND_ERROR_MESSAGE_ID, params));
            if (logger.isLoggable(Level.FINE)) {
                logger.fine(MessageFormat.format("created converter of type ''{0}''", converterId));
            return returnVal;
        }So without all the error checking, the method basically boils down to just this:
    return (Converter) newThing(converterId, converterIdMap);The heart of newThing consists of this:
    try {
                result = clazz.newInstance();
            } catch (Throwable t) {
                throw new FacesException((MessageUtils.getExceptionMessageString(
                      MessageUtils.CANT_INSTANTIATE_CLASS_ERROR_MESSAGE_ID,
                      clazz.getName())), t);
            return result;So there's no code that's supposed to set these properties in sight anywhere.
    Also the converter tag (com.sun.faces.taglib.jsf_core.ConverterTag) nor any of its base classes seems to contain such code.
    Either I'm doing something very wrong, or Mojarra has silently removed support for setting properties on custom converters, which would seem awkward.
    Any help would be greatly appreciated.

    rlubke wrote:
    Mojarra has never supported such functionality, so it hasn't been silently removed.Thanks for explaining that. Like I said, the silently removed option thus was the less likely of the two ;)
    The documentation for this converter sub-element states:
    <xsd:element name="property"
    type="javaee:faces-config-propertyType"
    minOccurs="0"
    maxOccurs="unbounded">
    <xsd:annotation>
    <xsd:documentation>
    Nested "property" elements identify JavaBeans
    properties of the Converter implementation class
    that may be configured to affect the operation of
    the Converter.  This attribute is primarily for
    design-time tools and is not specified to have
    any meaning at runtime.
    </xsd:documentation>
    </xsd:annotation>
    </xsd:element>
    That documentation is quite clear indeed. I now notice that the project I was working on still had a JSF 1.1 faces-config DTD, and that documentation said this:
    Element : property
    The "property" element represents a JavaBean property of the Java class represented by our parent element.
    Property names must be unique within the scope of the Java class that is represented by the parent element,
    and must correspond to property names that will be recognized when performing introspection against that
    class via java.beans.Introspector.
    Content Model : (description*, display-name*, icon*, property-name, property-class, default-value?,
    suggested-value?, property-extension*)So there it actually says nothing about the design time aspect.
    I do have to mention that I think this entire difference between design time and run time could maybe have been a bit more officially formalized. Don't get me wrong, I think JSF and the whole of Java EE is a really good spec that has helped me tremendously with my software development efforts, but this particular thing might be open for some improvements. A similar thing also happens in the JPA spec, where some attributes on some annotations are strictly for design time tools and/or code generators, but it's never really obvious which ones that are.
    More on topic though, wouldn't it actually be a good idea if those properties where taken into account at run-time? That way you could configure a set of general converters and make them available using some ID. In a way this wouldn't be really different in how we're configuring managed beans today.

  • JAX-RPC Client - java.rmi.RemoteException:/getPort best practices

    We are working on java webservices(JAX-RPC style) and while consuming Java WebService sometime getting ‘Remote Exception’ .I have generated client side code with weblogic ant task “clientgen”.
    1: Exception
    java.rmi.RemoteException: SOAPFaultException - FaultCode [{http://schemas.xmlsoap.org/soap/envelope/}Server] FaultString [Failed to invoke end component {service implementation class name} (POJO), operation= {webmethode name}
    -> Failed to invoke method
    ] FaultActor [null] Detail [<detail><java:string xmlns:java="java.io">java.lang.NullPointerException
    </java:string></detail>]; nested exception is:
    weblogic.wsee.jaxrpc.soapfault.WLSOAPFaultException: Failed to invoke end component {service implementation class name} (POJO), operation={webmethode name}
    -> Failed to invoke method
    {Package name}.ManagementPortType_Stub.createXXX(xxxPortType_Stub.java:37) // This line is clientgen generated code
    {From this line its clear that clientgen generated code failed to get webservice port}
    2: Following is our implementation to invoke webservice:
    ManagementService service =
    new ManagementService_Impl(“WSDL URL”)
    ManagementPortType port = service.getManagerHTTPPort();
    Port.getServiceName();
    Our code is executing first two lines for every webservice request, and as per our observation these two lines (mark in bold) is taking long time to execute and due to this sometime gives ‘remote exception’ (when there is more request for web service consumption).
    3: My questions:
    1> Why does it take so long on initialization of service and port object?
    2> Is there any problem if I share “port” object for multiple request?
    3> what are the best practices in this type of implementation?
    Help would be greatly appreciated !

    Hi,
    Thanks for your reply.
    My service is deployed and working fine.
    NPE is due to {Package name}.ManagementPortType_Stub is null and code is executing createXXX() methode on it.
    Anyway i cant do anaything here because this is a clientgen generated code.

  • Setting properties

    hi,
    is it possible to set properties on one java class and then acess them from another?
    setting on one
    <jsp:useBean id="employee" class="com.Database.Employee scope="page"/>
                                           <jsp:setProperty name="employee" property="forename" value="Helen"/>
                                           <jsp:setProperty name="employee" property="surname" value="McArthur"/>
                                  </jsp:useBean>setting on another:
         <jsp:useBean id="empskill" class="com.Database.EmployeeSkill" scope="page">
             <jsp:setProperty name="empskill" property="sname" value="Java"/>
         </jsp:useBean>
         so that i may call this?:
    public ArrayList getReport()
            System.out.println("calling getEmployeeSkills(ename, sname, yearsexp");
            ArrayList employeeSkillDetails = new ArrayList();
            try
                JDBCConn conection = new JDBCConn();
                this.con = conection.Connect();
                stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
                StringBuffer sb = new StringBuffer();
                sb.append("SELECT Forename, Surname, SkillName, SkillLevel, YearsExperience  " +
                        "FROM TB_Employee, TB_Skill, TB_EmpSkill " +
                        "WHERE TB_EmpSkill.EmpID = TB_Employee.EmpID  " +
                        "AND TB_EmpSkill.SkillID = TB_Skill.SkillID ");
                if (Employee.forename != null)
                    sb.append("AND forename = '" +Employee.forename+ "' ");   
                if (Employee.surname !=null)
                    sb.append("AND forename = '" +Employee.surname+ "' ");   
                if (this.yearsexperience != null)
                    sb.append("AND YearsExperience = '" +this.yearsexperience+ "' ");
                System.out.println(sb.toString());
                rs = stmt.executeQuery(sb.toString());
                while (rs.next())
                    EmployeeSkill empSkill = new EmployeeSkill();
                    Employee.forename = rs.getString(1);
                    Employee.surname = rs.getString(2);
                    empSkill.skilllevel = rs.getString(4);
                    empSkill.yearsexperience = rs.getString(5);
                    employeeSkillDetails.add(empSkill);
            catch (Exception e)
                e.printStackTrace();
            return employeeSkillDetails;
        }or do all the varables have to be in the same class

    all iget when i do this is:
    org.apache.jasper.JasperException: /main.jsp(34,73) equal symbol expected
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:512)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    org.apache.jasper.JasperException: /main.jsp(34,73) equal symbol expected
         org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
         org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405)
         org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:86)
         org.apache.jasper.compiler.Parser.parseAttribute(Parser.java:193)
         org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:143)
         org.apache.jasper.compiler.Parser.parseUseBean(Parser.java:1014)
         org.apache.jasper.compiler.Parser.parseStandardAction(Parser.java:1240)
         org.apache.jasper.compiler.Parser.parseElements(Parser.java:1576)
         org.apache.jasper.compiler.Parser.parse(Parser.java:126)
         org.apache.jasper.compiler.ParserController.doParse(ParserController.java:211)
         org.apache.jasper.compiler.ParserController.parse(ParserController.java:100)
         org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:155)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:305)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

  • NPE setting properties with CustomEvent

    Hello, I am trying out CustomEvents, but there is something strange setting properties. I try to do a
    public class CustomEvents extends VBean {
       private ID myEvent = ID.registerProperty("MY_EVENT");
       private ID myData = ID.registerProperty("MY_DATA");
       private IHandler handler = null;
       private void log(String message) {
          System.out.println(message);
       public CustomEvents() {
          log("Constructor");
       public final void init(IHandler handler) {  
          this.handler = handler;
          super.init(handler);
          log("Init");
          try {
             CustomEvent customEvent = new CustomEvent(handler, myEvent);
             if ( (myEvent == null) || (myData == null) || (handler == null) || (customEvent == null) ) {
                log("There be nulls");
             handler.setProperty(myData, "hep");
             dispatchCustomEvent(customEvent);
          } catch (Exception e) {
             e.printStackTrace();
          log("done");
    }but end up with an
    Constructor
    Init
    java.lang.NullPointerException
         at oracle.forms.handler.JavaContainer.setProperty(Unknown Source)
         at fi.affecto.webmarela.forms.CustomEvents.init(CustomEvents.java:31)
         at oracle.forms.handler.UICommon.instantiate(UICommon.java:2984)
         at oracle.forms.handler.UICommon.onCreate(UICommon.java:1040)
         at oracle.forms.handler.JavaContainer.onCreate(Unknown Source)
         at oracle.forms.engine.Runform.onCreateHandler(Runform.java:2254)
         at oracle.forms.engine.Runform.processMessage(Runform.java:3347)
         at oracle.forms.engine.Runform.processSet(Runform.java:3491)
         at oracle.forms.engine.Runform.onMessageReal(Runform.java:3099)
         at oracle.forms.engine.Runform.onMessage(Runform.java:2857)
         at oracle.forms.engine.Runform.sendInitialMessage(Runform.java:5635)
         at oracle.forms.engine.Runform.startRunform(Runform.java:1207)
         at oracle.forms.engine.Main.createRunform(Unknown Source)
         at oracle.forms.engine.Main.start(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    done
    */any suggestions? myData is not null but has it failed to hook on to something during initialization? I decompiled JavaContainer and it only has null checks for top-level incoming parameters and the stack trace doesn't give any more detail. Or am I misunderstanding the usage of Custom Events completely?
    Thankful for help,
    -Nik

    Nicklas,
    the problem is that Forms does not have a property
    handler.setProperty(myData, "hep");
    You need to override
    public boolean setProperty(ID ID, Object object)
    in your Java implementation. Then within this method you evaluate if the ID is "myData" and if, do something. If no ID match can be found then you call
    return super.setProperty(_ID, _object);
    Thsi way all custom properties are handled by you and all Forms properties are passed to Forms.
    Frank

  • Oracle9i Intermedia cannot set properties

    hai, i want to ask why Oracle9i in my server cant set properties for mp3 or wav (audio length can be recognized, but the value of mimetype and format is ???). but when i use another Oracle9i in another computer, i can. when i check with System.out.println (Java), the file uploaded with servlet, i use method OrdHttpUploadFile.getMimeType() its work (the output is "audio/mpeg") but when OrdAudio.getMimeType() its output is "???"
    any idea

    no exception at all
    i'm using Java servlet for upload and retrieve media, with JBoss as Application Server,
    this code is for upload:
    oracle.jdbc.driver.OracleCallableStatement insertAudio =
    (oracle.jdbc.driver.OracleCallableStatement)
    conn.prepareCall("BEGIN "+
    "INSERT INTO audiotab VALUES(1,:1,:2,:3,:4,:5,SYSDATE," +
    "ORDSYS.ORDAudio.init(),:6,:7,:8) " +
    "RETURN audioid INTO :9 ; END;");
    ... (fill bind variable)
    insertAudio.executeUpdate();
    oracle.jdbc.driver.OraclePreparedStatement selectAudio=
    (oracle.jdbc.driver.OraclePreparedStatement)
    conn.prepareStatement(
    "SELECT * FROM audiotab WHERE audioid=? FOR UPDATE ");
    ... (fill bind variable)
    oracle.jdbc.driver.OraclePreparedStatement updateAudio=
    (oracle.jdbc.driver.OraclePreparedStatement)
    conn.prepareStatement(
    "UPDATE audiotab SET audiofile=:1 WHERE audioid=:2");
    .... (fill bind variable)
    OracleResultSet rs=(OracleResultSet)selectAudio.executeQuery();
    if(rs.next())
    OrdAudio ord=(OrdAudio)rs.getCustomDatum(8,OrdAudio.getFactory());
    data.loadAudio(ord);
    formData.release();
    updateAudio.setCustomDatum(1,ord);
    updateAudio.setLong(2,audioid);
    updateAudio.executeUpdate();
    conn.commit();
    there is one thing that maybe weird (for me), when i'm using Toad from Quest Software, i look the ORDAudio, THERE IS audio/mpeg as its MIME type, and other properties was right, so what happen with this?? is it because of Java, Oracle, or web server, i'm using tomcat 4 before JBoss 4, and the result was same.
    and there is one thing that disturbing me, why method getCustomDatum() from OracleResultSet was deprecated, although it works but its annoying, is there other method to get the ORDAudio and other ORD.

  • IView Properties in Java

    Hi,
       Is it possible to set iView Personalization properties from Java? I am writing a JSPDynpage to display some content and want to put a button on this page e.g."Remove"
    this should trigger/set the "Remove iView" for that user.
    I am able to read the property but want to know how to set.
    request.getComponentContext().getProfile().getProperty("com.sap.portal.iview.ShowRemove")[
    this is just displaing true or false whether to show this property in personalization or not.
    We disabled personalization option for all users,but need this feature for one iView.
    Thanks
    Tegala

    Hi,
    The issue seems not to be with the Show Remove property -- this only indicates to the portal whether to display this option to the user.
    You seem to be asking how do I actually remove the iView from the page, no?
    If so, you query the PCD for the page you want, get from the page the IiView object of the iView you want to hide, and then change the avilability property.
    Here is some sample code to do this:
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, IPcdContext.PCD_INITIAL_CONTEXT_FACTORY);
    env.put(Constants.REQUESTED_ASPECT, PcmConstants.ASPECT_SEMANTICS);
    env.put(Context.SECURITY_PRINCIPAL, request.getUser());
    env.put(IPcdContext.PCD_PERSONALIZATION_PRINCIPAL, request.getUser());
    InitialContext iCtx = null;
    String pageID = "portal_content/DanielContent/DanRole/Folder1/Folder2/Page1";
    try {
      iCtx = new InitialContext(env);
      IPage myPage = (IPage)iCtx.lookup(pageID);
      Enumeration myIviews = myPage.getiViews();
      while (myIviews.hasMoreElements()) {
         Binding bind = (Binding) myIviews.nextElement();
         IiView myIview  = (IiView) bind.getObject();
         myIview.putAttribute(IAttriView.ATTRIBUTE_AVAILABILITY,IAttriViewValues.AVAILABILITY_VALUE_AVAILABLE);
         myIview.save();     
    I think the casting to a Binding object can be skipped, and you can cast directly to an iView. This is adapted from another code sample where you wanted to distinguish if the object was an iView or a page and then cast it.
    Hope this helps.
    Daniel

  • WAAS-CIFSAO Error replying to client

    I observe these WAAS CIFS errors on wae devices in my network. Can you please throw some light on when these errors occur and their effect.
    Jun 14 11:52:53 waas-hou1.hou.shaw.net 2011 Jun 14 11: java: %WAAS-CIFSAO-3-131207: (965197) Error replying to client 149.77.232.204
    Thanks

    Hi,
    Thanks for sharing the information.
    To be frank, it is tough to narrow down and pin point the problem. The best way to nail down this problem would be to open a TAC case. I suspect few defects mentioned below but not sure if you are really hiting any one of this because we need supporting logs to confirm that.
    1. http://tools.cisco.com/Support/BugToolKit/search/getBugDetails.do?caller=pluginredirector&method=fetchBugDetails&bugId=CSCSz31354
    2. http://tools.cisco.com/Support/BugToolKit/search/getBugDetails.do?caller=pluginredirector&method=fetchBugDetails&bugId=CSCsz78754
    Few options if you want to try that might help you.
    Option 1: 4.1.5f is getting older now. You may want to upgrade to 4.3.1. The big reason behind upgrade suggestion is - there are lot of CIFS related fixes that have gone after 4.1.5f code.
    Option 2: reload WAE. This might help temporarily but issue might come back anytime.
    Option 3: Apply "disk delete-data-partitions" and "reload" on WAE from CLI. This will clear all the cache that is built up and may address the issue temporarilty but again, the issue migth come back anytime.
    Hope this helps.
    PS: Please mark this Answered, if this answers your question.

Maybe you are looking for