Java.io.NotActiveException

package serialization;
import java.io.*;
* DOCUMENT ME!
* @author   $author$
* @version  $Revision$
public class First
     implements Serializable
     //~ Constructors ...........................................................................................................
      * Creates a new First object.
      * @param  x  DOCUMENT ME!
     public First( int x )
          selectedValue = x;
     //~ Methods ................................................................................................................
      * DOCUMENT ME!
      * @param  args  DOCUMENT ME!
     public static void main( String args[] )
          new First( 15 );
          First first = new First( 20 );
          first.Method( first );
     } // end method main
     //~ ........................................................................................................................
      * DOCUMENT ME!
      * @param  object  DOCUMENT ME!
     public void Method( First object )
          try
               notSerializable = new NotSerializable( 50 );
               File file = new File( "serialised.text" );
               FileOutputStream   stream = new FileOutputStream( file );
               ObjectOutputStream o       = new ObjectOutputStream( stream );
               writeObject( o );
          catch( IOException e )
               e.printStackTrace();
          try
               FileReader            fileReader         = new FileReader( "serialised.text" );
               FileInputStream   inputStream         = new FileInputStream( "serialised.text" );
               ObjectInputStream objectInputStream = new ObjectInputStream( inputStream );
               readObject( objectInputStream );
          catch( IOException e )
               e.printStackTrace();
     } // end method Method
     //~ ........................................................................................................................
      * DOCUMENT ME!
      * @param  is  DOCUMENT ME!
     private void readObject( ObjectInputStream is )
          try
               is.defaultReadObject();
               NotSerializable newObject = new NotSerializable( is.readInt());
               First              objects   = (First) is.readObject();
               System.out.println( "retrieved value is : " + objects.selectedValue );
               System.out.println( "retrieved value from the other class is : " + newObject.getValue());
          catch( IOException e )
               e.printStackTrace();
          catch( ClassNotFoundException e )
               // TODO Auto-generated catch block
               e.printStackTrace();
     private void writeObject( ObjectOutputStream o )
          try
               o.defaultWriteObject();
               o.writeInt( notSerializable.getValue());
          catch( IOException e )
     //~ Instance variables .....................................................................................................
      * Field DOCUMENT ME!
     private transient NotSerializable notSerializable = null;
      * Field DOCUMENT ME!
     private int selectedValue = 0;
} // end class First
package serialization;
public class NotSerializable
     public NotSerializable( int x )
          value = x;
     public int getValue()
          return value;
     public void setValue( int value )
          this.value = value;
     private int value;
} // end class NotSerializableWhen I run First.java
The output that I get is :
java.io.NotActiveException: not in call to readObject
     at java.io.ObjectInputStream.defaultReadObject(Unknown Source)
     at serialization.First.readObject(First.java:153)
     at serialization.First.Method(First.java:134)
     at serialization.First.main(First.java:61)
Can someone explain me how to fix the issue

