StreamCorruptedException: trying to transmit objects per bytearray (UDP)

Hello Community,
For a school project I'm trying to send Objects over a UDP package, but every time I try to do so the following error occures:
"StreamCorruptedException: invalid stream header: 53617420 (in java.io.ObjectInputStream)"
The code for "UDP_OUTGOING":
import java.io.IOException;
import java.net.DatagramPacket;
import java.net.*;
import java.util.*;
import java.io.*;
class UDP_OUTGOING implements Serializable
    byte[] raw;
    public void transformToBytes(HERO hero) throws IOException, InterruptedException
        ByteArrayOutputStream buffer = new ByteArrayOutputStream();
        ObjectOutputStream out = new ObjectOutputStream(buffer);
        out.writeObject(hero);
        out.close();
        buffer.close();
        raw = buffer.toByteArray();
    public void sendData (String address) throws IOException, InterruptedException
        InetAddress ia = InetAddress.getByName( address );
      String s = new Date().toString();
      byte[] raw = s.getBytes();
      DatagramPacket packet = new DatagramPacket( raw, raw.length, ia, 4711 );
      DatagramSocket dSocket = new DatagramSocket();
      dSocket.send( packet );
      System.out.println( "Package sent!" );
} And here is the code for "UDP_INCOMING":
import java.io.IOException;
import java.net.*;
import java.io.Serializable;
import java.io.ByteArrayInputStream;
import java.io.ObjectInputStream;
public class UDP_INCOMING implements Serializable
    private boolean check = true;
    HERO hero;
    public HERO getData() throws IOException, ClassNotFoundException
        DatagramSocket socket = new DatagramSocket( 4711 );
        while ( check )
            // WAITING FOR PACKAGE
            DatagramPacket packet = new DatagramPacket( new byte[1024], 1024 ); //1024...Is this the problem maybe?
            socket.receive( packet );
            // READING PACKAGE
            byte[]      data    = packet.getData();
            ByteArrayInputStream bis = new ByteArrayInputStream(data);
            ObjectInputStream ois = new ObjectInputStream(bis);
            hero = (HERO) ois.readObject();
            ois.close();
            check = false;
        return hero;
  public void pauseGetData()
      check = false;
  public void startGetData()throws IOException, ClassNotFoundException
      check = true;
      this.getData();
} I hope you can help me,
Regards,
Karl

Your code using ObjectOutputStream is correct but you aren't using it. You're sending Date.toString() and you're trying to read it with an ObjectInputStream. Send the date with ObjectOutputStream.writeObject().

Similar Messages

  • JDAPI Error: ORA-04020: deadlock detected while trying to lock object

    I have written a JDAPI program to perform read-only impact analysis and report any problems.
    The following error is occurring:
    "A deadlock among DDL and parse locks is detected.
    This deadlock is usually due to user errors in the design of an application or from issuing a set of concurrent statements which can cause a deadlock.
    ORA-04020: deadlock detected while trying to lock object /NSPC6/CHECK_FOR_FORM_CHANGE"
    The error refers to a procedure in a PL/SQL library.
    In one case the error occurred after my final "end of processing" message, which is followed only by a call to "Jdapi.shutdown()".
    Any ideas?
    Thanks,
    Neville Sweet.

    I have written a JDAPI program to perform read-only impact analysis and report any problems.
    The following error is occurring:
    "A deadlock among DDL and parse locks is detected.
    This deadlock is usually due to user errors in the design of an application or from issuing a set of concurrent statements which can cause a deadlock.
    ORA-04020: deadlock detected while trying to lock object /NSPC6/CHECK_FOR_FORM_CHANGE"
    The error refers to a procedure in a PL/SQL library.
    In one case the error occurred after my final "end of processing" message, which is followed only by a call to "Jdapi.shutdown()".
    Any ideas?
    Thanks,
    Neville Sweet.

  • FPN - error trying to lookup object - remote role assignment not working

    Hello everyone,
    We have implemented a Federated Portal Network connection in our landscape between our portals.
    We use only remote role assignment functionality.
    Everything was working fine, but since 2 days we encounter the following error in the Default trace.
    Error trying to lookup object: alias: <role name>
    It is possible to open the producer portal in the Portal Content Administration and also searching for the Producer portal roles is possible in User administration. But when we assign the remote role the tab is not displayed in the portal only the above mentioned error is shown in the default trace. Our portals run SP 12 and BI Java SP14.
    Is there a solution or workaround for this issue ?
    Martin

    Hi,
    I have the same issue as you, I cannot see role tabs in Consumer portal and I get the same error in the defaulttrace as you.
    What did you do to resolve this issue?
    Many thanks
    Gordon

  • Captivate 8 responsive designs: only one 100% width object per slide?

    I've been customizing some responsive themes to use two or more 100% width objects. As I work with the project, I find that some of these objects fall short of the right edge at some break points or, more commonly, at intermediate browser widths between breakpoints. One object (a PNG used as a branded header) started slipping off to the right, leaving a big gap at the left, after I worked with the file for several hours.
    I've been putting this behaviour down to file corruption, but I'm now seeing the right-side gapping even with a fresh new file built on the White theme that has only one slide with three lines of text.
    Looking closer at the themes, I can see that none of them have more than a single 100% width object. Is this simply a coincidence, or does this reflect a real limitation in HTML 5 output from Captivate?
    Should I adapt my themes to use other objects at sub-100% widths, where a little gap on one side or the other won't make much of a difference? In short, should I simply avoid putting more than one object per slide flush with any of the edges?

    Replying to my own question ...
    Has no one else seen this? Is this a known bug?

  • ORA-04020: deadlock detected while trying to lock object SYS

    Upgrading database from 7.3.3 to 7.3.4. Running CAT7304.sql,
    Catalog.sql, and Catproc.sql. In the log file created there are
    mulptiple occurrences of;
    ORA-04045: errors during recompilation/revalidation of
    SYS.DBMS_SYS_SQL
    ORA-04045: errors during recompilation/revalidation of
    SYS.DBMS_SQL
    ORA-04020: deadlock detected while trying to lock object
    SYS.DBMS_SYS_SQL
    This only occurs on a Netware server, it works fine on NT.
    null

    Hi Steve,
    I recommend that you contact Oracle RDBMS support directly.Our
    main area of expertise is migrations from non-oracle
    environments.
    Regards
    John
    Steve Schindler (guest) wrote:
    : Upgrading database from 7.3.3 to 7.3.4. Running CAT7304.sql,
    : Catalog.sql, and Catproc.sql. In the log file created there are
    : mulptiple occurrences of;
    : ORA-04045: errors during recompilation/revalidation of
    : SYS.DBMS_SYS_SQL
    : ORA-04045: errors during recompilation/revalidation of
    : SYS.DBMS_SQL
    : ORA-04020: deadlock detected while trying to lock object
    : SYS.DBMS_SYS_SQL
    : This only occurs on a Netware server, it works fine on NT.
    Oracle Technology Network
    http://technet.oracle.com
    null

  • Query to determine the no. of objects per object_type for a give

    Hi,
    Below is the query i m using to determine the no. of objects per object_type for a given owner in DBA_RECYCLEBIN.
    SELECT count(OBJECT_NAME),TYPE from DBA_RECYCLEBIN
    groupby TYPE
    having OWNER='FRPDWSO';
    ERROR at line 1:
    ORA-00933: SQL command not properly endedI guess i m making a very silly mistake here, can anyone please help me solve this issue

    Oracle GROUP BY HAVING can be used to limit the returned rows after the grouping. With Oracle GROUP BY HAVING, the HAVING clause is applied after the GROUP BY has taken place.
    Oracle GROUP BY HAVING will group values that have a particular value. Oracle GROUP BY HAVING can be used in conjunction with other logical functions such as MIN, MAX, COUNT, and SUM.

  • Issue with BAPI_ACC_***_TRANSFER_POST (when trying to execute as per ABT1N)

    Hello experts,
    For this thread, please check the following link:
    [Issue with BAPI_ACC_***_TRANSFER_POST (when trying to execute as per ABT1N);
    Thanks and Regards,
    Daniel.

    Hi Experts,
    The question has been answered as per the following "link":
    [Issue with BAPI_ACC_***_TRANSFER_POST (when trying to execute as per ABT1N);
    Daniel

  • StreamCorruptedException when trying to deserialize Object containing a Vec

    Hello,
    I am trying to send an Object containing an (currently empty) Vector with ObjectInput/Output-Streams.
    But when deserializing the Object I always get a StreamCorruptedException: null.
    As soon as I remove the Vector from the Object everything works as it should.
    Anybody can tell me, what is happening here? I didn�t expect any trouble with the Vector since it implements Serializable and doesn�t contain anything, yet.
    Thanks,
    Philipp

    Hello again.
    to exclude problems with the HttpMessage-class I rewrote the applet-part to use an URLConnection. No you can see, what the HttpMessag-class does normally. It still raises the same error.
    Here it is:
    String argstring = URLEncoder.encode("command", "UTF-8") + "=" + URLEncoder.encode(command, "UTF-8");
    URL url = new URL(codeBase, chatServer);
    URLConnection con = url.openConnection();
    // Prepare for both input and output
    con.setDoInput(true);
    con.setDoOutput(true);
    // Turn off caching
    con.setUseCaches(false);
    // Work around a Netscape bug
    con.setRequestProperty("Content-Type",
    "application/x-www-form-urlencoded");
    // Write the arguments as post data
    DataOutputStream out = new DataOutputStream(con.getOutputStream());
    out.writeBytes(argstring);
    out.flush();
    out.close();
    InputStream in = con.getInputStream();
    ObjectInputStream oin = new ObjectInputStream(in);
    ChatCommandReply reply = (ChatCommandReply) oin.readObject();
    } catch (Exception ex)
    ex.printStackTrace();
    BTW, the stackTrace looks like this:
    java.io.StreamCorruptedException
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
         at java.io.ObjectInputStream.readSerialData(Unknown Source)
         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.readObject(Unknown Source)
         at com.byteshift.vobaclub.chat.client.Chatroom.sendCommand(Chatroom.java:217)
         at com.byteshift.vobaclub.chat.client.Chatroom.stop(Chatroom.java:256)
         at com.byteshift.vobaclub.chat.client.ChatApplet.stop(ChatApplet.java:72)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Regards,
    Philipp

  • Driver errors reported when trying to start objects

    We have a standard PCI can card, and are developing in the following environment:
    Software written in VC++ Version6,
    running under NT4.0,
    Port configured as 'CAN0',
    using extended arbitration IDs.
    We create one network interface object, and, depending on the test configuration, four CAN response objects.
    The problems are :-
    1) if the network interface object (nio) is configured as 'start on open'= TRUE then the other objects fail to initialise. If the other objects aren't started, the nio works perfectly though.
    2) If the nio is configured not to start on open, the other objects will initialise successfully (obviously not a lot of use though).
    Any attempt to call ncAction trying to start any of the objects will however fail with a status of 0xBFF62002, which is CanErrDriver.
    Below is a stripped down set of events as to how we start our card.
    AttrIdList[0] = NC_ATTR_BAUD_RATE;
    AttrValueList[0] = 125000; //BaudRate;
    AttrIdList[1] = NC_ATTR_START_ON_OPEN;
    if( Response_Enabled == 0 )
    AttrValueList[1] = NC_TRUE;
    NotificationStates = (NC_ST_READ_AVAIL |
    NC_ST_ERROR | NC_ST_WARNING | NC_ST_STOPPED);
    else
    AttrValueList[1] = NC_FALSE;
    // don't look for stopped state else it
    // will interrupt continuously.
    NotificationStates =
    (NC_ST_READ_AVAIL | NC_ST_ERROR |
    NC_ST_WARNING);
    AttrIdList[2] = NC_ATTR_READ_Q_LEN;
    AttrValueList[2] = 50; //500;
    AttrIdList[3] = NC_ATTR_WRITE_Q_LEN;
    AttrValueList[3] = 20;
    AttrIdList[4] = NC_ATTR_CAN_COMP_STD;
    AttrValueList[4] = 0;
    AttrIdList[5] = NC_ATTR_CAN_MASK_STD;
    AttrValueList[5] = 0; // NC_CAN_MASK_STD_DONTCARE;
    AttrIdList[6] = NC_ATTR_CAN_COMP_XTD;
    AttrValueList[6] = 0;
    AttrIdList[7] = NC_ATTR_CAN_MASK_XTD;
    AttrValueList[7] = 0; // NC_CAN_MASK_XTD_DONTCARE;
    // Configure the CAN Network Interface Object
    Status = ncConfig(szCanObject, 8, AttrIdList,
    AttrValueList);
    CheckStatus(Status, "ncConfig");
    CCanObject* pCanObject = new CCanObject;
    pCanObject->m_phObject = new (NCTYPE_OBJH);
    ASSERT (pCanObject->m_phObject != NULL);
    Status = ncOpenObject(szCanObject,
    pCanObject->m_phObject);
    CheckStatus(Status, "ncOpenObject");
    if (Status == 0) // object was
    // successfully created
    // add the CAN object to the list,
    // indexed by name
    m_CanObjectMap.SetAt(strObjectName,
    pCanObject);
    // create a string to identify the Notification
    pCanObject->m_pszObjectName = new char[strObjectName.GetLength() + 1];
    strcpy(pCanObject->m_pszObjectName, strObjectName);
    // Create the notification used to store incoming frames.
    // CanCallback will be called whenever a frame is available,
    // a background error occurs, or no frame is received for 30 seconds.
    // We pass a pointer to the global Queue data structure to the
    // callback's RefData parameter.
    Status = ncCreateNotification(
    *(pCanObject->m_phObject),
    NotificationStates,
    NC_DURATION_INFINITE, //CAN_TIMEOUT
    pCanObject->m_pszObjectName,
    CanCallback); // name of callback fn
    // check callback was installed
    CheckStatus(Status, "ncCreateNotification");
    at this point we kick off a timer for 200 msecs, and then carry on when the timer expires.
    This allows the card to get itself settled.
    This consists of checking configuration, and doing the following code for each of the response objects.
    The things that change are the object names, the arbitration IDs, and the response data.
    AttrIdList[0] = NC_ATTR_COMM_TYPE;
    AttrValueList[0] = NC_CAN_COMM_TX_RESP_ONLY;
    //failed bff62002 if objects set to 'start on open'
    // All of the following are here as a result of testing.
    // The setting above is the one that should eventually be used.
    // Finally resolved by not using start-on-open above.
    // AttrValueList[0] = NC_CAN_COMM_RX_UNSOL; //worked
    // AttrValueList[0] = NC_CAN_COMM_RX_PERIODIC; //failed bff62005
    // AttrValueList[0] = NC_CAN_COMM_RX_BY_CALL; //worked
    /// AttrValueList[0] = NC_CAN_COMM_TX_PERIODIC; //worked - crashed with unhandled exception on closure though
    // AttrValueList[0] = NC_CAN_COMM_TX_BY_CALL; //worked
    // AttrValueList[0] = NC_CAN_COMM_TX_WAVEFORM; //worked - crashed with unhandled exception on closure though
    // Specify watchdog timer period
    AttrIdList[1] = NC_ATTR_BKD_PERIOD;
    AttrValueList[1] = 1000;
    // respond with DLC
    AttrIdList[2] = NC_ATTR_BKD_READ_SIZE;
    AttrValueList[2] = 0;
    AttrIdList[3] = NC_ATTR_BKD_WRITE_SIZE;
    AttrValueList[3] = DataLengthCode; // normally 3
    AttrIdList[4] = NC_ATTR_CAN_TX_RESPONSE;
    AttrValueList[4] = NC_TRUE;
    /* This attribute is ignored for CAN Objects which transmit data. */
    AttrIdList[5] = NC_ATTR_RX_CHANGES_ONLY;
    AttrValueList[5] = NC_TRUE;
    // maximum number of frames to hold in read queue
    AttrIdList[6] = NC_ATTR_READ_Q_LEN;
    AttrValueList[6] = 0;
    // The write queue length is set to zero (queuing disabled).
    // This means that for each request, the most recent data written
    // using ncWrite will be transmitted in a Data Frame.
    AttrIdList[7] = NC_ATTR_WRITE_Q_LEN;
    AttrValueList[7] = 0;
    // build the CAN object name
    sprintf(szCanName, "%s::XTD0x%08lx", CanBus, ArbitrationId );
    //*arbitration IDs normally used are
    //*0x19008000,
    //*0x19008001,
    //*0x19008002
    // configure the CAN object
    Status = ncConfig(szCanName, ATTR_LIST_LEN, AttrIdList, AttrValueList);
    // check for errors
    CheckStatus(Status, szTemp);
    // Open the transmitting CAN Object. The object starts up, but it
    // will wait for the first call to ncWrite before it transmits a Data
    // Frame.
    CCanObject* pCanObject = new CCanObject;
    pCanObject->m_phObject = new (NCTYPE_OBJH);
    ASSERT (pCanObject->m_phObject != NULL);
    Status = ncOpenObject(szCanName,
    pCanObject->m_phObject);
    CheckStatus(Status, szTemp);
    if (Status == 0) // CAN object created successfully
    // Store CAN bus information into object
    pCanObject->m_strCanBusName = CanBus;
    pCanObject->m_strCanName.Format("%s", szCanName);
    pCanObject->m_ArbitrationID = ArbitrationId;
    // add the CAN object to the list, indexed by name
    // put data into output buffer
    for (int i = 0; i < DataLengthCode; i++)
    Transmit.Data[i] = DefaultData[i];
    // setup CAN object output buffer
    Status= ncWrite(*(pCanObject->m_phObject),
    sizeof(Transmit), &Transmit);
    CheckStatus(Status, "ncWrite");
    // create a string to identify the Notification
    pCanObject->m_pszObjectName = new char
    [strObjectName.GetLength() + 1];
    strcpy(pCanObject->m_pszObjectName,
    strObjectName);
    Status = ncCreateNotification(
    *(pCanObject->m_phObject),
    NC_ST_WRITE_SUCCESS,
    NC_DURATION_INFINITE,
    pCanObject->m_pszObjectName,
    NotificationCallback);
    // check callback was installed
    CheckStatus(Status, "ncCreateNotification");
    -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    So, Any ideas what we're doing wrong ??
    The cards were new in December 2001.
    Software driver version installed is Version 1.5.1
    It makes little difference which card we use, as we have many cards at this site in various pieces of test equipment, and I have tried at least 6 !
    Things are beginning to get a little depserate here =:-/
    Regards,
    John Webster.

    Many thanks for the prompt reponse Diego.
    A couple of comments on what you have written above.
    The Response objects are only used for the 4 messages that need responses. All other messages are handled (received) by the Network Interface Object. Is it still therefore true to say that I should be using NC_CAN_ARBID_NONE ?
    I think the answer will be yes, but want to confirm.
    Am I correct to say that from your description, the only change was as belows :-
    AttrValueList[2] = 0;
    AttrValueList[3] = 0;
    AttrValueList[6] = NC_CAN_ARBID_NONE;
    Should I also be setting NC_ATTR_CAN_COMP_STD to NC_CAN_ARBID_NONE too ?
    Many thanks for your help. This one has been causing us a lot of problems for a long time. I have changed many of the pa
    rameters, but must admit I don't think I tried that one before.
    Just off now to try this, see if it makes our code work !
    Regards,
    John.

  • Error occured when trying to pass object from Jsp to Applet

    I am trying to pass a serialized object(ie, object class implements java.io.Serializable...so that is not a problem) from a Jsp to an Applet.
    My jsp(Jsp_RMI.jsp) page is:-
    <%@ page import="java.io.*" %>
    <%@ page import="com.itlinfosys.syslab.mfasys.scm.*" %>
    <%@ page import="java.util.*" %>
    <applet code="com/itlinfosys/syslab/mfasys/scm/Applet_RMI" width=200 height=100>
    </applet>
    <%! ObjectOutputStream outputToApplet=null;
    PrintWriter out=null;
    BufferedReader inTest=null;
    %> <% Student student=new Student();
    Vector students=new Vector();
    students.addElement(student);
    outputToApplet=new ObjectOutputStream(response.getOutputStream());
    outputToApplet.writeObject(students);
    out.println(student);
    outputToApplet.flush();
    outputToApplet.close();
    %> <html> <head> <title>My Page</title> </head> <body> </body> </html>
    My Applet Applet_RMI.java is:-
    package com.itlinfosys.syslab.mfasys.scm;
    import java.applet.*;
    import java.net.*;
    import java.io.*;
    import com.itlinfosys.syslab.mfasys.scm.Student;
    import java.util.*;
    public class Applet_RMI extends Applet{
    Vector aStudent=null;
    ObjectInputStream inputFromServlet=null;
    String location="<URL>";
    public void init(){
    getConnection(location);
    public void getConnection(String location) {
    try{
    URL testJsp=new URL(location);
    URLConnection jspConnection=testJsp.openConnection();
    jspConnection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
    jspConnection.setDoInput(true);
    jspConnection.setDoOutput(true);
    jspConnection.setUseCaches(false);
    jspConnection.setDefaultUseCaches(false);
    inputFromServlet=new ObjectInputStream(jspConnection.getInputStream());
    aStudent=(Vector)inputFromServlet.readObject();
    }catch(MalformedURLException e){ System.out.println(e);
    catch(IOException e){
    System.out.println(e);
    catch(ClassNotFoundException e){ System.out.println(e);
    I am using netscape-4.73 on weblogic server. On server when I try to view Jsp page it gives netscape.security.AppletSecurity Exception.
    When I am trying to call this Jsp from IE-5 on my client machine, I am getting error:-"java.io.StreamCorruptedException: InputStream does not contain a serialized" Pl help me out.

    You should probably change your implementation to use a servlet rather than JSP. There may be extra stuff being put in by the JSP. Besides, servlets run faster. Here is some code that may help.
    From the Servlet:
      public void doPost(
          HttpServletRequest               httpServletRequest,
          HttpServletResponse              httpServletResponse )
          throws ServletException, IOException {
        ObjectInputStream in = new ObjectInputStream(new GZIPInputStream(httpServletRequest.getInputStream()));
        requestObject = in.readObject() ;
        ObjectOutputStream out = new ObjectOutputStream(new GZIPOutputStream(httpServletResponse.getOutputStream()));
        out.writeObject(responseObject);
        out.close();
      } //end doPost()And from the Applet:
      public Object doServletCall(
          Object                           sendObject ) {
        try {
          HttpURLConnection con = (HttpURLConnection)servlet.openConnection() ;
          con.setRequestMethod("POST");
          con.setDoInput(true);
          con.setDoOutput(true);
          con.setUseCaches(false);
          con.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
          ObjectOutputStream out = new ObjectOutputStream(new GZIPOutputStream(con.getOutputStream()));
          out.writeObject(sendObject);
          out.flush();
          out.close();
          ObjectInputStream in = new ObjectInputStream(new GZIPInputStream(con.getInputStream()));
          Object returnObject = in.readObject() ;
          in.close();
          return returnObject ;
        } catch (IOException e) {
          e.printStackTrace();
        } catch (ClassNotFoundException e) {
          e.printStackTrace();
        } //end try
        return null ;
      } //end doServletCall()Of course you can remove the ZIP and send object if you don't need them

  • Error in IB (When trying to import objects into ESR from SLD or from server

    Hi Experts,
    We are facing an error with the Integration builder recently. When we open Enterprise Services Repository of PI 7.1, we are able to see the GUI with objects perfectly. When we try to import an object into the repository from the server ( In ESR, choose Tools -> Import Design objects -> From Server), we are thrown with an exception...
    Error when exectuting search (QUERY_ERROR)
    & java.lang.NullPointerException
    The server throws the above two exceptions. I have pasted the logs of the error when trying to import an object from the server and also from the sld, below.
    Have any of you experieced the issue? Request you to please check this out and suggest what the problem could be. Thanks in advance.
    Regards,
    Basker
    Log of the error received when trying to import an object from the server...
    ====================================================================
    = Root Exception ===================================================
    ====================================================================
    Thrown:
    com.sap.aii.utilxi.swing.framework.ExecuteException: Error when executing search
    at com.sap.aii.ib.gui.shelp.QueryPanel.executeQuery(QueryPanel.java:582)
    at com.sap.aii.ib.gui.shelp.QueryPanel.startQuery(QueryPanel.java:595)
    at com.sap.aii.ib.gui.shelp.QueryPanel$1.run(QueryPanel.java:218)
    at com.sap.aii.utilxi.misc.thread.ThreadPool$ThreadPoolThread.run(ThreadPool.java:392)
    Caused by: java.lang.NullPointerException: null
    at com.sap.aii.utilxi.core.collections.ArrayUtil.appendArrays(ArrayUtil.java:331)
    at com.sap.aii.ib.gui.xiitem.services.XiItemServiceProvider.queryXiItems(XiItemServiceProvider.java:273)
    at com.sap.aii.ib.gui.xiitem.services.XiItemServiceProvider.queryXiItems(XiItemServiceProvider.java:241)
    at com.sap.aii.ib.gui.shelp.StandardQueryAccessor.executeQuery(StandardQueryAccessor.java:68)
    at com.sap.aii.ib.gui.shelp.QueryPanel.executeQuery(QueryPanel.java:567)
    ... 3 more
    ====================================================================
    == Content from the LogHandler =====================================
    ====================================================================
    #12 13:44:56 AWT-EventQueue-2 ERROR com.sap.aii.utilxi.swing.toolkit.ExceptionDialog: Throwable
    Thrown:
    com.sap.aii.utilxi.swing.framework.ExecuteException: Error when executing search
    at com.sap.aii.ib.gui.shelp.QueryPanel.executeQuery(QueryPanel.java:582)
    at com.sap.aii.ib.gui.shelp.QueryPanel.startQuery(QueryPanel.java:595)
    at com.sap.aii.ib.gui.shelp.QueryPanel$1.run(QueryPanel.java:218)
    at com.sap.aii.utilxi.misc.thread.ThreadPool$ThreadPoolThread.run(ThreadPool.java:392)
    Caused by: java.lang.NullPointerException: null
    at com.sap.aii.utilxi.core.collections.ArrayUtil.appendArrays(ArrayUtil.java:331)
    at com.sap.aii.ib.gui.xiitem.services.XiItemServiceProvider.queryXiItems(XiItemServiceProvider.java:273)
    at com.sap.aii.ib.gui.xiitem.services.XiItemServiceProvider.queryXiItems(XiItemServiceProvider.java:241)
    at com.sap.aii.ib.gui.shelp.StandardQueryAccessor.executeQuery(StandardQueryAccessor.java:68)
    at com.sap.aii.ib.gui.shelp.QueryPanel.executeQuery(QueryPanel.java:567)
    ... 3 more
    #11 13:44:55 Pool-Thread-0 FINE AutoLog.created.java.lang.NullPointerException: java.lang.NullPointerException
    at com.sap.aii.utilxi.core.collections.ArrayUtil.appendArrays(ArrayUtil.java:331)
    at com.sap.aii.ib.gui.xiitem.services.XiItemServiceProvider.queryXiItems(XiItemServiceProvider.java:273)
    at com.sap.aii.ib.gui.xiitem.services.XiItemServiceProvider.queryXiItems(XiItemServiceProvider.java:241)
    at com.sap.aii.ib.gui.shelp.StandardQueryAccessor.executeQuery(StandardQueryAccessor.java:68)
    at com.sap.aii.ib.gui.shelp.QueryPanel.executeQuery(QueryPanel.java:567)
    at com.sap.aii.ib.gui.shelp.QueryPanel.startQuery(QueryPanel.java:595)
    at com.sap.aii.ib.gui.shelp.QueryPanel$1.run(QueryPanel.java:218)
    at com.sap.aii.utilxi.misc.thread.ThreadPool$ThreadPoolThread.run(ThreadPool.java:392)
    #10 13:44:55 Pool-Thread-0 DEBUG AutoLog.created.java.lang.NullPointerException: null
    #9 13:44:55 Pool-Thread-0 FINE AutoLog.created.com.sap.aii.utilxi.swing.framework.ExecuteException: com.sap.aii.utilxi.swing.framework.ExecuteException: Error when executing search
    at com.sap.aii.ib.gui.shelp.QueryPanel.executeQuery(QueryPanel.java:582)
    at com.sap.aii.ib.gui.shelp.QueryPanel.startQuery(QueryPanel.java:595)
    at com.sap.aii.ib.gui.shelp.QueryPanel$1.run(QueryPanel.java:218)
    at com.sap.aii.utilxi.misc.thread.ThreadPool$ThreadPoolThread.run(ThreadPool.java:392)
    Caused by: java.lang.NullPointerException
    at com.sap.aii.utilxi.core.collections.ArrayUtil.appendArrays(ArrayUtil.java:331)
    at com.sap.aii.ib.gui.xiitem.services.XiItemServiceProvider.queryXiItems(XiItemServiceProvider.java:273)
    at com.sap.aii.ib.gui.xiitem.services.XiItemServiceProvider.queryXiItems(XiItemServiceProvider.java:241)
    at com.sap.aii.ib.gui.shelp.StandardQueryAccessor.executeQuery(StandardQueryAccessor.java:68)
    at com.sap.aii.ib.gui.shelp.QueryPanel.executeQuery(QueryPanel.java:567)
    ... 3 more
    #8 13:44:55 Pool-Thread-0 DEBUG AutoLog.created.com.sap.aii.utilxi.swing.framework.ExecuteException: Error when executing search
    #7 13:43:52 AWT-EventQueue-2 FINE AutoLog.created.com.sap.engine.services.security.exceptions.BaseLoginException: com.sap.engine.services.security.exceptions.BaseLoginException: Authentication did not succeed.
    at com.sap.engine.services.security.server.jaas.BasicPasswordLoginModule.login(BasicPasswordLoginModule.java:149)
    at com.sap.engine.services.security.login.LoginModuleLoggingWrapperImpl.login(LoginModuleLoggingWrapperImpl.java:220)
    at com.sap.engine.services.security.login.ModulesProcessAction.run(ModulesProcessAction.java:70)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sap.engine.services.security.login.FastLoginContext.login(FastLoginContext.java:218)
    at com.sap.engine.services.security.remoteimpl.login.RemoteLoginContextHelperImpl.login(RemoteLoginContextHelperImpl.java:78)
    at com.sap.engine.services.security.remoteimpl.login.RemoteLoginContextHelperImplp4_Skel.dispatch(RemoteLoginContextHelperImplp4_Skel.java:64)
    at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:351)
    at com.sap.engine.services.rmi_p4.server.ServerDispatchImpl.run(ServerDispatchImpl.java:70)
    at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:62)
    at com.sap.engine.services.rmi_p4.P4Message.execute(P4Message.java:37)
    at com.sap.engine.services.cross.fca.FCAConnectorImpl.executeRequest(FCAConnectorImpl.java:872)
    at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:53)
    at com.sap.engine.services.cross.fca.MessageReader.run(MessageReader.java:58)
    at com.sap.engine.core.thread.execution.Executable.run(Executable.java:108)
    at com.sap.engine.core.thread.execution.CentralExecutor$SingleThread.run(CentralExecutor.java:304)
    predecessor system
    com.sap.engine.services.security.exceptions.BaseLoginException: Authentication did not succeed.
    at com.sap.engine.services.security.server.jaas.BasicPasswordLoginModule.login(BasicPasswordLoginModule.java:149)
    at com.sap.engine.services.security.login.LoginModuleLoggingWrapperImpl.login(LoginModuleLoggingWrapperImpl.java:220)
    at com.sap.engine.services.security.login.ModulesProcessAction.run(ModulesProcessAction.java:70)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sap.engine.services.security.login.FastLoginContext.login(FastLoginContext.java:218)
    at com.sap.engine.services.security.remoteimpl.login.RemoteLoginContextHelperImpl.login(RemoteLoginContextHelperImpl.java:78)
    at com.sap.engine.services.security.remoteimpl.login.RemoteLoginContextHelperImplp4_Skel.dispatch(RemoteLoginContextHelperImplp4_Skel.java:64)
    at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:351)
    at com.sap.engine.services.rmi_p4.server.ServerDispatchImpl.run(ServerDispatchImpl.java:70)
    at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:62)
    at com.sap.engine.services.rmi_p4.P4Message.execute(P4Message.java:37)
    at com.sap.engine.services.cross.fca.FCAConnectorImpl.executeRequest(FCAConnectorImpl.java:872)
    at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:53)
    at com.sap.engine.services.cross.fca.MessageReader.run(MessageReader.java:58)
    at com.sap.engine.core.thread.execution.Executable.run(Executable.java:108)
    at com.sap.engine.core.thread.execution.CentralExecutor$SingleThread.run(CentralExecutor.java:304)
    #6 13:43:52 AWT-EventQueue-2 DEBUG AutoLog.created.com.sap.engine.services.security.exceptions.BaseLoginException: Authentication did not succeed.
    #5 13:43:52 AWT-EventQueue-2 FINE AutoLog.created.com.sap.engine.services.security.exceptions.BaseLoginException: com.sap.engine.services.security.exceptions.BaseLoginException: Cannot authenticate the user.
    at com.sap.engine.services.security.login.ModulesProcessAction.run(ModulesProcessAction.java:175)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sap.engine.services.security.login.FastLoginContext.login(FastLoginContext.java:218)
    at com.sap.engine.services.security.remoteimpl.login.RemoteLoginContextHelperImpl.login(RemoteLoginContextHelperImpl.java:78)
    at com.sap.engine.services.security.remoteimpl.login.RemoteLoginContextHelperImplp4_Skel.dispatch(RemoteLoginContextHelperImplp4_Skel.java:64)
    at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:351)
    at com.sap.engine.services.rmi_p4.server.ServerDispatchImpl.run(ServerDispatchImpl.java:70)
    at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:62)
    at com.sap.engine.services.rmi_p4.P4Message.execute(P4Message.java:37)
    at com.sap.engine.services.cross.fca.FCAConnectorImpl.executeRequest(FCAConnectorImpl.java:872)
    at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:53)
    at com.sap.engine.services.cross.fca.MessageReader.run(MessageReader.java:58)
    at com.sap.engine.core.thread.execution.Executable.run(Executable.java:108)
    at com.sap.engine.core.thread.execution.CentralExecutor$SingleThread.run(CentralExecutor.java:304)
    Caused by: com.sap.engine.services.security.exceptions.BaseLoginException: Authentication did not succeed.
    at com.sap.engine.services.security.server.jaas.BasicPasswordLoginModule.login(BasicPasswordLoginModule.java:149)
    at com.sap.engine.services.security.login.LoginModuleLoggingWrapperImpl.login(LoginModuleLoggingWrapperImpl.java:220)
    at com.sap.engine.services.security.login.ModulesProcessAction.run(ModulesProcessAction.java:70)
    ... 13 more
    predecessor system
    com.sap.engine.services.security.exceptions.BaseLoginException: Cannot authenticate the user.
    at com.sap.engine.services.security.login.ModulesProcessAction.run(ModulesProcessAction.java:175)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sap.engine.services.security.login.FastLoginContext.login(FastLoginContext.java:218)
    at com.sap.engine.services.security.remoteimpl.login.RemoteLoginContextHelperImpl.login(RemoteLoginContextHelperImpl.java:78)
    at com.sap.engine.services.security.remoteimpl.login.RemoteLoginContextHelperImplp4_Skel.dispatch(RemoteLoginContextHelperImplp4_Skel.java:64)
    at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:351)
    at com.sap.engine.services.rmi_p4.server.ServerDispatchImpl.run(ServerDispatchImpl.java:70)
    at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:62)
    at com.sap.engine.services.rmi_p4.P4Message.execute(P4Message.java:37)
    at com.sap.engine.services.cross.fca.FCAConnectorImpl.executeRequest(FCAConnectorImpl.java:872)
    at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:53)
    at com.sap.engine.services.cross.fca.MessageReader.run(MessageReader.java:58)
    at com.sap.engine.core.thread.execution.Executable.run(Executable.java:108)
    at com.sap.engine.core.thread.execution.CentralExecutor$SingleThread.run(CentralExecutor.java:304)
    Caused by: com.sap.engine.services.security.exceptions.BaseLoginException: Authentication did not succeed.
    at com.sap.engine.services.security.server.jaas.BasicPasswordLoginModule.login(BasicPasswordLoginModule.java:149)
    at com.sap.engine.services.security.login.LoginModuleLoggingWrapperImpl.login(LoginModuleLoggingWrapperImpl.java:220)
    at com.sap.engine.services.security.login.ModulesProcessAction.run(ModulesProcessAction.java:70)
    ... 13 more

    Hi Rajeev,
    Thanks for your inputs. I myself am a basis guy. I ve already checked all the authorizations given to the user - PISUPER, and have found it to be fine. Can't understand why this security issue crops up still. anyways, i m getting this error when trying to import an object from the server. If i try to create a new object and during the process, try to import the SCV from SLD, i m facing with an error again, of a different sort. The log says...
    ====================================================================
    = Root Exception ===================================================
    ====================================================================
    Thrown:
    com.sap.aii.utilxi.misc.api.BaseRuntimeException: Internal error during bean lookup for bean SldAccessServiceBean
         at com.sap.aii.ib.clsif.gen.BeanAccessHandler.handleRuntimeExInBusinessMethod(BeanAccessHandler.java:113)
         at com.sap.aii.ib.client.sldAccess.impl.SldAccessServiceDelegate.getSwcvLinks(SldAccessServiceDelegate.java:55)
         at com.sap.aii.ibrep.gui.workspace.WorkspaceCreatePanel.getSwcvLinksAdapter(WorkspaceCreatePanel.java:520)
         at com.sap.aii.ibrep.gui.workspace.WorkspaceCreatePanel.access$000(WorkspaceCreatePanel.java:75)
         at com.sap.aii.ibrep.gui.workspace.WorkspaceCreatePanel$4.getResult(WorkspaceCreatePanel.java:449)
         at com.sap.aii.utilxi.swing.toolkit.InterruptableProgressDialog$1.construct(InterruptableProgressDialog.java:190)
         at com.sap.aii.utilxi.swing.toolkit.SwingWorker$2.run(SwingWorker.java:126)
         at java.lang.Thread.run(Unknown Source)
    Caused by: com.sap.aii.utilxi.misc.api.BaseRuntimeException: Internal error during bean lookup for bean SldAccessServiceBean
         at com.sap.aii.ib.clsif.login.LoginServiceImpl.getHomeInterface(LoginServiceImpl.java:460)
         at com.sap.aii.ib.clsif.login.LoginServiceImpl.getBusinessInterface(LoginServiceImpl.java:425)
         at com.sap.aii.ib.clsif.gen.BeanAccessHandler.getBean(BeanAccessHandler.java:60)
         at com.sap.aii.ib.client.sldAccess.impl.SldAccessServiceDelegate.getBean(SldAccessServiceDelegate.java:79)
         at com.sap.aii.ib.client.sldAccess.impl.SldAccessServiceDelegate.getSwcvLinks(SldAccessServiceDelegate.java:49)
         ... 6 more
    Caused by: com.sap.aii.ib.core.ejbutil.HomeFactoryException: Exception during lookup operation of object with name sap.com/com.sap.xi.repository/SldAccessServiceBean, cannot resolve object reference.
         at com.sap.aii.ib.clsif.login.EJBHomeFactory.lookUpHome(EJBHomeFactory.java:381)
         at com.sap.aii.ib.clsif.login.LoginServiceImpl.getHomeInterface(LoginServiceImpl.java:456)
         ... 10 more
    Caused by: com.sap.engine.services.jndi.persistent.exceptions.NamingException: Exception during lookup operation of object with name sap.com/com.sap.xi.repository/SldAccessServiceBean, cannot resolve object reference.
         at com.sap.engine.services.jndi.implclient.ClientContext.lookup(ClientContext.java:528)
         at com.sap.engine.services.jndi.implclient.ClientContext.lookup(ClientContext.java:637)
         at javax.naming.InitialContext.lookup(Unknown Source)
         at com.sap.aii.ib.clsif.login.EJBHomeFactory.lookUpHome(EJBHomeFactory.java:353)
         ... 11 more
    Caused by: javax.naming.NamingException: Error occurs while the EJB Object Factory trying to resolve JNDI reference Reference Class Name:
    Type: clientAppName
    Content: sap.com/com.sap.xi.repository
    Type: interfaceType
    Content: remote
    Type: home
    Content: com.sap.aii.ib.sbeans.sldAccess.SldAccessServiceHome
    Type: ejb-link
    Content: SldAccessServiceBean
    Type: remote
    Content: com.sap.aii.ib.sbeans.sldAccess.SldAccessServiceRemote
    com.sap.engine.services.jndi.persistent.exceptions.NamingException: Exception while trying to get InitialContext.
         at com.sap.engine.services.jndi.InitialContextFactoryImpl.getInitialContext(InitialContextFactoryImpl.java:488)
         at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
         at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
         at javax.naming.InitialContext.init(Unknown Source)
         at javax.naming.InitialContext.<init>(Unknown Source)
         at com.sap.engine.services.ejb3.runtime.impl.EJBObjectFactory.getObjectInstance(EJBObjectFactory.java:73)
         at com.sap.engine.services.ejb3.runtime.impl.EJBObjectFactory.getObjectInstance(EJBObjectFactory.java:58)
         at javax.naming.spi.NamingManager.getObjectInstance(Unknown Source)
         at com.sap.engine.services.jndi.implclient.ClientContext.lookup(ClientContext.java:521)
         at com.sap.engine.services.jndi.implclient.ClientContext.lookup(ClientContext.java:637)
         at javax.naming.InitialContext.lookup(Unknown Source)
         at com.sap.aii.ib.clsif.login.EJBHomeFactory.lookUpHome(EJBHomeFactory.java:353)
         at com.sap.aii.ib.clsif.login.LoginServiceImpl.getHomeInterface(LoginServiceImpl.java:456)
         at com.sap.aii.ib.clsif.login.LoginServiceImpl.getBusinessInterface(LoginServiceImpl.java:425)
         at com.sap.aii.ib.clsif.gen.BeanAccessHandler.getBean(BeanAccessHandler.java:60)
         at com.sap.aii.ib.client.sldAccess.impl.SldAccessServiceDelegate.getBean(SldAccessServiceDelegate.java:79)
         at com.sap.aii.ib.client.sldAccess.impl.SldAccessServiceDelegate.getSwcvLinks(SldAccessServiceDelegate.java:49)
         at com.sap.aii.ibrep.gui.workspace.WorkspaceCreatePanel.getSwcvLinksAdapter(WorkspaceCreatePanel.java:520)
         at com.sap.aii.ibrep.gui.workspace.WorkspaceCreatePanel.access$000(WorkspaceCreatePanel.java:75)
         at com.sap.aii.ibrep.gui.workspace.WorkspaceCreatePanel$4.getResult(WorkspaceCreatePanel.java:449)
         at com.sap.aii.utilxi.swing.toolkit.InterruptableProgressDialog$1.construct(InterruptableProgressDialog.java:190)
         at com.sap.aii.utilxi.swing.toolkit.SwingWorker$2.run(SwingWorker.java:126)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.IOException: Can't get Socket. Reason:Connection timed out: connect
         at com.sap.engine.interfaces.cross.io.transport.PortManager.getRealSocket(PortManager.java:284)
         at com.sap.engine.interfaces.cross.LoadBalancerImpl.getAllAccessPoints(LoadBalancerImpl.java:97)
         at com.sap.engine.interfaces.cross.CrossObjectBroker.getDestination(CrossObjectBroker.java:142)
         at com.sap.engine.services.jndi.InitialContextFactoryImpl.getInitialContext(InitialContextFactoryImpl.java:347)
         at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
         at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
         at javax.naming.InitialContext.init(Unknown Source)
         at javax.naming.InitialContext.<init>(Unknown Source)
         at com.sap.engine.services.ejb3.runtime.impl.EJBObjectFactory.getObjectInstance(EJBObjectFactory.java:73)
         at com.sap.engine.services.ejb3.runtime.impl.EJBObjectFactory.getObjectInstance(EJBObjectFactory.java:58)
         at javax.naming.spi.NamingManager.getObjectInstance(Unknown Source)
         at com.sap.engine.services.jndi.implclient.ClientContext.lookup(ClientContext.java:521)
         at com.sap.engine.services.jndi.implclient.ClientContext.lookup(ClientContext.java:637)
         at javax.naming.InitialContext.lookup(Unknown Source)
         at com.sap.aii.ib.clsif.login.EJBHomeFactory.lookUpHome(EJBHomeFactory.java:353)
         at com.sap.aii.ib.clsif.login.LoginServiceImpl.getHomeInterface(LoginServiceImpl.java:456)
         at com.sap.aii.ib.clsif.login.LoginServiceImpl.getBusinessInterface(LoginServiceImpl.java:425)
         at com.sap.aii.ib.clsif.gen.BeanAccessHandler.getBean(BeanAccessHandler.java:60)
         at com.sap.aii.ib.client.sldAccess.impl.SldAccessServiceDelegate.getBean(SldAccessServiceDelegate.java:79)
         at com.sap.aii.ib.client.sldAccess.impl.SldAccessServiceDelegate.getSwcvLinks(SldAccessServiceDelegate.java:49)
         at com.sap.aii.ibrep.gui.workspace.WorkspaceCreatePanel.getSwcvLinksAdapter(WorkspaceCreatePanel.java:520)
         at com.sap.aii.ibrep.gui.workspace.WorkspaceCreatePanel.access$000(WorkspaceCreatePanel.java:75)
         at com.sap.aii.ibrep.gui.workspace.WorkspaceCreatePanel$4.getResult(WorkspaceCreatePanel.java:449)
         at com.sap.aii.utilxi.swing.toolkit.InterruptableProgressDialog$1.construct(InterruptableProgressDialog.java:190)
         at com.sap.aii.utilxi.swing.toolkit.SwingWorker$2.run(SwingWorker.java:126)
         at java.lang.Thread.run(Unknown Source)
         at com.sap.engine.services.ejb3.runtime.impl.EJBObjectFactory.getObjectInstance(EJBObjectFactory.java:140)
         at com.sap.engine.services.ejb3.runtime.impl.EJBObjectFactory.getObjectInstance(EJBObjectFactory.java:58)
         at javax.naming.spi.NamingManager.getObjectInstance(Unknown Source)
         at com.sap.engine.services.jndi.implclient.ClientContext.lookup(ClientContext.java:521)
         ... 14 more
    Any clues what might be the issue?
    thanks in advance,
    Regards,
    Basker

  • View in html?  trying to embed object

    hi i am trying to embed an object from a website
    it is a music store for my band
    how would i embed it? its just coming up as html code
    can i view my website as html to include it?
    thanks

    Jessica ~ With iWeb 1 you'll need to do some post-publishing editing of the HTML files of your published site in order to embed custom HTML. And you'll have to do that editing +each time you change your site+. This can be done manually ~ in iWeb, you would publish your site to a folder, then edit the files using, say, +Taco HTML Edit+:
    http://tacosw.com/index.php
    ...or there are some other tools to help, e.g.
    http://iwebmore.ctrl-j.eu/iWebMore.html
    http://web.mac.com/cbrantly/iWeb/Software/iWeb%20Enhancer.html
    You won't need to do post-publishing editing if you upgrade to iLife'08 ~ you can use iWeb 2's +HTML Snippet+ feature to easily add custom HTML:
    http://www.apple.com/ilife/iweb/#widgets
    ...This would be the best way.

  • Trying to make object move parabolically....

    Im creating a race track where an object goes around in laps.. So far, the object is moving at straight 90 degree angles when it hits sides.. Im trying, and also wondering how to make the object curve when it turns a corner instead of hitting the edge, then turning a full 90 degree angle.... Im really stumped, first year takin Java :(
    Here's what I got so far:
    // The "Race" class.
    import java.applet.*;
    import java.awt.*;
    public class Race extends Applet implements Runnable
        Dimension d = getSize ();
        Font f;
        int counter = 0;
        int xchange;
        int ychange;
        int x = 50;
        int y = d.height - 50;
        boolean beg = false;
        boolean slow = false;
        boolean medi = false;
        boolean fast = false;
        Button start, slo, med, fas, stop;
        TextField output;
        Thread t;
        Graphics bufferg;
        Image buffer;
        Image CARu, CARd, CARl, CARr, bakg;
        AudioClip intro, test;
        public void init ()
            test = getAudioClip (getCodeBase (), "1.au");
            intro = getAudioClip (getCodeBase (), "laser.au");
            Dimension d = getSize ();
            buffer = createImage (d.width, d.height);
            bufferg = buffer.getGraphics ();
            start = new Button ("Start");
            start.setBackground (Color.yellow);
            add (start);
            slo = new Button ("Slow");
            slo.setBackground (Color.yellow);
            add (slo);
            med = new Button ("Medium");
            med.setBackground (Color.yellow);
            add (med);
            fas = new Button ("Fast");
            fas.setBackground (Color.yellow);
            add (fas);
            stop = new Button ("Stop");
            stop.setBackground (Color.yellow);
            add (stop);
            CARu = getImage (getCodeBase (), "carUP.jpg");
            CARd = getImage (getCodeBase (), "carDOWN.jpg");
            CARl = getImage (getCodeBase (), "carLEFT.jpg");
            CARr = getImage (getCodeBase (), "carRIGHT.jpg");
            bakg = getImage (getCodeBase (), "bakg.jpg");
        public boolean action (Event e, Object o)
            if (e.target == start)
                beg = true;
                test.loop ();
                intro.play ();
            if (e.target == slo)
                slow = true;
                medi = false;
                fast = false;
            if (e.target == med)
                slow = false;
                medi = true;
                fast = false;
            if (e.target == fas)
                slow = false;
                medi = false;
                fast = true;
            if (e.target == stop)
                beg = false;
                slow = false;
                medi = false;
                fast = false;
                counter = 0;
                x = 50;
                y = d.height - 50;
            return true;
        public void start ()
            if (t == null)
                t = new Thread (this);
                t.start ();
        public void stop ()
            if (t != null)
                t.stop ();
                t = null;
        public boolean keyDown (Event e, int key)
            if (key == 's')
                intro.stop ();
            return true;
        public void run ()
            while (true)
                //Thread sleeps for 15 milliseconds here
                try
                    t.sleep (15);
                catch (Exception e)
                Dimension d = getSize ();
                bufferg.setColor (Color.green);
                bufferg.fillRect (0, 0, d.width, d.height);
                // (d.width-50) ((d.height/3) -50)
                bufferg.drawImage (bakg, 0, 0, this);
                bufferg.setColor (Color.red);
                xchange = 0;
                ychange = 0;
                if (beg == true)
                    if (x <= (d.width - 50) && y >= (d.height - 50))
                        xchange = 1;
                        if (slow == true)
                            ychange = 1;
                            xchange = 1;
                        if (medi == true)
                            ychange = 2;
                            xchange = 2;
                        if (fast == true)
                            ychange = 6;
                            xchange = 6;
                        bufferg.fillOval (x, d.height - 50, 50, 50);
                        //bufferg.drawImage (car_r, x, 300, this);
                        x += xchange;
                    if (x >= (d.width - 50) && y >= ((d.height / 3) - 50))
                        ychange = 1;
                        if (slow == true)
                            ychange = 1;
                            xchange = 1;
                        if (medi == true)
                            ychange = 2;
                            xchange = 2;
                        if (fast == true)
                            ychange = 6;
                            xchange = 6;
                        bufferg.fillOval ((d.width - 50), y, 50, 50);
                        // bufferg.drawImage (car_u, 350, y, this);
                        y -= ychange;
                    if (y <= ((d.height / 3) - 50) && x >= 50)
                        xchange = 1;
                        if (slow == true)
                            ychange = 1;
                            xchange = 1;
                        if (medi == true)
                            ychange = 2;
                            xchange = 2;
                        if (fast == true)
                            ychange = 6;
                            xchange = 6;
                        bufferg.fillOval (x, ((d.height / 3) - 50), 50, 50);
                        //bufferg.drawImage (car_l, x, 115, this);
                        x -= xchange;
                    if (x <= 50 && y <= (d.height - 50))
                        ychange = 1;
                        if (slow == true)
                            ychange = 1;
                            xchange = 1;
                        if (medi == true)
                            ychange = 2;
                            xchange = 2;
                        if (fast == true)
                            ychange = 6;
                            xchange = 6;
                        bufferg.fillOval (50, y, 50, 50);
                        //bufferg.drawImage (car_d, 50, y, this);
                        y += ychange;
                    if ((x <= 50) && (y <= (d.width - 50)) && (x <= (d.width - 50)) && (y >= (d.height - 50)))
                        counter++;
                else
                { //bufferg.drawImage (car_r, 50, 300, this);
                    x = 50;
                    y = d.height - 50;
                    bufferg.fillOval (x, y, 50, 50);
                repaint ();
        public void update (Graphics g)
            paint (g);
        public void paint (Graphics g)
            bufferg.setColor (Color.red);
            f = new Font ("Test", Font.BOLD, 25);
            bufferg.setFont (f);
            bufferg.setColor (Color.blue);
            bufferg.drawString ("Lap " + counter, 300, 300);
            g.drawImage (buffer, 0, 0, this);
        } // paint method
    } // Race classCan anyone help me please?

    here's a stripped down bounded sprite engine. use the arrows keys. up=accelerate forward. down=accelerate backwards. left=turn left. right=turn right. supply a 32x32 image named "image.jpg" (or write your filename in the code below) to see the picture rotate as it corners. otherwise, you'll just see non rotating colored squares which represent the bounding box of the image. the variable turns is the number of images you will have on the screen at a time. i should have chosen a better variable name.
    import java.awt.*;
    import java.util.*;
    import java.applet.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.awt.image.*;
    import java.net.*;
    import java.io.*;
    public class SpriteEngine extends Applet implements Runnable, KeyListener{
         Graphics2D dbg;
         Image dbImage;
         public int gameSpeed = 100;
         public int turns = 10;
         Thread th;
         boolean forward=false, reverse=false, left=false,right=false;
         Sprite[] sprite = new Sprite[turns];
         public void init(){
              setSize(500,500);
              setBackground(Color.black);
              addKeyListener(this);
              Image image = getImage(getCodeBase(),"image.jpg");
              for(int a=0;a<turns;a++){
                   sprite[a]=new Sprite(image, new Color((int)(Math.random()*255),(int)(Math.random()*255),(int)(Math.random()*255)), new Point((int)(Math.random()*500),(int)(Math.random()*500)), Math.random()*360,Math.random()*12-6);
         public void start (){
              th = new Thread (this);
              th.start ();
         public void run ()     {
              Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
              while (true){
                   checkControls();
                   for(int i=0;i<turns;i++){
                        sprite.move();
                   repaint();
                   try     {
                        th.sleep (gameSpeed);
                   }catch (InterruptedException ex){
         public void paint (Graphics2D g)     {
              for(int a=0;a<turns;a++){
                   sprite[a].draw(g);
                   g.setColor(Color.black);
         public void update (Graphics g)     {
              if (dbImage == null){
                   dbImage = createImage (this.getSize().width, this.getSize().height);
                   dbg = (Graphics2D)dbImage.getGraphics();
              dbg.setColor (getBackground ());
              dbg.fillRect (0, 0, this.getSize().width, this.getSize().height);
              dbg.setColor (getForeground());
              paint (dbg);
              g.drawImage (dbImage, 0, 0, this);
         public void keyPressed(KeyEvent e) {
              if (e.getKeyCode()==38){forward=true;}else
              if (e.getKeyCode()==40){reverse=true;}else
              if (e.getKeyCode()==37){left=true;   }else
              if (e.getKeyCode()==39){right=true;  }
         public void keyReleased(KeyEvent e) {
              if (e.getKeyCode()==38){forward=false;}else
              if (e.getKeyCode()==40){reverse=false;}else
              if (e.getKeyCode()==37){left=false;   }else
              if (e.getKeyCode()==39){right=false;  }
         public void keyTyped(KeyEvent e) {}
         public void checkControls(){
              for(int a=0;a<turns;a++){
                   if (forward){sprite[a].accel() ;}
                   if (reverse){sprite[a].deccel() ;}
                   if (left) {sprite[a].turnLeft() ;}
                   if (right) {sprite[a].turnRight();}
    class Sprite extends Object {
         private Image image;
         AffineTransform imageLocation=new AffineTransform();
         double velocity;
         Rectangle bounds;
         Rectangle refShape=new Rectangle(32,32);
         double MaxSpeed=6;
         double AccelRate=.3;
         public double Rotation=6;
         double posX,posY,angle;
         Color boxColor;
         public boolean keyDown = false;
         double dx,dy;
         public Sprite(Image img, Color color, Point location, double ang, double speed){
              posX=location.x;          posY=location.y;          boxColor = color;
              image=img;                    velocity=speed;               angle=ang;
              bounds=new Rectangle((int)posX,(int)posY,32,32);
         public void draw(Graphics2D g){
              g.setColor(boxColor);
              g.fill((bounds));
              g.setColor(Color.black);
              g.drawImage(image,imageLocation,null); //this draws your image with the AffineTranform applied
         public void setLocation(Point point) {posX=point.x; posY=point.y; }
         public Point getLocation() {return bounds.getLocation();}
         public void setBounds(Rectangle rect){bounds=rect;                }
         public Rectangle getBounds() {return bounds;              }
         public void setSpeed(double speed) {velocity=speed;                 }
         public double getSpeed() {return velocity;            }
         public void setAngle(double theta) {angle=theta;                }
         public double getAngle() {return angle;               }
         public void turnLeft() {angle=angle-Rotation;       }
         public void turnRight() {angle=angle+Rotation;       }
         public AffineTransform getForm() {return imageLocation;          }
         public void setForm(AffineTransform xform){                       }
         public void accel(){if(velocity<MaxSpeed){velocity=velocity+AccelRate;}}
         public void deccel(){if(velocity> -MaxSpeed){velocity=velocity-AccelRate;}}
         public void move(){
              dx=Math.cos(Math.toRadians(angle))*velocity;
              dy=Math.sin(Math.toRadians(angle))*velocity;
              posX=posX+dx;
              posY=posY+dy;
              imageLocation=AffineTransform.getTranslateInstance(posX,posY); //these two line set the affinetransform
              imageLocation.rotate(Math.toRadians(angle)+Math.PI/2,16,16); //to the right place and angle.
              bounds.setLocation((int)posX,(int)posY);
              if(!keyDown){
                   if (velocity<0){
                        velocity=velocity+.15; // -drag
                   }else if (velocity>0){
                        velocity=velocity - 0.15; // +drag

  • Trying to understand object oriented programming

    Hi all,
    I'm new to programming and I'm trying to learn C and Objective-C to eventually write an iPhone/iPad app.
    I want to make sure I'm understanding some fundamental Object Oriented principles and so I'm starting with a very basic program.
    I've produced a class called CartesianPoint which has an x and y variable plus methods to set and return these variables and also a method to calculate the magnitude from the origin.
    What I would like to do now is to extend the program to have a CartesianVector class.
    I'm a little unsure as to whether a Vector is a subclass of a Point or whether a Point is a subclass of a Vector... or neither?
    Secondly, I'm a little unsure of how to implement the vector class to use two point objects. How should the header and implementation files be set up to receive point objects from the main.m program?
    I'd like to also try and extend the program to include other ways of defining a vector (i.e. origin, unity vector and magnitude).... and then use the vectors to build 2D shapes.
    Many thanks,
    Glyn
    Message was edited by: GlynC
    Message was edited by: GlynC

    Hi Glyn -
    I agree with William and would vote for "neither". I see a subclass as a specialization of its superclass, not, for example, something contained by its superclass. A container relationship might apply to a subview and its superview, yet the class of the superview could be a specialization of the subview's class so the subview's class might be the parent of the superview's class. The classic example of cat as a subclass of animal (cat:animal) can be misleading if we see the relationship as member:group. Cat is a subclass of animal because it's a specialization.
    Also ask, "What's accomplished by making a subclass"? Does the subclass want to use all or most of the parent's instance variables and methods? Could the job be done any other way? Are any of those ways simpler or do they lead to more reusable code?
    One of the best examples (from the Cocoa docs?) is about a programmer who needs a specialized array. A newbie might immediately attempt a subclass of NSArray (a rather tricky subclassing job as it happens). In most cases however, the correct solution would be a class which includes an NSArray* type instance variable.
    Hope some of the above is helpful!
    \- Ray

  • Trying to create object of a class within servlet - help!!

    I have created and compiled the following classes within
    C:\bea\wlserver6.1\config\mydomain\applications\DefaultWebApp\WEB-INF\classes
    1)LoginServlet
    2)LoginManager
    3)I have LoginServlet trying to create an object of type LoginManager, very simple,
    but I get the following errors:
    Cannot resolve symbol: LoginManager lm = new LoginManager();
    ^
    Cannot resolve symbol: LoginManager lm = new LoginManager();
    ^
    4)I have the .java and .class files located within the same directory, so I don't
    see what's wrong here??? HELP!
    LoginManager looks like:
    public class LoginManager {
    public boolean authenticateUser(String username, String password){
              boolean status = false;
    //simple code for string matching
              return status;
    LoginServlet looks like:
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    public class LoginServlet extends HttpServlet {
         // Constructors
         // Variables
         public static final String CONTENT_TYPE = "text/html";
         public boolean LOGIN_STATUS;
         // Methods
         public void service (HttpServletRequest req, HttpServletResponse res)
              throws IOException {
              String username = "";
              String password = "";
              LoginManager lm = new LoginManager();
              username = req.getParameter("username");
              password = req.getParameter("password");
              LOGIN_STATUS = lm.authenticateUser(username, password);
              res.setContentType(CONTENT_TYPE);
              PrintWriter out = res.getWriter();
              out.println("<html><head><title>Hello World</title></head>" +
                             "<body>Hello! Your login status is " + LOGIN_STATUS +
                             "</body>" +
                             "</html>");
         public void init (ServletConfig config) throws ServletException {
              super.init(config);

    Do you have . in the CLASSPATH when compiling your servlet?
    ron <[email protected]> wrote:
    I have created and compiled the following classes within
    C:\bea\wlserver6.1\config\mydomain\applications\DefaultWebApp\WEB-INF\classes
    1)LoginServlet
    2)LoginManager
    3)I have LoginServlet trying to create an object of type LoginManager, very simple,
    but I get the following errors:
    Cannot resolve symbol: LoginManager lm = new LoginManager();
    ^
    Cannot resolve symbol: LoginManager lm = new LoginManager();
    ^
    4)I have the .java and .class files located within the same directory, so I don't
    see what's wrong here??? HELP!
    LoginManager looks like:
    public class LoginManager {
    public boolean authenticateUser(String username, String password){
              boolean status = false;
    //simple code for string matching
              return status;
    LoginServlet looks like:
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    public class LoginServlet extends HttpServlet {
         // Constructors
         // Variables
         public static final String CONTENT_TYPE = "text/html";
         public boolean LOGIN_STATUS;
         // Methods
         public void service (HttpServletRequest req, HttpServletResponse res)
              throws IOException {
              String username = "";
              String password = "";
              LoginManager lm = new LoginManager();
              username = req.getParameter("username");
              password = req.getParameter("password");
              LOGIN_STATUS = lm.authenticateUser(username, password);
              res.setContentType(CONTENT_TYPE);
              PrintWriter out = res.getWriter();
              out.println("<html><head><title>Hello World</title></head>" +
                             "<body>Hello! Your login status is " + LOGIN_STATUS +
                             "</body>" +
                             "</html>");
         public void init (ServletConfig config) throws ServletException {
              super.init(config);
    Dimitri

Maybe you are looking for

  • Wrong drive appears in Target mode

    Hey guys. I know this is probably something very simple, but I'm trying to restore the drive on my G4. I've previously carbon copied my drive to an extra drive in my G5, as I regularly get weird cache problems on my G4. Now that it's happened again,

  • How to capture bardana, shrinkage ,shortage & wastage

    hi gurus , pl help me on this below  underlined issues: Wastage. This is the value addition part. i.e. cleaning the material and picking out unwanted material from the recd quality to arrive at u2018 to be packedu2019 quality.  This is measurable and

  • New session created with every page request

    Hi, I have an application running in portal framset. A user logins into a portal and has access to several applications, that are displayed in a frameset. My application is creating a new session for every page in the application. Of course, I can't

  • ORACLE FORM HELP

    Hello all I am pretty new to Oracle and I am wondering how do you edit the form layout in 9i. I mean, the default toolbar and color scheme etc. Where are the properties for this? Thanks M

  • Search Engine Reading of PDF files

    New to PDF, so please bear with my question How do the search engines read PDF with no meta tags, and subsequently get posted on the search engines?