Hi,*
Facing issues with the following program using serialization.
I am trying to use a transient member (Collar c) in class Dog. Have implemented readObject and writeObject to read and write the transient member. The code compliles fine, but when I try to print the member varaible for c ( instance of Collar in Dog), it throws a null pointer exception. So, seems like readObject and writeObject is not doing things correctly.
I also tried to print from within readObject and writeObject. Apprently, those lines are not exceuted at all.
Am I doing anything wrong ? A quick help will be highly appreciated.
*package test;
import java.io.*;
public class Test {
public static void main ( String [] args ){
Dog dOut = new Dog ( new Collar (0), 0);
Collar c = new Collar (10);
Dog d = new Dog (c, 5);
try {
File f = new File ("abc.txt");
FileOutputStream fo = new FileOutputStream (f);
ObjectOutputStream os = new ObjectOutputStream (fo) ;
os.writeObject(d);
os.close();
} catch ( Exception e) { e.printStackTrace(); }
try {
FileInputStream fi = new FileInputStream ("abc.txt");
ObjectInputStream is = new ObjectInputStream (fi);
dOut = (Dog)is.readObject();
is.close();
} catch ( Exception e) { e.printStackTrace(); };
if ( dOut != null)
System.+out+.println (dOut.getCollar().getCollarSize());
class Dog implements Serializable {
private transient Collar c;
private int dogSize;
public Dog ( Collar col, int size) {
c = col;
dogSize = size;
public Collar getCollar () { *return* c ; }
public int getDogSize () { *return* dogSize; }
public void writeObject (ObjectOutputStream os){
System.+out+.println("Object Write");
try{
os.defaultWriteObject();
os.writeInt(c.getCollarSize());
}*catch* ( Exception e) {e.printStackTrace();}
public void readObject (ObjectInputStream is) {
System.+out+.println("Object Read");
try{
is.defaultReadObject();
int i = is.readInt();
c = new Collar (i);
}*catch* ( Exception e) {e.printStackTrace();}
class Collar {
private int collarSize;
Collar ( int i ) { collarSize = i; }
public int getCollarSize () {
return collarSize;

Similar Messages

  • NotActiveException when Using ObjectInputStream

    package serialization;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.NotActiveException;
    import java.io.ObjectInputStream;
    import java.io.ObjectOutputStream;
    import java.io.Serializable;
    public class Ser15OBJSTRTut3 implements Serializable
         int size;
         private Animal objAnimal;
         private int getSize()
              return size;
         private void setSize(int iSize)
              size=iSize;
         private void setAnimalInstance(Animal objAnimal)
              objAnimal=objAnimal;
         private Animal getAnimalInstance()
              return objAnimal;
          * Constructor
          * @param objAnimal
          * @param size
         public Ser15OBJSTRTut3(Animal objAnimal,int size)
              setAnimalInstance(objAnimal);
              setSize(size);
         public static void main(String[] args) {
              Animal objAnimal=new Animal();
              objAnimal.setAnimalSize(20);
                   Ser15OBJSTRTut3 objSer15OBJSTRTut3
                    =new Ser15OBJSTRTut3(objAnimal,40);
              try {
                   ObjectOutputStream objObjectOutputStream=
                          new ObjectOutputStream
                          (new FileOutputStream("C:\\STORE\\data.txt"));
                           objSer15OBJSTRTut3.writeObject
                           (objObjectOutputStream,objSer15OBJSTRTut3);
    //Control passes to  writeObject() below....
                   objObjectOutputStream.close();
              } catch (FileNotFoundException e) {
                   e.printStackTrace();
              } catch (IOException e) {
                   e.printStackTrace();
              // END OF WRITING PROCESS
                    // START READING THE SAME...
              try {
                   ObjectInputStream objectInputStream=
                           new ObjectInputStream
                           (new FileInputStream("C:\\STORE\\data.txt"));
                           Ser15OBJSTRTut3 obj2Ser15OBJSTRTut3=null;
                   objectInputStream.defaultReadObject();
                   System.out.println("DEFAULT="+objectInputStream.readInt());
                   obj2Ser15OBJSTRTut3=      (Ser15OBJSTRTut3)objectInputStream.readObject();
                   // I  NEED THE obj2Ser15OBJSTRTut3 Object back
                   System.out.println(obj2Ser15OBJSTRTut3.size);
                       System.out.println
    (obj2Ser15OBJSTRTut3.getAnimalInstance().getAnimalSize());
                         objectInputStream.close();
              } catch (FileNotFoundException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              } catch (IOException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              } catch (ClassNotFoundException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
         //END OF DESERIALIZATION...
         public void writeObject( ObjectOutputStream objObjectOutputStream,Ser15OBJSTRTut3 objSer15OBJSTRTut3) throws IOException
              try
                   objObjectOutputStream.defaultWriteObject();
                   objObjectOutputStream.writeInt(objSer15OBJSTRTut3.getAnimalInstance().getAnimalSize());
              catch(IOException e)
                   e.printStackTrace();
    class Animal
         int size;
         public int getAnimalSize()
              return size;
         public void setAnimalSize(int iSize)
              size=iSize;
    O/P :
    java.io.NotActiveException: not in call to writeObject
         at java.io.ObjectOutputStream.defaultWriteObject(Unknown Source)
         at serialization.Ser15OBJSTRTut3.writeObject(Ser15OBJSTRTut3.java:86)
         at serialization.Ser15OBJSTRTut3.main(Ser15OBJSTRTut3.java:50)
    java.io.NotActiveException: not in call to readObject
         at java.io.ObjectInputStream.defaultReadObject(Unknown Source)
         at serialization.Ser15OBJSTRTut3.main(Ser15OBJSTRTut3.java:63)

    Read what the Javadoc says about that exception.
    objSer15OBJSTRTut3.writeObject
    (objObjectOutputStream,objSer15OBJSTRTut3); objOutputStream.writeObject(objSer15OBJSTRTut3);
    Ser15OBJSTRTut3 obj2Ser15OBJSTRTut3=null;
                   objectInputStream.defaultReadObject();Ser15OBJSTRTut3 obj2Ser15OBJSTRTut3 = (Ser15OBJSTRTut3)objectInputStream.readObject();
                   System.out.println("DEFAULT="+objectInputStream.readInt());You haven't written an int so this will fail with an EOFException.
                   obj2Ser15OBJSTRTut3= (Ser15OBJSTRTut3)objectInputStream.readObject();You haven't written a second instance of this either so ditto.
                   objObjectOutputStream.defaultWriteObject();OK
                   objObjectOutputStream.writeInt(objSer15OBJSTRTut3.getAnimalInstance().getAnimalSize());That 'int' will disappear inside the readObject() call above. If you want to read that, you have to write a custom readObject() method that reads it. But you don't need to, as the Animal's 'size' is already serialized for you.

  • Problem to calling readObject(java.io.ObjectInputStream) using reflection

    Hi,
    I am facing the following problem
    I have an Employee class its overridden the following below methods
    private void readObject(java.io.ObjectInputStream inStream) {
         inStream.defaultReadObject();
    I am trying to call this method using reflection.
    my code is like this
         Class fis= Class.forName("java.io.FileInputStream");
         Constructor fcons = fis.getConstructor(new Class[]{String.class});
         Object fisObj = fcons.newInstance(new Object[]{"C:\\NewEmployee.ser"});
         Class ois= Class.forName("java.io.ObjectInputStream");     
         Constructor ocons = ois.getDeclaredConstructor(new Class[]{InputStream.class});
         Object oisObj = ocons.newInstance(new Object[] {fisObj});
         Method readObj = aClass.getDeclaredMethod("readObject", new Class[]{ois});
         readObj.setAccessible(true);
         Object mapObj = readObj.invoke(employeeObj,new Object[]{oisObj});
    The above code is call the readObject method, but it is failing while executing inStream.defaultReadObject() statement
    I am getting the following exception
    java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at HackEmployee.reflect(HackEmployee.java:49)
    at HackEmployee.main(HackEmployee.java:131)
    Caused by: java.io.NotActiveException: not in call to readObject
    at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:474)
    at Employee.readObject(Employee.java:77)
    ... 6 more
    can anybody help me?
    ~ murali

    Hi,
    Here is the simple example.
    public class Employee implements Serializable {
    static final long serialVersionUID = 1L;
    static final int _VERSION = 2;
    private int eno;
    private String empName;
         private String paaword;
         private void readObject(java.io.ObjectInputStream inStream)
    throws IOException, ClassNotFoundException {
         int version = 0;
         BufferedInputStream bis = new BufferedInputStream(inStream);
         bis.mark(256);
         DataInputStream dis = new DataInputStream(bis);
         try {
              version = dis.readInt();
              Debug.println(Debug.INFO, _TAG, "Loading version=" + version);
         } catch(Exception e) {
              dis.reset();
         switch(version) {
              case 0:
              case 1:
                   inStream.defaultReadObject();
                   migrateDefaultEmployeeToEncryptionPassword();
                   break;
              case _VERSION:
                   inStream.defaultReadObject();
                   break;
              default:
                   throw new IOException("Unknown Version :" + version);
         private void writeObject(ObjectOutputStream aOutputStream)
    throws IOException {
         aOutputStream.writeInt(_VERSION);
         aOutputStream.defaultWriteObject();
    Now I am writing a tool that need to read data and print all the field and values in a file.
    So I am trying the same with reflecton by calling readObject(ObjectInputStream inStream).
    But here I am facing the problem, it is geving java.lang.reflect.InvocationTargetException while calling migrateDefaultEmployeeToEncryptionPassword(.
    Hope you got my exact scenerio.
    Thanks for your replay
    ~ Murali

  • Hi all, Got a doubt on Serialization..read on..quite interesting

    package package1;
    import java.io.*;
    public class Dog implements java.io.Serializable{
    transient private Collar theCollar; //Not serialiazable
    private int dogSize;
    public Dog(Collar collar,int size){
         theCollar=collar;
         dogSize=size;
    public Collar getCollar(){
         return theCollar;
    private void writeObject(ObjectOutputStream os){
         try{
              if(os!=null){
              os.defaultWriteObject();
              os.writeInt(theCollar.getCollarSize());
              else
                   System.out.println("null!!");
              os.flush();
              os.close();
         }catch(Exception e){
              e.printStackTrace();
    private void readObject(ObjectInputStream is){
         try{
              is.defaultReadObject();
              theCollar=new Collar(is.readInt());
              is.close();
         }catch(Exception e){
              e.printStackTrace();
    public static void main(String[] args){
         Collar c= new Collar(3);
         Dog d = new Dog(c,8);
         try{
         FileOutputStream fo = new FileOutputStream("test2341.ser");
         ObjectOutputStream oo = new ObjectOutputStream(fo);
         System.out.println(d.theCollar.getCollarSize());
         if(oo!=null){
         System.out.println("not null");
         d.writeObject(oo);
         else{
              System.out.println("stream is null!!!");
         oo.flush();
         oo.close();
         }catch(Exception e){
              e.printStackTrace();
    class Collar{
    private int collarSize;
    Collar(int size){
         collarSize=size;
    public int getCollarSize(){
         return collarSize;
    Ok..the following chunk of code compiles fine but during runtime throws a Java.IO.NotActiveException!!!
    Few points on this:
    1.Dog is serializable while collar is not(hence you see the transient spec in Dog class code for Collar reference)
    2.defaultWriteObject() is called inside writeObject() (Nested call requirement satisfied)
    3.ObjectOutputStream is not null(the if block(checks for not null)and executes in almost all methods)
    Then why am i getting NotActiveException ?? Any suggestions?

    the implementing the private read and write method is not wrong.You're two weeks late and you're wrong. Please read more carefully before your answer. Nobody said implementing private readObject() and writeObject() methods was wrong. Of course it isn't. It's defined in the Serialization Specification. How could it be wrong?
    What I said was that calling them yourself is wrong. You are supposed to call ObjectOutputStream.writeObject() and ObjectInputStream.readObject() from the outside. Inside, your writeObject method should call ObjectOutputStream.defaultWriteObject(), and your readObject method should call ObjectInputStream.defaultReadObject().
    using just the read and write is not sufficient to handle transient information that needs to be serializedOf course. But 'transient information that needs to be serialized' is really a contradiction in terms. If you're doing this you have a much bigger problem than just which methods to call when.

  • Compress and defaultWriteObject

    Hello,
    I want to compress the data wich is generated with the defaultWriteObject.
    Normal serialize:
    private void writeObject(ObjectOutputStream aOOS) throws IOException
    aOOS.defaultWriteObject();
    I don't want to wright my one serialize code.
    I only want to compres(zip) the code the defaultwriteObject produced.
    I tried :
    private void writeObject(ObjectOutputStream aOOS) throws IOException
    GZIPOutputStream gzipout = new GZIPOutputStream(aOOS);
    ObjectOutputStream oos = new ObjectOutputStream(gzipout);
    oos.defaultWriteObject();
    But know i get the exception
    java.io.NotActiveException: not in call to writeObject
    Does anyone know a sollution
    Thanks in advance

    When using the above solution in combination with Jboss.
    The solutions works fine when the object go from the server to the client.
    The other way oraund from client to server i got the following message :
    2003-03-11 10:20:52,561 ERROR [STDERR] java.lang.ClassCastException
    2003-03-11 10:20:54,462 ERROR [STDERR]      at java.io.ObjectInputStream.readTypeString(ObjectInputStream.java:1340)
    2003-03-11 10:20:54,493 ERROR [STDERR]      at java.io.ObjectStreamClass.readNonProxy(ObjectStreamClass.java:536)
    2003-03-11 10:20:54,509 ERROR [STDERR]      at java.io.ObjectInputStream.readClassDescriptor(ObjectInputStream.java:762)
    2003-03-11 10:20:54,524 ERROR [STDERR]      at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1503)
    2003-03-11 10:20:54,524 ERROR [STDERR]      at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
    2003-03-11 10:20:54,540 ERROR [STDERR]      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1626)
    2003-03-11 10:20:54,555 ERROR [STDERR]      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
    2003-03-11 10:20:54,555 ERROR [STDERR]      at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
    2003-03-11 10:20:54,586 ERROR [STDERR]      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
    2003-03-11 10:20:54,586 ERROR [STDERR]      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
    2003-03-11 10:20:54,602 ERROR [STDERR]      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
    2003-03-11 10:20:54,602 ERROR [STDERR]      at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1603)
    2003-03-11 10:20:54,618 ERROR [STDERR]      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1271)
    2003-03-11 10:20:54,633 ERROR [STDERR]      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
    2003-03-11 10:20:54,633 ERROR [STDERR]      at org.jboss.invocation.MarshalledValue.get(MarshalledValue.java:78)
    2003-03-11 10:20:54,649 ERROR [STDERR]      at org.jboss.invocation.MarshalledInvocation.getArguments(MarshalledInvocation.java:320)
    2003-03-11 10:20:54,664 ERROR [STDERR]      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:660)
    2003-03-11 10:20:54,664 ERROR [STDERR]      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
    2003-03-11 10:20:54,680 ERROR [STDERR]      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:77)
    2003-03-11 10:20:54,696 ERROR [STDERR]      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:107)
    2003-03-11 10:20:54,696 ERROR [STDERR]      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:178)
    2003-03-11 10:20:54,711 ERROR [STDERR]      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:60)
    2003-03-11 10:20:54,742 ERROR [STDERR]      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130)
    2003-03-11 10:20:54,742 ERROR [STDERR]      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:204)
    2003-03-11 10:20:54,742 ERROR [STDERR]      at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:313)
    2003-03-11 10:20:54,758 ERROR [STDERR]      at org.jboss.ejb.Container.invoke(Container.java:712)
    2003-03-11 10:20:54,758 ERROR [STDERR]      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
    2003-03-11 10:20:54,773 ERROR [STDERR]      at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:382)
    2003-03-11 10:20:54,789 ERROR [STDERR]      at sun.reflect.GeneratedMethodAccessor47.invoke(Unknown Source)
    2003-03-11 10:20:54,789 ERROR [STDERR]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    2003-03-11 10:20:54,805 ERROR [STDERR]      at java.lang.reflect.Method.invoke(Method.java:324)
    2003-03-11 10:20:54,820 ERROR [STDERR]      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
    2003-03-11 10:20:54,836 ERROR [STDERR]      at sun.rmi.transport.Transport$1.run(Transport.java:148)
    2003-03-11 10:20:54,851 ERROR [STDERR]      at java.security.AccessController.doPrivileged(Native Method)
    2003-03-11 10:20:54,851 ERROR [STDERR]      at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
    2003-03-11 10:20:54,867 ERROR [STDERR]      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
    2003-03-11 10:20:54,898 ERROR [STDERR]      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
    2003-03-11 10:20:54,898 ERROR [STDERR]      at java.lang.Thread.run(Thread.java:536)
    2003-03-11 10:21:01,863 ERROR [org.jboss.ejb.plugins.LogInterceptor] RuntimeException:
    java.lang.IllegalArgumentException: wrong number of arguments
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:660)
         at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
         at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:77)
         at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:107)
         at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:178)
         at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:60)
         at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130)
         at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:204)
         at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:313)
         at org.jboss.ejb.Container.invoke(Container.java:712)
         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
         at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:382)
         at sun.reflect.GeneratedMethodAccessor47.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
         at sun.rmi.transport.Transport$1.run(Transport.java:148)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
         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:536)
    Can someone help me.

  • Questions on ObjectOutputStream.PutField

    Hi there all,
    I am trying to implement the following codes but got java.io.NotActiveException: not in call to writeObject error, what i did wrong? Below are the codes snippet:
    private static final ObjectStreamField[] putField = {
                   new ObjectStreamField("emailAddress", String.class),
                   new ObjectStreamField("paymentGateway", String.class),
                   new ObjectStreamField("denomination", String.class),
                   new ObjectStreamField("topUpMobileNumber", String.class) };
         @Override
         public void init() throws ServletException {
              super.init();
              // Testing by shooting PrepaidTopUpServlet
              log.info("Hello World StatusResponse");
              try {
                   URL url = new URL("http://localhost:8080/Web/MyEchoServlet");
                   URLConnection urlConnection = (HttpURLConnection) url
                             .openConnection();
                   urlConnection.setRequestProperty("Content-Type",
                             Constants.SERVLET_CONTENT_TYPE_URL_ENCODED);
                   urlConnection.setDoInput(true);
                   urlConnection.setDoOutput(true);
                   urlConnection.setUseCaches(false);
                   ObjectOutputStream objectOutputStream = new ObjectOutputStream(
                             urlConnection.getOutputStream());
                   ObjectOutputStream.PutField putField = objectOutputStream
                             .putFields();
                   putField.put("emailAddress", "[email protected]");
                   putField.put("paymentGateway", "01");
                   putField.put("denomination", "401");
                   putField.put("topUpMobileNumber", "0123456789");
                   objectOutputStream.writeFields();
                   objectOutputStream.flush();
                   objectOutputStream.close();
                   ObjectInputStream objectInputStream = new ObjectInputStream(
                             urlConnection.getInputStream());
                   Object object = objectInputStream.readObject();
                   log.debug(object);
                   objectInputStream.close();
                   objectOutputStream = null;
                   objectInputStream = null;
                   urlConnection = null;
                   url = null;
              } catch (MalformedURLException e) {
                   log.error(e);
              } catch (IOException e) {
                   log.error(e);
              } catch (ClassNotFoundException e) {
                   log.error(e);
    ...Note: Currently running J2SE 1.5 and JBoss 4.2 AS.
    Thanks

    I am trying to implement the following codes butgot java.io.NotActiveException: not in call to
    writeObject error, what i did wrong?
    What you did wrong is exactly what it says in the
    Javadoc for writeFields() about this exception being
    thrown.
    Basically you should have called writeObject()
    instead of writeFields(). I haven't called
    writeFields() in over ten years of Java.The error occurs during the line of:
    ObjectOutputStream.PutField putField = objectOutputStream.putFields();Thanks but according to this http://java.sun.com/j2se/1.4.2/docs/api/java/io/ObjectOutputStream.PutField.html#ObjectOutputStream.PutField() it stated like the following:
    write
    public abstract void write(ObjectOutput out)
                        throws IOException
    Deprecated. This method does not write the values contained by this PutField object in a proper format, and may result in corruption of the serialization stream. The correct way to write PutField data is by calling the ObjectOutputStream.writeFields() method.
    Write the data and fields to the specified ObjectOutput stream.
    Parameters:
    out - the stream to write the data and fields to
    Throws:
    IOException - if I/O errors occur while writing to the underlying streamSo i guess its misleading information. Anyway, I will try what you had suggested, thank you.
    Message was edited by: gigsvoo
    NeoGigs

  • NotActiveException received in Serialization attempt

    I have a Serializable Class, posted below with some edits for brevity. I've set up my writeObject() and readObject() methods according to the documentation, but I'm still receiving the NotActiveException when the methods are executed. Can someone take a look at this and tell me their opinion? readObject() and writeObject() are down at the bottom.
    My java version:
    C:\>java -version
    java version "1.3.0"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
    Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
    **********************BEGIN**********************************
    public class DtkAuthorization implements Serializable {
    private int level = 0;
    private transient char key = (char)100;
    public final static int HELPDESK = 1;
    public final static int BASELINE = 2;
    public final static int ADMIN = 3;
    private String encLevel = null;
    private transient File levelFile = null;
    private static transient DtkAuthorization _instance = null;
    // Some other static final variables are here
    private DtkAuthorization() {
    initialize();
    private DtkAuthorization(File file, int level) {
    this.levelFile = file;
    setLevel(level);
    * Return the instance of DtkAuthorization. If _instance does not exist yet,
    * create it and return the Object reference.
    public static DtkAuthorization getInstance() {
    if ((_instance == null) || !(_instance instanceof DtkAuthorization)) {
    _instance = new DtkAuthorization();
    return _instance;
    * Provide a way to get a separate instance of this class for admin
    * purposes. This method returns a separate instance of this class
    public static DtkAuthorization getNewInstance(File file, int newLevel) {
    return new DtkAuthorization(file, newLevel);
    * Return <code>level</code>
    public int getLevel() {
    return level;
    * Set <code>level</code> to <code>newLevel</code>. This has the side effect
    * of updating the encrypted authorization String.
    public void setLevel(int newLevel) {
    level = newLevel;
    encLevel = xorEncrypt(level, key);
    public void saveObject() {
    try {
    System.out.println("File is " + levelFile);
    ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(levelFile));
    writeObject(oos);
    } catch (IOException e) {
    String msg = new String("Error writing file:\n" +
    levelFile.toString() + "\n" +
    "Error: " + e.toString() + "\n");
    DtkMessages.displayMessage(null, msg);
    private void initialize() {
    // Doing some initialization stuff
    private String xorEncrypt(int level, char key) {
    // Doing some basic encryption stuff--not fancy, not expected
    // to withstand decryption attempts
    private int xorDecrypt(String s, char key) {
    // Doing some basic decryption stuff--not fancy, not expected
    // to withstand decryption attempts
    private void setDefaults() {
    setLevel(1);
    //Serialization methods
    private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException {
    ois.defaultReadObject();
    private void writeObject(ObjectOutputStream oos) throws IOException {
    oos.defaultWriteObject();
    **********************END*************************************

    Here's the two places the read/write are initiated. These are from two separate classes.
    Here's the call that initiates the readObject() method:
    public int getAuthorization() {
    int level = DtkAuthorization.getInstance().getLevel();
    return level;
    Here's the call to the saveObject method:
    void saveAction() {
    DtkJFileChooser djc = new DtkJFileChooser("Choose file:");
    int button = djc.showSaveDialog(this);
    if (button == DtkJFileChooser.APPROVE_OPTION) {
    File file = djc.getSelectedFile();
    System.out.println("dialog file is " + file);
    DtkAuthorization da = DtkAuthorization.getNewInstance(file, authLevelJComboBox.getSelectedIndex());
    da.saveObject();

  • Error while running a Java Program

    Can anyone help me,
    I am getting the following error while running a Java program, Below is the exception thrown, please help.
    java.nio.BufferOverflowException
    at java.nio.Buffer.nextPutIndex(Buffer.java:425)
    at java.nio.DirectByteBuffer.putChar(DirectByteBuffer.java:463)
    at org.jetel.data.StringDataField.serialize(StringDataField.java:295)
    at org.jetel.data.DataRecord.serialize(DataRecord.java:283)
    at org.jetel.graph.DirectEdge.writeRecord(DirectEdge.java:216)
    at org.jetel.graph.Edge.writeRecord(Edge.java:288)
    at com.tcs.re.component.RESummer1.run(RESummer1.java:505)
    java.nio.BufferOverflowException
    at java.nio.Buffer.nextPutIndex(Buffer.java:425)
    at java.nio.DirectByteBuffer.putChar(DirectByteBuffer.java:463)
    at org.jetel.data.StringDataField.serialize(StringDataField.java:295)
    at org.jetel.data.DataRecord.serialize(DataRecord.java:283)
    at org.jetel.graph.DirectEdge.writeRecord(DirectEdge.java:216)
    at org.jetel.graph.Edge.writeRecord(Edge.java:288)
    at com.tcs.re.component.RECollectCont.run(RECollectCont.java:304)

    Ok, let's see. Write the following class:
    public class Grunt {
      public static void main(String[] args) {
        System.out.println("Hello Mars");
    }Save it as "C:\Grunt.java", compile by typing:
    javac c:\Grunt.javaRun by typing:
    java -classpath "C:\" GruntDoes it say "Hello Mars"? If yes, go back to your program and compare for differences (maybe you used the "package" statement?).
    Regards

  • Erro de SYSFAIL e Queda do Ambiente JAVA (PI)

    Bom Dia
    Estou num projeto de NFe e atualmente esta acontecendo o seguinte cenário de Erros:
        Na SMQ2 , quando apresenta um aumento nas filas de Mensagens , aparece SYSFAIL em determinadas Filas , todas as outras travam , aumenta o numero de Filas.
       Com essa mensagem de SYSFAIL nas filas , o serve0 (Parte JAVA do PI) cai e após isso estou tendo que efetuar manualmente um STOP/START em todos os canais de comunnicação para que os R/3 voltem a emitir NFe.
        Isso esta ocorrendo com mais frequência após inserir uma nova empresa para emissão de NFe.
        Alguem poderia me ajudar a entender por que ocorre o SYSFAIL as mensagens travam e derruba o ambiente JAVA ?
    Sérgio.

    1º) Erro: Commit Fault: com.sap.aii.af.rfc.afcommunication.RfcAFWException:SenderA
    2º) Foi alterado o numero de Filas O numero de Filas foi alterado , mas não consigo ver esse parametros na RZ10 , tem  3 entradas : X32_DVEBMGS32_NFISAP ; DEFAULT ; START_DVEBMGS32_NFISAP nessa transação ...onde eu vejo isso
    3º) Esse parametro não tem nessa transação (/usr/sap//DVEBMGS00/j2ee/cluster/server0/log/). em qual desses diretórios abaixo eu encontro esse parametro ?
    Existe esses:
    DIR_ATRA      /usr/sap/X32/DVEBMGS32/data
    DIR_BINARY      /usr/sap/X32/DVEBMGS32/exe
    DIR_CCMS      /usr/sap/ccms
    DIR_CT_LOGGIN    /usr/sap/X32/SYS/global
    DIR_CT_RUN              /usr/sap/X32/SYS/exe/run
    DIR_DATA              /usr/sap/X32/DVEBMGS32/data
    DIR_DBMS              /usr/sap/X32/SYS/SAPDB
    DIR_EXECUTABLE /usr/sap/X32/DVEBMGS32/exe
    DIR_EXE_ROOT     /usr/sap/X32/SYS/exe
    DIR_GEN              /usr/sap/X32/SYS/gen/dbg
    DIR_GEN_ROOT    /usr/sap/X32/SYS/gen
    DIR_GLOBAL        /usr/sap/X32/SYS/global
    DIR_GRAPH_EXE  /usr/sap/X32/DVEBMGS32/exe
    DIR_GRAPH_LIB   /usr/sap/X32/DVEBMGS32/exe
    DIR_HOME             /usr/sap/X32/DVEBMGS32/work
    DIR_INSTALL        /usr/sap/X32/SYS
    DIR_INSTANCE     /usr/sap/X32/DVEBMGS32
    DIR_LIBRARY      /usr/sap/X32/DVEBMGS32/exe
    DIR_LOGGING     /usr/sap/X32/DVEBMGS32/log
    DIR_MEMORY_INSPECTOR   /usr/sap/X32/DVEBMGS32/data
    DIR_ORAHOME       /oracle/X32/102_64
    DIR_PAGING                            /usr/sap/X32/DVEBMGS32/data
    DIR_PUT                            /usr/sap/X32/put
    DIR_PERF                            /usr/sap/tmp
    DIR_PROFILE      /usr/sap/X32/SYS/profile
    DIR_PROTOKOLLS     /usr/sap/X32/DVEBMGS32/log
    DIR_REORG                          /usr/sap/X32/DVEBMGS32/data
    DIR_ROLL                          /usr/sap/X32/DVEBMGS32/data
    DIR_RSYN                            /usr/sap/X32/DVEBMGS32/exe
    DIR_SAPHOSTAGENT     /usr/sap/hostctrl
    DIR_SAPUSERS     ./
    DIR_SETUPS                           /usr/sap/X32/SYS/profile
    DIR_SORTTMP     /usr/sap/X32/DVEBMGS32/data
    DIR_SOURCE     /usr/sap/X32/SYS/src
    DIR_TEMP                           /tmp
    DIR_TRANS                           /usr/sap/trans
    DIR_TRFILES                          /usr/sap/trans
    DIR_TRSUB                          /usr/sap/trans

  • Starting deployment prerequisites: error in BI-Java installation sapinst

    Hi all,
    We are in process updating Bw 3.5 to BI 7.0 we hace sucessfully completed the Upgrade but while installing Bi java thru Sapinst in third step like java instance installtion  i was stck with the below error.
               We have downloaded the Cryptographic file and placed in jdk folder still the same problem is  coming.
    Please suggest...
    Thanks,
    Subhash.G
    Starting deployment prerequisites:
    Oct 13, 2007 2:42:18 AM  Error: Creation of DataSource for database "BWQ" failed.
    Original error message is:
    com.sap.sql.log.OpenSQLException: Error while accessing secure store: Encryption or decryption is not possible because the full version of the SAP Java Crypto Toolkit was not found (iaik_jce.jar is required, iaik_jce_export.jar is not sufficient) or the JCE Jurisdiction Policy Files don't allow the use of the "PbeWithSHAAnd3_KeyTripleDES_CBC" algorithm..
    Stack trace of original Exception or Error is:
    com.sap.sql.log.OpenSQLException: Error while accessing secure store: Encryption or decryption is not possible because the full version of the SAP Java Crypto Toolkit was not found (iaik_jce.jar is required, iaik_jce_export.jar is not sufficient) or the JCE Jurisdiction Policy Files don't allow the use of the "PbeWithSHAAnd3_KeyTripleDES_CBC" algorithm..

    Problem solved  followed the notes 1063396.

  • If Statement in java.awt paint

    import java.applet.Applet;  //bring in the applet class
    import java.awt.*;             //bring in the graphics class
    import java.awt.event.*;      //bring in the event class
    import java.text.DecimalFormat;    //bring in the decimal format class
    import java.lang.Float;       //bring in the float class
    public class Bmi extends Applet implements ActionListener {   //begin program and start ActionListener
      Label weight, height;    //define Label variable
      TextField weighttext, heighttext;    //define TextField variables
      Button calculate;     //define button variables
      float index, wt, ht, max, min;    //define float variables
      DecimalFormat fmt2 = new DecimalFormat("#.00"); //set decimal format for reals
    public void init() {    //begin init()
      weight = new Label("Please enter your weight in Kg. (2 decimal places): ");   //define content of Label weight
      weighttext = new TextField(6);            //define size of TextField
      height = new Label("Please enter your height in Metres (2 decimal places): ");   //define content of Label height
      heighttext = new TextField(5);    //define size of TextField
      calculate = new Button("Calculate!!");       //define content of Button
      add(weight);      //add Label weight to the GUI
      add(weighttext);   //add TextField weighttext to the GUI
      add(height);      //add Label height to the GUI
      add(heighttext);     //add TextField heighttext to the GUI
      add(calculate);        //add button calculate to the GUI
      calculate.addActionListener(this);    //wait for button to be returned
      wt = 0;     //reset wt to 0
      index = 0;  //reset index to 0
      ht = 0;      //reset ht to 0
      max = 0;      //reset max to 0
      min = 0;    //reset min to 0
      public void actionPerformed( ActionEvent e ) {   //run upon return of button
      wt = Float.parseFloat(weighttext.getText());  //convert weighttext from String to Float
      ht = Float.parseFloat(heighttext.getText());    //covert heighttext from String to Float
      repaint();     //refresh paint area
      public float indexer()  //begin indexer method
        float ind;    //delare local variable ind
        ind = wt/(ht*ht);      //perform calculation
        return ind;    //make indexer() the value of variable ind
      }  // end of indexer method
      public float maxWeight()  //begin maxWeight method
        float maxwt;    //declare local variable maxwt
        final float UPPER = 25.0f;   //declare variable UPPER as a float with a decimal value of 25.0
        maxwt = UPPER*ht*ht;      //perform calculation
        return maxwt;          //make maxWeight() the value of variable maxwt
      }  // end of maxWeight method
      public float minWeight()   //begin minWeight method
        float minwt;    //declare local variable minwt
        final float LOWER= 20.0f;   //declare variable LOWER as a float with a decimal value of 20.0
        minwt = LOWER*ht*ht;    //perform calculation
        return minwt;      //make minWeight() the value of variable minwt
      }  // end of minWeight method
    public void paint(Graphics g)    //begin paint method, define g as Graphics
        index=indexer();   //covert method indexer() to variable index
        max=maxWeight();      //convert method maxWeight() to variable max
        min=minWeight();     //convert method minWeight() to variable min
        g.setFont(new Font("Verdana", Font.ITALIC, 15));    //define font, weight and size
        g.setColor(new Color(90,90,90));     //set new colour
        g.drawRect(5,100,300,75);      //define size of rectangle
        g.setColor(new Color(255,107,9));   //set new colour
        g.drawString("BMI is " + fmt2.format(index) + " for " + fmt2.format(wt) + "kg",20,120);   //create string in paint, define its on screen position
        g.drawString("Maximum bodyweight is " + fmt2.format(max) + "kg", 20,140);   //create string in paint, define its on screen position
        g.drawString("Minimum bodyweight is " + fmt2.format(min) + "kg", 20,160);     //create string in paint, define its on screen position
      }  // end of paint method
    }    // end of Bmi classI have written the above code to calculate someones BMI (Body Mass Index). Basically as you can see it recieves a weight and height from the user and calculates the rest. But whilst that good I would like to know how I can make it tell the user something to the effect of "Your overweight" or "Your underweight". The if statement runs like this:
    if (wt > max)This forum doesn't quite handle <> properly. The greater and less than symbols. So above you will see > this is the html character code for a greater than symbol so please read it as such.
    And then if wt is greater than max then it will say "Your overweight".
    But I can't figure out how to include it in the above program. Becuase it won't run in paint, atleast it won't the way I have done it previously. So can you think of any other ways?
    Help much appreciated,
    Simon

    Thanks very much that works well.
    Simon
    My code now looks like this: import java.applet.Applet;  //bring in the applet class
    import java.awt.*;             //bring in the graphics class
    import java.awt.event.*;      //bring in the event class
    import java.text.DecimalFormat;    //bring in the decimal format class
    import java.lang.Float;       //bring in the float class
    public class Bmi extends Applet implements ActionListener {   //begin program and start ActionListener
      Label weight, height;    //define Label variable
      TextField weighttext, heighttext;    //define TextField variables
      Button calculate;     //define button variables
      float index, wt, ht, max, min;    //define float variables
      DecimalFormat fmt2 = new DecimalFormat("#.00"); //set decimal format for reals
    public void init() {    //begin init()
      weight = new Label("Please enter your weight in Kg. (2 decimal places): ");   //define content of Label weight
      weighttext = new TextField(6);            //define size of TextField
      height = new Label("Please enter your height in Metres (2 decimal places): ");   //define content of Label height
      heighttext = new TextField(5);    //define size of TextField
      calculate = new Button("Calculate!!");       //define content of Button
      add(weight);      //add Label weight to the GUI
      add(weighttext);   //add TextField weighttext to the GUI
      add(height);      //add Label height to the GUI
      add(heighttext);     //add TextField heighttext to the GUI
      add(calculate);        //add button calculate to the GUI
      calculate.addActionListener(this);    //wait for button to be returned
      wt = 0;     //reset wt to 0
      index = 0;  //reset index to 0
      ht = 0;      //reset ht to 0
      max = 0;      //reset max to 0
      min = 0;    //reset min to 0
      public void actionPerformed( ActionEvent e ) {   //run upon return of button
      wt = Float.parseFloat(weighttext.getText());  //convert weighttext from String to Float
      ht = Float.parseFloat(heighttext.getText());    //covert heighttext from String to Float
      repaint();     //refresh paint area
      public float indexer()  //begin indexer method
        float ind;    //delare local variable ind
        ind = wt/(ht*ht);      //perform calculation
        return ind;    //make indexer() the value of variable ind
      }  // end of indexer method
      public float maxWeight()  //begin maxWeight method
        float maxwt;    //declare local variable maxwt
        final float UPPER = 25.0f;   //declare variable UPPER as a float with a decimal value of 25.0
        maxwt = UPPER*ht*ht;      //perform calculation
        return maxwt;          //make maxWeight() the value of variable maxwt
      }  // end of maxWeight method
      public float minWeight()   //begin minWeight method
        float minwt;    //declare local variable minwt
        final float LOWER= 20.0f;   //declare variable LOWER as a float with a decimal value of 20.0
        minwt = LOWER*ht*ht;    //perform calculation
        return minwt;      //make minWeight() the value of variable minwt
      }  // end of minWeight method
    public void you(Graphics g)
      String statement;
      if(wt > max) statement="You are very fat";
      else if(wt < min) statement="You are very thin";
      else statement="You are in the recommended weight range for your height";
      g.drawString(statement, 20,210);
    public void paint(Graphics g)    //begin paint method, define g as Graphics
        you(g);
        index=indexer();   //covert method indexer() to variable index
        max=maxWeight();      //convert method maxWeight() to variable max
        min=minWeight();     //convert method minWeight() to variable min
        g.setFont(new Font("Verdana", Font.ITALIC, 15));    //define font, weight and size
        g.setColor(new Color(90,90,90));     //set new colour
        g.drawRect(5,100,300,75);      //define size of rectangle
        g.setColor(new Color(255,107,9));   //set new colour
        g.drawString("BMI is " + fmt2.format(index) + " for " + fmt2.format(wt) + "kg",20,120);   //create string in paint, define its on screen position
        g.drawString("Maximum bodyweight is " + fmt2.format(max) + "kg", 20,140);   //create string in paint, define its on screen position
        g.drawString("Minimum bodyweight is " + fmt2.format(min) + "kg", 20,160);     //create string in paint, define its on screen position
      }  // end of paint method
    }    // end of BmiThanks again,
    Simon

  • SSO java sample application problem

    Hi all,
    I am trying to run the SSO java sample application, but am experiencing a problem:
    When I request the papp.jsp page I end up in an infinte loop, caught between papp.jsp and ssosignon.jsp.
    An earlier thread in this forum discussed the same problem, guessing that the cookie handling was the problem. This thread recommended a particlar servlet , ShowCookie, for inspecting the cookies for the current session.
    I have installed this cookie on the server, but don't see anything but one cookie, JSESSIONID.
    At present I am running the jsp sample app on a Tomcat server, while Oracle 9iAS with sso and portal is running on another machine on the LAN.
    The configuration of the SSO sample application is as follows:
    Cut from SSOEnablerJspBean.java:
    // Listener token for this partner application name
    private static String m_listenerToken = "wmli007251:8080";
    // Partner application session cookie name
    private static String m_cookieName = "SSO_PAPP_JSP_ID";
    // Partner application session domain
    private static String m_cookieDomain = "wmli007251:8080/";
    // Partner application session path scope
    private static String m_cookiePath = "/";
    // Host name of the database
    private static String m_dbHostName = "wmsi001370";
    // Port for database
    private static String m_dbPort = "1521";
    // Sehema name
    private static String m_dbSchemaName = "testpartnerapp";
    // Schema password
    private static String m_dbSchemaPasswd = "testpartnerapp";
    // Database SID name
    private static String m_dbSID = "IASDB.WMDATA.DK";
    // Requested URL (User requested page)
    private static String m_requestUrl = "http://wmli007251:8080/testsso/papp.jsp";
    // Cancel URL(Home page for this application which don't require authentication)
    private static String m_cancelUrl = "http://wmli007251:8080/testsso/fejl.html";
    Values specified in the Oracle Portal partner app administration page:
         ID: 1326
         Token: O87JOE971326
         Encryption key: 67854625C8B9BE96
         Logon-URL: http://wmsi001370:7777/pls/orasso/orasso.wwsso_app_admin.ls_login
         single signoff-URL: http://wmsi001370:7777/pls/orasso/orasso.wwsso_app_admin.ls_logout
         Name: testsso
         Start-URL: http://wmli007251:8080/testsso/
         Succes-URL: http://wmli007251:8080/testsso/ssosignon.jsp
         Log off-URL: http://wmli007251:8080/testsso/papplogoff.jsp
    Finally I have specified the cookie version to be v1.0 when running the regapp.sql script. Other parameters for this script are copied from the values specified above.
    Unfortunately the discussion in the earlier thread did not go any further but to recognize the cookieproblem, so I am now looking for help to move further on from here.
    Any ideas will be greatly appreciated!
    /Mads

    Pierre - When you work on the sample application, you should test the pages in a separate browser instance. Don't use the Run Page links from the Builder. The sample app has a different authentication scheme from that used in the development environment so it'll work better for you to use a separate development browser from the application testing browser. In the testing browser, to request the page you just modified, login to the application, then change the page ID in the URL. Then put some navigation controls into the application so you can run your page more easily by clicking links from other pages.
    Scott

  • SSO between a Java EE application (Running on CE) and r/3 backend

    Hi All,
    Over the past few days I have been trying to implement a SSO mechanism between NW CE Java Apps and R/3 backend without any success. I have been trying to use SAP logon tickets for implementing SSO.
    Below is what I need:
    I have a Java EE application which draws data from R/3 backend and does some processing before showing data to the users. As of now the only way the Java App on CE authenticates to r/3 backend is by passing the userid and pwds explicitly. See sample authentication code below:
    BindingProvider bp = (BindingProvider) myService;
    Map<String,Object> context = bp.getRequestContext();
    context.put(BindingProvider.USERNAME_PROPERTY, userID);
    context.put(BindingProvider.PASSWORD_PROPERTY, userPwd);
    Now this is not the way we want to implement it. What we need is when the user authenticates to CE ( using CE's UME) CE issues a SAP logon ticket to the user. This ticket should be used to subsequently login to other system without having to pass the credentials. We have configured the CE and Backend to use SAP logon tickets as per SAP help.
    What I am not able to figure out is: How to authenticate to SAP r/3 service from the java APP using SAP logon tickets. I couldnt find any sample Java  code on SAP help to do this. (For example the above sample code authenticates the user by explicitly passing userid and pwd, I need something similar to pass a token to the backend)
    Any help/pointers on this would be great.
    Thanks,
    Dhananjay

    Hi,
    Have you imported the java certificate into R/3 backend system ? if so.
    Then just go to backend system and check on sm50 for each applicaion instance of any error eg.
    SM50-> Display files (ICON) as DB symbol with spect.(cntrlshiftF8)
    You will get logon ticket details.
    with thanks,
        Rajat

  • 'Unable to Launch Application Error' - Java Web Start Running Under MS IIS.

    I am attempting to render the following .jnlp in MS IE:
    <?xml version="1.0" encoding="utf-8"?>
    <!-- JNLP File for LottoMadness Application -->
    <jnlp
       codebase="http://localhost/LottoMadness/"
       href="LottoMadness.jnlp">
       <information>
         <title>LottoMadness Application</title>
         <vendor>Rogers Cadenhead</vendor>
         <homepage href="http://localhost/LottoMadness/"/>
         <icon href="lottobigicon.gif"/>
       </information>
       <resources>
         <j2se version="1.5"/>
         <jar href="LottoMadness.jar"/>
       </resources>
       <application-desc main-class="LottoMadness"/>
    </jnlp>I've deployed the .jnlp, .gif, and .jar to MS IIS, running locally on my PC.
    When I attempt to render the .jnlp in IE I obtain an 'Application Error' window stating 'Unable to Launch Application'. Clicking details gives me:
    com.sun.deploy.net.FailedDownloadException: Unable to load resource: http://localhost/LottoMadness/LottoMadness.jnlp
         at com.sun.deploy.net.DownloadEngine.actionDownload(Unknown Source)
         at com.sun.deploy.net.DownloadEngine.getCacheEntry(Unknown Source)
         at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source)
         at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source)
         at com.sun.deploy.net.DownloadEngine.getResource(Unknown Source)
         at com.sun.deploy.net.DownloadEngine.getResource(Unknown Source)
         at com.sun.javaws.Launcher.updateFinalLaunchDesc(Unknown Source)
         at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
         at com.sun.javaws.Launcher.launch(Unknown Source)
         at com.sun.javaws.Main.launchApp(Unknown Source)
         at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
         at com.sun.javaws.Main$1.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)I have configured MS IIS for Web Start, by setting the Extension/Content Type fields to .jnlp and application/x-java-jnlp-file.
    (The .jnlp is basically from 'Programming with Java in 24 Hours', as this is the book I am learning Java from.)

    AndrewThompson64 wrote:
    I am not used to seeing references to a local server that do not include a port number.
    E.G. http://localhost:8080/LottoMadness/
    I have deployed the following HTML (HelpMe.html) to the web server:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
         <title>Untitled</title>
    </head>
    <body>
    Help Me!
    </body>
    </html>When I attempt to render the URL in IE, I see the page just fine. The URL is use is:
    http://localhost/LottoMadness/HelpMe.htmlSo, I think my web server setup and usage is ok.
    >
    As an aside, what happens if (your MS IIS is running and) you click a direct link to..
    [http://localhost/LottoMadness/LottoMadness.jnlp|http://localhost/LottoMadness/LottoMadness.jnlp]
    When I click this link I get the error and exception I cited in my previous post.

  • Partner Application written in other language than PL/SQL and Java

    I have an application written in another language than PL/SQL or Java. I want to integrate this application as an Partner apps where I use the same user repository as Portal.
    Can I integrate the application by calling a stored PL/SQL-procedure based on the PLSQL SSO APIs examples that authenticates the user based on the username/password in portal and redirects the user to the application ?
    Are there any examples / references where this has been done ?
    Jens

    Check out the PDK referance for URL-Services, which allow you to integrate with any web based service/content.
    http://portalstudio.oracle.com/servlet/page?_pageid=350&_dad=ops&_schema=OPSTUDIO

Maybe you are looking for