Object Performace Problems

In order to model a situation I need an object type to hold a table of objects of the enclosing type. In order to accomplish this I did the following (using 11.2.0.1 running on Windows 64-bit):
<li>declared a base type without the table of objects
<li>declared the table type to be a table of the base types
<li>declared the a sub-type of the base type that includes a member of the table type, as well as the functions and procedures I need.
This works fine. Because the table actually holds instances of the sub-type I have to use the treat function to cast table elements to the correct type, but this is not a problem.
The problem arises when I create constructor functions to allow me to not have to specify every data member when creating an instance of the sub-type. When the constructor includes a table instance as a parameter – which must be assigned to the member in the constructor – the performance degrades dramatically over calling the default constructor if the constructor is called multiple times.
I have distilled this down to a simple type with three members, two of which are declared in the base type, with the table member declared in the sub-type, as shown below.
h2. Type Definitions
-- base type --
create type base_t as object(
   text varchar2(16),
   val  int
) not final;
-- table type (of base type) --
create type table_t as table of base_t;
-- sub type specification --
create type sub_t under base_t(
   items table_t,
   constructor function sub_t(
      p_text  in varchar2)
      return self as result,
   constructor function sub_t(
      p_text  in varchar2,
      p_items in table_t)
      return self as result,
   member procedure output_text(
      p_level in pls_integer default 0)
-- sub type body --
create type body sub_t as
   constructor function sub_t(
      p_text  in varchar2)
      return self as result
   is
   begin
      self.text := p_text;
      return;
   end sub_t;
   constructor function sub_t(
      p_text  in varchar2,
      p_items in table_t)
      return self as result
   is
   begin
      self.text  := p_text;
      self.items := p_items;
      return;
   end sub_t;
   member procedure output_text(
      p_level in pls_integer default 0)
   is
      prefix varchar2(32767);
      sub    sub_t;
   begin
      for i in 1..p_level loop
         prefix := prefix || '  ';
      end loop;
      dbms_output.put_line(prefix || self.text);
      if self.items is not null then
         for i in 1..self.items.count loop
            sub := treat(items(i) as sub_t);
            sub.output_text(p_level + 1);
         end loop;
      end if;
   end;
end;I have also built a little testing routine that creates an object of the base_t type (with nested objects of the same type in the table member) in a loop, as shown below:
h2. Testing Routine
declare
   type timestamps_t is table of timestamp;
   ts1   timestamps_t := timestamps_t();
   ts2   timestamps_t := timestamps_t();
   obj   sub_t;
   dflt  boolean := true;
   times pls_integer := 10000;  
begin
   -- setup --
   ts1.extend(times);
   ts2.extend(times);
   -- iterate --
   for i in 1..times loop
      ts1(i) := systimestamp;
      if dflt then
         -- call default constructor --
         obj :=
            sub_t('1', null, table_t(
               sub_t('A'),
               sub_t('B', null, table_t(
                  sub_t('i', null, table_t(sub_t('a'))),
                  sub_t('ii'))),
               sub_t('C')));
      else
         -- call user-defined constructor --
         obj :=
            sub_t('1', table_t(
               sub_t('A'),
               sub_t('B', table_t(
                  sub_t('i', table_t(sub_t('a'))),
                  sub_t('ii'))),
               sub_t('C')));
      end if;
      ts2(i) := systimestamp;
   end loop;
   -- output timing --
   if times < 10 then
      for i in 1..times loop
         dbms_output.put_line('time '||i||' : '||(ts2(i) - ts1(i)));
      end loop;
   end if;
   dbms_output.put_line('total  : '||(ts2(times) - ts1(1)));
   -- output data --
   obj.output_text;     
end;When I execute the test routine as shown (with dflt = true and times = 10000) I get the following output (281 milliseconds to construct 10000 objects using the default constructor, with the expected contents displayed correctly):
h2. Output using Default Constructor (10000 times)
total  : +000000000 00:00:00.281000000
1
  A
  B
    i
      a
    ii
  C However, when I set dflt = false and set times = 7 I get the following output. The expected contents are still display correctly, but it takes over *4-1/2 seconds* to create just seven objects, but notice the geometric growth in time over each iteration. If I increase the number of iterations to 8, the routine eats the system and never returns!
h2. Output using User-Defined Constructor (7 times)
time 1 : +000000000 00:00:00.000000000
time 2 : +000000000 00:00:00.000000000
time 3 : +000000000 00:00:00.015000000
time 4 : +000000000 00:00:00.016000000
time 5 : +000000000 00:00:00.141000000
time 6 : +000000000 00:00:00.734000000
time 7 : +000000000 00:00:03.703000000
total  : +000000000 00:00:04.609000000
1
  A
  B
    i
      a
    ii
  CWhat gives? How can I use a custom constructor and at least approach the performance of using the default constructor? I have run the hierarchical profiler, which indicates the time is being consumed in the 2-parameter constructor.

You have prepared a wonderful reproducable case, which I would use in a service request for Oracle support.
You probably won't find many 'experts' on this forum that are experienced in the OO-features of PL/SQL. You might try the Objects forum: Objects . Allthough that forum does not seem to be very 'active'...

Similar Messages

  • Performace problem

    Someone please help me. I am sufferring performace problem for my code down below. Highly appraciate if anyone can help me optimize it. It took 4.7 hour to run 150,000 records for 5 runs.
    * <p>Title: COllaborative REcommender for SEARCH</p>
    * <p>Description: Collaborative recommendation for user by clustering user queries in a community</p>
    * <p>Copyright: Copyright (c) 2003</p>
    * <p>Company: </p>
    * @author Chan Soe Win, Nyein
    * @version 1.0.executeQuery(sql);
    import java.sql.*;
    import java.io.*;
    import java.util.*;
    import java.util.StringTokenizer;
    import java.math.*;
    public class ClusterGene {
    static String DBUrl = "jdbc:mysql://localhost/corec";
    static Connection Conn = null;
    static Statement Stmt = null;
    static PreparedStatement getDt = null;
    static PreparedStatement countCluster = null;
    static PreparedStatement insCenter = null;
    static PreparedStatement updCenter = null;
    static PreparedStatement insCluster = null;
    static PreparedStatement selectCenter=null;
    static PreparedStatement countClusterMember = null;
    static PreparedStatement getClusterMember = null;
    static PreparedStatement redefCluster = null;
    static int lastClusterID;
    public ClusterGene(){
    try{
    Class.forName("com.mysql.jdbc.Driver").newInstance();
    Conn = DriverManager.getConnection(DBUrl);
    Conn.setAutoCommit(true);
    Stmt = Conn.createStatement();
    getDt = Conn.prepareStatement("SELECT Dt FROM tbl_url WHERE id=? AND type=?");
    countCluster = Conn.prepareStatement("SELECT DISTINCT cluster_id FROM tbl_center");
    insCenter = Conn.prepareStatement("INSERT INTO tbl_center(cluster_id, url_id,type_id,lf) VALUES(?,?,?,?)");
    insCluster = Conn.prepareStatement("INSERT INTO tbl_cluster(cluster_id,query_id,sim_query,sim_title,sim_snippet,sim_result,sim_outlink,sim_inlink) VALUES (?,?,?,?,?,?,?,?)");
    updCenter = Conn.prepareStatement("UPDATE tbl_center SET lf=? WHERE cluster_id=? AND url_id=? AND type_id=?");
    selectCenter = Conn.prepareStatement("SELECT url_id, type_id,lf FROM tbl_center WHERE cluster_id=? AND url_id=? AND type_id=?");
    countClusterMember= Conn.prepareStatement("SELECT count(DISTINCT(query_id)) FROM tbl_cluster WHERE cluster_id=?");
    getClusterMember = Conn.prepareStatement("SELECT url_id,type_id,lf FROM tbl_lf WHERE query_id=?");
    redefCluster = Conn.prepareStatement("UPDATE tbl_center SET lf=? WHERE cluster_id=?");
    }catch (Exception e){
    public static void main (String args[]){
    ClusterGene cluster = new ClusterGene();
    int clusterid=0;
    double currentlf=0.0;
    int termid,typeid;
    double lf;
    double sim_content,sim_link,sim_hybrid, sim_query,sim_title,sim_snippet,sim_result,sim_outlink,sim_inlink;
    ArrayList lfidfArray;
    HashMap lfidfmap;
    lfidf lfidf = new lfidf();
    lfidf member = new lfidf();
    lfidf center = new lfidf();
    //ResultSet countClusterRS=null;
    //int countClusterNo=1;
    lfidfArray = new ArrayList();
    lfidfmap = new HashMap();
    double lfsquare1,lfsquare2,lfsquare3,lfsquare4,lfsquare5,lfsquare6,sumq1q2type1,sumq1q2type2,sumq1q2type3,sumq1q2type4,sumq1q2type5,sumq1q2type6 ;
    //select a new lfidfArrayquery
    long totaltimetaken = 0;
    for (int j=0;j<10;j++){
    for (int k=1;k<101;k++){
    long start = System.currentTimeMillis();
    System.out.print(k+",");
    lfsquare1 = 0;
    lfsquare2 = 0;
    lfsquare3 = 0;
    lfsquare4 = 0;
    lfsquare5 = 0;
    lfsquare6 = 0;
    sim_content= 0.0;
    sim_link=0.0;
    sim_hybrid=0.0;
    sim_query =0.0;
    sim_title= 0.0;
    sim_snippet=0.0;
    sim_result=0.0;
    sim_outlink=0.0;
    sim_inlink=0.0;
    try {
    //read a case (a query) from query table with term frequency
    String sql = "SELECT url_id, type_id, lf FROM tbl_lf WHERE query_id="+k;
    //System.out.println(sql);
    ResultSet rs= Stmt.executeQuery(sql);
    //System.out.println("RS "+rs);
    typeid=0;
    lfidfmap = new HashMap();
    while(rs.next())
    lfidf=new lfidf();
    termid = rs.getInt("url_id");
    typeid =rs.getInt("type_id");
    lfidf.query_id = k;
    lfidf.url_id= termid;
    lfidf.type_id= typeid;
    lf = rs.getDouble("lf");
    getDt.setInt(1, termid);
    getDt.setInt(2, typeid);
    ResultSet dtrs = getDt.executeQuery();
    dtrs.next();
    //System.out.println(lf+"DT >>>"+dtrs.getDouble("Dt"));
    lfidf.lfidf = log2(1+lf)*log2(10000/dtrs.getDouble("Dt"));
    Integer key = new Integer(termid);
    //System.out.println("Type >> "+typeid);
    //lfidfArray.add(lfidf);
    lfidfmap.put(key,lfidf);
    //System.out.print("Key "+key+" \tLFIDF :: ");
    //System.out.println(((lfidf) lfidfmap.get(key)).lfidf);
    //System.out.println(typeid);
    if (typeid ==1){
    lfsquare1 += lfidf.lfidf *lfidf.lfidf ;
    //System.out.println("lfsquare1 "+lfsquare1);
    }else if (typeid==2){
    lfsquare2 += lfidf.lfidf *lfidf.lfidf ;
    //System.out.println("lfsquare2 "+lfsquare2);
    }else if (typeid ==3){
    lfsquare3 += lfidf.lfidf *lfidf.lfidf ;
    //System.out.println("lfsquare3 "+lfsquare3);
    } else if (typeid ==4){
    lfsquare4 += lfidf.lfidf *lfidf.lfidf ;
    //System.out.println("lfsquare1 "+lfsquare1);
    }else if (typeid==5){
    lfsquare5 += lfidf.lfidf *lfidf.lfidf ;
    //System.out.println("lfsquare2 "+lfsquare2);
    }else if (typeid ==6){
    lfsquare6 += lfidf.lfidf *lfidf.lfidf ;
    //System.out.println("lfsquare3 "+lfsquare3);
    }// end while(rs.next())
    //compare with all existing cluster centers
    boolean newseed = true;
    try{
    ResultSet clcountrs= countCluster.executeQuery();
    while (clcountrs.next())
    //select a center
    clusterid = clcountrs.getInt("cluster_id");
    lastClusterID = clusterid;
    //select a cluster center
    lfidf clfidf =new lfidf();
    int cltermid,cltypeid;
    double cllf, cllfsquare1,cllfsquare2,cllfsquare3,cllfsquare4,cllfsquare5,cllfsquare6 ,cllfidf;
    sumq1q2type1=0;
    sumq1q2type2=0;
    sumq1q2type3=0;
    sumq1q2type4=0;
    sumq1q2type5=0;
    sumq1q2type6=0;
    cllfsquare1=0;
    cllfsquare2=0;
    cllfsquare3=0;
    cllfsquare4=0;
    cllfsquare5=0;
    cllfsquare6=0;
    try{
    String clqry = "SELECT url_id, type_id,lf FROM tbl_center WHERE cluster_id="+clusterid;
    //System.out.println(clqry);
    ResultSet clrs = Stmt.executeQuery(clqry);
    //System.out.println(clqry);
    //System.out.println(clrs);
    while (clrs.next())
    cltermid= 0;
    cltypeid= 0;
    clfidf =new lfidf();
    cltermid= clrs.getInt("url_id");
    cltypeid= clrs.getInt("type_id");
    cllfidf = clrs.getDouble("lf");
    getDt.setInt(1, cltermid);
    getDt.setInt(2, cltypeid);
    ResultSet cldtrs = getDt.executeQuery();
    cldtrs.next();
    Integer tindex = new Integer(cltermid);
    if(lfidfmap.containsKey(tindex)){
    clfidf = (lfidf) lfidfmap.get(tindex);
    if (!clfidf.equals(null)){
    if ((clfidf.type_id ==1)){
    sumq1q2type1 += cllfidf * clfidf.lfidf;
    cllfsquare1 += cllfidf * cllfidf ;
    if ((clfidf.type_id ==2)){
    sumq1q2type2 += cllfidf * clfidf.lfidf;
    cllfsquare2 += cllfidf * cllfidf ;
    if ((clfidf.type_id ==3)){
    sumq1q2type3 += cllfidf * clfidf.lfidf;
    cllfsquare3 += cllfidf * cllfidf ;
    if ((clfidf.type_id ==4) ){
    sumq1q2type4 += cllfidf * clfidf.lfidf;
    cllfsquare4 += cllfidf * cllfidf ;
    if ((clfidf.type_id ==5)){
    sumq1q2type5 += cllfidf * clfidf.lfidf;
    cllfsquare5 += cllfidf * cllfidf ;
    if ((clfidf.type_id ==6)){
    sumq1q2type6 += cllfidf * clfidf.lfidf;
    cllfsquare6 += cllfidf * cllfidf ;
    }// if (!clfidf.equals(null))
    }catch (Exception e){
    if (cllfsquare1 >0 && lfsquare1>0){
    sim_query = sumq1q2type1/Math.sqrt(cllfsquare1*lfsquare1);
    }else {
    sim_query = 0.0;
    if (cllfsquare2 >0 && lfsquare2>0){
    sim_title = sumq1q2type2/Math.sqrt(cllfsquare2*lfsquare2);
    }else {
    sim_title =0.0;
    if (cllfsquare3 >0 && lfsquare3>0){
    sim_snippet = sumq1q2type3/ Math.sqrt(cllfsquare3*lfsquare3);
    }else {
    sim_snippet=0.0;
    if (cllfsquare4 >0 && lfsquare4>0){
    sim_inlink = sumq1q2type4/ Math.sqrt(cllfsquare4*lfsquare4);
    }else {
    sim_inlink=0.0;
    if (cllfsquare5 >0 && lfsquare5>0){
    sim_outlink = sumq1q2type5/ Math.sqrt(cllfsquare5*lfsquare5);
    }else {
    sim_outlink=0.0;
    if (cllfsquare6 >0 && lfsquare6>0){
    sim_result = sumq1q2type6/ Math.sqrt(cllfsquare6*lfsquare6);
    }else {
    sim_result=0.0;
    sim_content = ((1.0/3.0)* sim_query) +((1.0/3.0) * sim_title)+((1.0/3.0) * sim_snippet);
    sim_link = ((1.0/3.0)* sim_result) +((1.0/3.0) * sim_outlink)+((1.0/3.0) * sim_inlink);
    sim_hybrid =(0.75 * sim_content) + (0.25 *sim_link);
    if (sim_hybrid>0.25){
    newseed = false;
    //insCluster.setInt(1,clusterid);
    //insCluster.setInt(2,k);
    //insCluster.setDouble(3,sim_query);
    //insCluster.setDouble(4,sim_title);
    //insCluster.setDouble(5,sim_snippet);
    //insCluster.setDouble(6,sim_result);
    //insCluster.setDouble(7,sim_outlink);
    //insCluster.setDouble(8,sim_inlink);
    //try{
    //insCluster.executeUpdate();
    //}catch (Exception e){
    //System.out.println("3 >>>>>>"+ (System.currentTimeMillis()-startTime));
    //countClusterMember.setInt(1,clusterid);
    //countClusterRS = countClusterMember.executeQuery();
    //countClusterRS.next();
    //countClusterNo=countClusterRS.getInt(1);
    //System.out.println("Cluster :: "+clusterid);
    //if the number of member change, redefine the cluster center
    //String sqlterm = "SELECT url_id,type_id,lf FROM tbl_lf WHERE query_id="+k;
    // ResultSet rsterm = Stmt.executeQuery(sqlterm);
    for (Iterator f = lfidfmap.keySet().iterator(); f.hasNext();)
    Object key = f.next();
    member = (lfidf) lfidfmap.get(key);
    getDt.setInt(1, member.url_id);
    getDt.setInt(2, member.type_id);
    ResultSet centrs = getDt.executeQuery();
    centrs.next();
    double centerlfidf= log2(1+ member.lfidf)*log2(10000/centrs.getDouble("Dt"));
    selectCenter.setInt(1,clusterid);
    selectCenter.setInt(2, member.url_id);
    selectCenter.setInt(3, member.type_id);
    ResultSet selectRS = selectCenter.executeQuery();
    if (selectRS.next())
    currentlf = selectRS.getDouble("lf")+centerlfidf;
    try{
    updCenter.setDouble(1,currentlf/2);
    updCenter.setInt(2,clusterid);
    updCenter.setInt(3, member.url_id);
    updCenter.setInt(4, member.type_id);
    updCenter.executeUpdate();
    }catch (Exception e){
    }else {
    try{
    insCenter.setInt(1,clusterid);
    insCenter.setInt(2, member.url_id);
    insCenter.setInt(3, member.type_id);
    insCenter.setDouble(4, centerlfidf);
    insCenter.executeUpdate();
    }catch (Exception e){
    }// end of for iterator
    }//end of if (sim_hybrid > 0.1)
    }// end of while (clrs.next())
    //new case does not fit into any of the existing cluster, then it become a new cluster itself
    if (newseed = true){
    String lfsql = "SELECT query_id, url_id,type_id,lf FROM tbl_lf WHERE query_id="+k;
    //System.out.println("New Seed");
    //System.out.println(sql);
    ResultSet lfrs = Stmt.executeQuery(lfsql);
    int count=0;
    double centerlfidf=0.0;
    while (lfrs.next()){
    count++;
    getDt.setInt(1, lfrs.getInt("url_id"));
    getDt.setInt(2, lfrs.getInt("type_id"));
    ResultSet centerrs = getDt.executeQuery();
    centerrs.next();
    centerlfidf= log2(1+ lfrs.getDouble("lf"))*log2(10000/centerrs.getDouble("Dt"));
    if (centerlfidf >0){
    insCenter.setInt(1,k);
    insCenter.setInt(2, lfrs.getInt("url_id"));
    insCenter.setInt(3, lfrs.getInt("type_id"));
    insCenter.setDouble(4, centerlfidf);
    insCenter.execute();
    newseed=false;
    }catch (Exception e){
    }catch(Exception e){
    //System.out.println(k+" takes "+ ((System.currentTimeMillis()-start)/1000) + " seconds ");
    totaltimetaken +=((System.currentTimeMillis()-start)/1000);
    }//end of for loop k
    System.out.println("Total time taken is "+ totaltimetaken +" seconds");
    private static double log2(double d) {
    return Math.log(d)/Math.log(2.0);

    I haven't tried understanding the flow of your program, just giving you database & JDBC tips....
    1. Try creating database indexes for the fields in your SQL where clauses... may help improve querying.
    2. If you've got a huge number of SQL insert statements then you should look at auto-commit.
    By default, the database connection sets "auto-commit" to on.
    So, for every single SQL insert or update, a database commit is performed.
    If you're inserting/updating a huge batch of records, try setting auto-commit to off, then explicitely call
    "commit()" after maybe 50 inserts....
    We got a serious performance gain from that tip recently.
    As mentioned, I didn't look at the flow/logic of your code, just the DB stuff.
    regards,
    Owen

  • JNDI NIS object access problem

    JNDI NIS object access problem:
    Hi all,
    After long fight, i'm now able to connect to my NIS server on my network. the initial context factory is 'com.sun.jndi.nis.NISCtxFactory' and provider url are given and i obtain namingennumeration of items in the NIS directory.
    purpose of my project:
    using ypcat command we can view the services,passwd,host... objects in unix.
    my project requirement is that i shd open this 'services' object in java (using JNDI probably) and shd access its content.
    i'm able to obtain the object and the type of this object is 'NISCtxServices' defined in 'com.sun.jndi.nis.NISCtxFactory' package, but all the classes and methods except some are not public and so im not able to use almost all the methods in this class 'NISCtxServices' .
    Can any one help me in accessing the information inside this object.
    Thanks in advance! and i'm waiting!

    It's because JFrame does not have a public progessbar variable, only your subclass has that.
    //change this
    JFrame frame = new ProgressBarDemo();
    //to this
    ProgressBarDemo frame = new ProgressBarDemo();

  • Issue :  Child view object refresh problem,

    Hi ,
    Child view object refresh problem,
    Detail expaination of problem with DEPT and Emp table:
    I have two pages first.jspx and secound.jspx
    In the First page we are showing one department and All Employee blongs to that department. Employees are shown in table format.
    and i have duplicate button in table--> this will create a duplication record of selected employee by calling application module
    and the control moves to sencound page to show the newly created Employee details.
    From secound form am returning back with some action button to previous page to the same dept , The newly created records are not showing in the table [but the database has newly crated].
    How do i refresh the child view object ?
    Regards,
    Bogi.

    Hi Frank,
    We are creating new record from the AM with help of ADFBC.
    Would like know how to refresh UI Datacollection and AM view objects.. ? i have added vo.executeQuery in AM . But the changes not reflecting in UI,
    Thanks for the reply... am ready to give any other info required,,,

  • XML Document object access problem?

    Hi,
    I have created a servlet,which will call .sh file, which will call java application.........
    this java application is working as a search engine,which will do search in the XML document object...........This is working fine when only one user run this servlet...........But when more than servlet do the same it is not working......... But once first servlet create the Document object,which is main source for serching..........then second servlet will work fine.......same thing with third servlet and so on...... I used the thread.sleep()/synchronize but it is not working...bcoz i am accessing the same application.....Then instead of servlet i tried to run the java application from the Dos prompt..........But i am facing the same problem......So pl guide me bcoz everything is working excluding this..........Becoz this document object creation is taking some time........ i am creating the object shown below
    Document doc =parseXmlFile("Article.xml", false);
    Element docElem = doc.getDocumentElement();
    public static org.w3c.dom.Document parseXmlFile(String filename, boolean validating)
                   try {
         // Create a builder factory
         DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
         factory.setValidating(validating);
         // Create the builder and parse the file
         // org.w3c.dom.Document doc = factory.newDocumentBuilder().parse(filename);
         org.w3c.dom.Document doc = factory.newDocumentBuilder().parse(new File(filename));
         return doc;
    } catch (SAXException e) {
    // A parsing error occurred; the xml input is not valid
    } catch (ParserConfigurationException e) {
    } catch (IOException e) {
    return null;
    }

    Hi,
    This is my Servlet code..............
    package PW.Feed;
    import java.io.*;
    import javax.xml.parsers.*;
    import org.w3c.dom.*;
    import org.xml.sax.*;
    import javax.xml.transform.*;
    import javax.xml.transform.dom.*;
    import javax.xml.transform.stream.StreamResult;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    import java.util.*;
    public class PrintDom extends HttpServlet
         Document doc;
         Element docElem;
         Connection Conn=null;
         Statement stmt=null,stmt1=null;
         ResultSet rs1=null,rs=null;
         PrintWriter out;
         Vector myVector1=new Vector();
         Vector myVector2=new Vector();
         String strSql="";
         public void doGet(HttpServletRequest req,HttpServletResponse res)throws ServletException,IOException
              res.setContentType("text/html");
              out=res.getWriter();
              try
                   String pubtype=req.getParameter("PubType");
                   String pubDate=req.getParameter("PubDate");
                   String toDate=req.getParameter("ToDate");
                   String fromDate=req.getParameter("FromDate");
                   if(pubDate==null)pubDate="2";
                   if(toDate==null)toDate="02/09/2005";
                   if(fromDate==null)fromDate="02/08/2005";
                   Class.forName("org.firebirdsql.jdbc.FBDriver");
                   Conn = DriverManager.getConnection("jdbc:firebirdsql:192.168.0.15/3050:D:/FBDatabases/PW1.GDB","SYSDBA","cohezia");
                   //Conn = DriverManager.getConnection("jdbc:firebirdsql:192.168.0.99/3050:/share/pw1.gdb","SYSDBA","cohezia");
                   stmt = Conn.createStatement( );
                   if(pubDate.equals("2"))
                        strSql="Select sh.ARTICLEID,sh.cuttingsdate,sh.READDATE,sh.headline,sh.SUMMARY,sh.AUTHOR,sh.PAGEFROM,sh.PUB_NAME,sh.READER_NAME,sh.PARENTTITLE,sh.CANMAIL,sh.PUBLICATION_ID,sh.JOURNALIST_ID,sh.ISPDF FROM SCANSHEADER sh,PUBLICATIONS p where sh.publication_id=p.publication_id and sh.readdate>'"+fromDate+"' and sh.readdate<'"+toDate+"' and p.pubtype='"+ pubtype +"' order by sh.ARTICLEID";
                   else
                        strSql="Select sh.ARTICLEID,sh.cuttingsdate,sh.READDATE,sh.headline,sh.SUMMARY,sh.AUTHOR,sh.PAGEFROM,sh.PUB_NAME,sh.READER_NAME,sh.PARENTTITLE,sh.CANMAIL,sh.PUBLICATION_ID,sh.JOURNALIST_ID,sh.ISPDF FROM SCANSHEADER sh,PUBLICATIONS p where sh.publication_id=p.publication_id and sh.cuttingsdate>'"+fromDate+"' and sh.cuttingsdate<'"+toDate+"' and p.pubtype='"+ pubtype +"' order by sh.ARTICLEID";
                   rs=stmt.executeQuery(strSql);
                   DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
                   doc = builder.newDocument();
                   docElem = doc.createElement("RECORDLIST");
                   doc.appendChild(docElem);
                   Element rootElem = doc.createElement("RECORDS");
                   docElem.appendChild(rootElem);
                   String artid="";
                   while(rs.next())
                             Element artElem = doc.createElement("RECORD");
                             if((rs.getString("ARTICLEID")).length()>0)artElem.setAttribute("id",rs.getString("ARTICLEID"));
                             rootElem.appendChild(artElem);
                             Element rootFieldElem = doc.createElement("FIELDS");
                             artElem.appendChild(rootFieldElem);
                             Element eleCuttingDate = doc.createElement("FIELD");
                             rootFieldElem.appendChild(eleCuttingDate);
                             eleCuttingDate.setAttribute("fieldName","CUTTINGSDATE");
                             if((rs.getString("CUTTINGSDATE")).length()>0) eleCuttingDate.appendChild(doc.createTextNode(rs.getString("CUTTINGSDATE")));
                             Element eleReadDate = doc.createElement("FIELD");
                             rootFieldElem.appendChild(eleReadDate);
                             eleReadDate.setAttribute("fieldName","READDATE");
                             if((rs.getString("READDATE")).length()>0) eleReadDate.appendChild(doc.createTextNode(rs.getString("READDATE")));
                             Element eleHeadLine = doc.createElement("FIELD");
                             rootFieldElem.appendChild(eleHeadLine);
                             eleHeadLine.setAttribute("fieldName","HEADLINE");
                             if((rs.getString("HEADLINE")).length()>0) eleHeadLine.appendChild(doc.createTextNode(rs.getString("HEADLINE")));
                             Element eleSummary = doc.createElement("FIELD");
                             rootFieldElem.appendChild(eleSummary);
                             eleSummary.setAttribute("fieldName","SUMMARY");
                             if(rs.getString("SUMMARY")==null){
                                  //out.println("String is null");
                                  else
                                  {eleSummary.appendChild(doc.createTextNode(rs.getString("SUMMARY")));}
                             Element eleAuthor = doc.createElement("FIELD");
                             rootFieldElem.appendChild(eleAuthor);
                             eleAuthor.setAttribute("fieldName","AUTHOR");
                             if((rs.getString("AUTHOR")).length()>0) eleAuthor.appendChild(doc.createTextNode(rs.getString("AUTHOR")));
                             Element elePageFrom = doc.createElement("FIELD");
                             rootFieldElem.appendChild(elePageFrom);
                             elePageFrom.setAttribute("fieldName","PAGEFROM");
                             if((rs.getString("PAGEFROM")).length()>0) elePageFrom.appendChild(doc.createTextNode(rs.getString("PAGEFROM")));
                             Element elePubName = doc.createElement("FIELD");
                             rootFieldElem.appendChild(elePubName);
                             elePubName.setAttribute("fieldName","PUBNAME");
                             if((rs.getString("PUB_NAME")).length()>0) elePubName.appendChild(doc.createTextNode(rs.getString("PUB_NAME")));
                             Element eleReaderName = doc.createElement("FIELD");
                             rootFieldElem.appendChild(eleReaderName);
                             eleReaderName.setAttribute("fieldName","READER NAME");
                             if((rs.getString("READER_NAME")).length()>0) eleReaderName.appendChild(doc.createTextNode(rs.getString("READER_NAME")));
                             Element eleParentTitle = doc.createElement("FIELD");
                             rootFieldElem.appendChild(eleParentTitle);
                             eleParentTitle.setAttribute("fieldName","PARENTTITLE");
                             if((rs.getString("PARENTTITLE")).length()>0)eleParentTitle.appendChild(doc.createTextNode(rs.getString("PARENTTITLE")));
                             Element eleCanMail = doc.createElement("FIELD");
                             rootFieldElem.appendChild(eleCanMail);
                             eleCanMail.setAttribute("fieldName","CANMAIL");
                             if((rs.getString("CANMAIL")).length()>0) eleCanMail.appendChild(doc.createTextNode(rs.getString("CANMAIL")));
                             Element elePublicationID = doc.createElement("FIELD");
                             rootFieldElem.appendChild(elePublicationID);
                             elePublicationID.setAttribute("fieldName","PUBLICATION_ID");
                             if((rs.getString("PUBLICATION_ID")).length()>0) elePublicationID.appendChild(doc.createTextNode(rs.getString("PUBLICATION_ID")));
                             Element eleJournlistID = doc.createElement("FIELD");
                             rootFieldElem.appendChild(eleJournlistID);
                             eleJournlistID.setAttribute("fieldName","JOURNALIST_ID");
                             if((rs.getString("JOURNALIST_ID")).length()>0) eleJournlistID.appendChild(doc.createTextNode(rs.getString("JOURNALIST_ID")));
                             Element eleIspdf = doc.createElement("FIELD");
                             rootFieldElem.appendChild(eleIspdf);
                             eleIspdf.setAttribute("fieldName","ISPDF");
                             if((rs.getString("ISPDF")).length()>0) eleIspdf.appendChild(doc.createTextNode(rs.getString("ISPDF")));
                             Element rootKeyElem=doc.createElement("KEYWORDS_CODES");
                        String[] arrCodes=getKeyCodes(rs.getString("ARTICLEID"));
                        int count1 = myVector1.size();
                        String[] myArray1=new String[count1];
                        myVector1.copyInto(myArray1);
                        int count2 = myVector2.size();
                        String[] myArray2=new String[count2];
                        myVector2.copyInto(myArray2);
                        for(int j=0;j<arrCodes.length;j++)
                             Element eleKeyword= doc.createElement("KEYWORD_CODE");
                             eleKeyword.setAttribute("CodeId",arrCodes[j]);
                             eleKeyword.setAttribute("LongName",myArray1[j]);
                             eleKeyword.setAttribute("CodeType",myArray2[j]);
                             rootKeyElem.appendChild(eleKeyword);
                        artElem.appendChild(rootKeyElem);
                   Source source = new DOMSource(docElem);
                   //File file = new File("/share/PrintDom.xml");
                   StringWriter rw=new StringWriter();
                   Result result = new StreamResult(rw);
                   //Result result = new DOMResult();
                   // Write the DOM document to the file
                   Transformer xformer = TransformerFactory.newInstance().newTransformer();
                   xformer.transform(source, result);
                   out.println(rw);
              catch (ClassNotFoundException e)
                        out.println("Unable to load Driver Class" + e);
                        return;
                        //fileLog.log(e,"PressWatchFrame1.PressWatchFrame1()");
              catch (SQLException se)
                   out.println(se);
              catch (Exception e)
                   out.println(e);
    finally{
                        try{
                             if(Conn!=null) Conn.close();
                        catch(SQLException ignored){}
         public String[] getKeyCodes(String strArticleId)
              Vector myVector=new Vector();
              myVector1.removeAllElements();
              myVector2.removeAllElements();
         try{
              stmt1=Conn.createStatement( );
              //String strSql1="Select codeid FROM SCANSSUBJECT where articleid='"+ strArticleId +"'";
              String strSql1="Select ss.codeid,c.longname,c.codetype FROM SCANSSUBJECT ss,CODES c where ss.codeid=c.codeid and articleid='"+ strArticleId +"'";
              rs1=stmt1.executeQuery(strSql1);
              String strCodes="";
              while(rs1.next())
                   myVector.add(rs1.getString("codeid"));
                   myVector1.add(rs1.getString("longname"));
                   myVector2.add(rs1.getString("codetype"));
              }catch (SQLException se)
                                       out.println(se);
              int count = myVector.size();
              String[] myArray = new String[count];
              myVector.copyInto(myArray);
              return myArray;
    ..................Thanx

  • Array in object overwrite problem

    Hi
    hope you can help me with this as i've already been using too much time solving it myself :)
    I got a Board class which have an ArrayList<ArrayList<Integer>> as attribute. The Board class is controlled from my service class. I need to create a lot of boards which all needs different ArrayList<ArrayList<Integer>> input, so i made a for loop which creates the Boards. The problem is however when i change the variable i used to create the object the values also change inside the object even though the create method have already been called. English isn't my native language so it's a bit hard to explain :) Please ask if there's something you don't understand.
    thanks in advance!
    I made a temporary solution by making a 3d arraylist so i won't have to overwrite any values but thats not rly a good solution as it's starting to give me problems elsewhere.
    the method that creates the boards is Service.importCSV()
    model.Board
    package model;
    import java.util.ArrayList;
    public class Board {
         private String controleNumber;
         private ArrayList<ArrayList<Integer>> numbers = new ArrayList<ArrayList<Integer>>();
         private ArrayList<ArrayList<Integer>> remainingNumbers = new ArrayList<ArrayList<Integer>>();
         public Board(String controlenumber, ArrayList<ArrayList<Integer>> numbers) {
              this.controleNumber = controlenumber;
              this.numbers = numbers;
              this.remainingNumbers = numbers;
         public String getControlenumber() {
              return controleNumber;
         public void setControlenumber(String controleNumber) {
              this.controleNumber = controleNumber;
         public ArrayList<ArrayList<Integer>> getNumbers() {
              return numbers;
         public void setNumbers(ArrayList<ArrayList<Integer>> numbers) {
              this.numbers = numbers;
         public void setRemainingNumbers(ArrayList<ArrayList<Integer>> remainingNumbers) {
              this.remainingNumbers = remainingNumbers;
         public ArrayList<ArrayList<Integer>> getRemainingNumbers() {
              return remainingNumbers;
         public String toString() {
              return String.valueOf(controleNumber);
    }service.Service
    package service;
    import gui.MainFrame;
    import java.io.BufferedInputStream;
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.util.ArrayList;
    import java.util.List;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import ramdao.BoardDao;
    import model.Board;
    public class Service {
         private static ArrayList<Integer> numbers = new ArrayList<Integer>();
         public static List<Board> getAllBoards() {
              return BoardDao.getAllBoards();
         public static Board createBoard(String controleNumber, ArrayList<ArrayList<Integer>> numbers) {
              Board board = new Board(controleNumber, numbers);
              BoardDao.store(board);
              return board;
         public static void deleteBoard(Board board) {
              BoardDao.remove(board);
         public static Board checkFor(int checkFor) {
              for(Board board : getAllBoards()) {
                   System.out.println(board.getRemainingNumbers());
                   for(ArrayList<Integer> row : board.getRemainingNumbers()) {
                        for(int i=0;i<row.size();i++) {
                             if(numbers.contains(row.get(i))) {
                                  row.remove(row.get(i));
                   if(checkFor==1) {
                        for(ArrayList<Integer> row : board.getRemainingNumbers()) {
                             if(row.size()==0) {
                                  return board;
                   else if(checkFor==2) {
                        if(board.getRemainingNumbers().get(0).size()==0 && board.getRemainingNumbers().get(1).size()==0) {
                             return board;
                        else if(board.getRemainingNumbers().get(0).size()==0 && board.getRemainingNumbers().get(2).size()==0) {
                             return board;
                        else if(board.getRemainingNumbers().get(1).size()==0 && board.getRemainingNumbers().get(2).size()==0) {
                             return board;
                   else if(checkFor==3) {
                        if(board.getRemainingNumbers().size()==0) {
                             return board;
                   System.out.println(board.getRemainingNumbers()  );
              return null;
         public static ArrayList<Integer> oneToGo(int rows, ArrayList<Integer> numbers) {
              //TO-DO
              return null;
         public static void importCSV(ArrayList<String> buff) {
              ArrayList<ArrayList<ArrayList<Integer>>> allNumbers = new ArrayList<ArrayList<ArrayList<Integer>>>();
              int line = 0;
              String controleNumber = "";
              String[] splitLine = new String[10];
              for(int i=0;i<buff.size();i++) {
                   //adds the split buff to splitLine
                   for(int q=0;q<buff.get(i).split(";").length;q++) {
                        if(buff.get(i).split(";")[q].equals(""))
                             splitLine[q]="0";
                        else
                             splitLine[q]=buff.get(i).split(";")[q];
                   if(line==0) {
                        allNumbers.add(new ArrayList<ArrayList<Integer>>());
                        ArrayList<Integer> row = new ArrayList<Integer>();
                        allNumbers.get(allNumbers.size()-1).add(row);
                        controleNumber=buff.get(i).split(";")[0];
                        for(int q=buff.get(i).split(";").length;q<10;q++) {
                             splitLine[q]="0";
                        for(int q=0;q<9;q++) {
                             row.add(Integer.valueOf(splitLine[q+1]));
                   else if(line==1) {
                        ArrayList<Integer> row = new ArrayList<Integer>();
                        allNumbers.get(allNumbers.size()-1).add(row);
                        for(int q=buff.get(i).split(";").length;q<9;q++) {
                             splitLine[q]="0";
                        for(int q=0;q<9;q++) {
                             row.add(Integer.valueOf(splitLine[q]));
                   else if(line==2) {
                        ArrayList<Integer> row = new ArrayList<Integer>();
                        allNumbers.get(allNumbers.size()-1).add(row);
                        for(int q=buff.get(i).split(";").length;q<9;q++) {
                             splitLine[q]="0";
                        for(int q=0;q<9;q++) {
                             row.add(Integer.valueOf(splitLine[q]));
                        createBoard(controleNumber, allNumbers.get(allNumbers.size()-1));
                        line=-1;
                   line++;
         public static ArrayList<String> readFile(File file) {
              FileInputStream fileInputStream = null;
              ArrayList<String> buff = new ArrayList<String>();
              String line;
              try {
                   fileInputStream = new FileInputStream(file);
                   BufferedInputStream bufferedInputStream = new BufferedInputStream(fileInputStream);
                   BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(bufferedInputStream));
                   while ((line = bufferedReader.readLine())!= null) {
                        buff.add(line);
              catch (IOException ex) {
                   Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex);
              finally {
                   try {
                        fileInputStream.close();
                   catch (IOException ex) {
                        Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex);
              return buff;
         public static void addNumber(int number) {
              numbers.add(number);
         public static ArrayList<Integer> getNumbers() {
              return numbers;
    }

    Tried the code but it's full of compiletime errors. I changed it a little but still got
    Exception in thread "AWT-EventQueue-0" java.lang.Error: Unresolved compilation problems:
         board cannot be resolved
         row cannot be resolved
         line cannot be resolved
         board cannot be resolved
         board cannot be resolvedwith the following code
    public static void importCSV(ArrayList<String> buff) {
              ArrayList<ArrayList<ArrayList<Integer>>> allNumbers
              = new ArrayList<ArrayList<ArrayList<Integer>>>();
              String[] splitLine = new String[10];
              String controleNumber;
              for(int i=0;i<buff.size();i++) {
                   int line = i % 3;
                   // split the buffer into fields
                   String[] splitBuf = buff.get(i).split(";");
                   int start = 0;
                   if(line==0) { // new board
                        ArrayList<ArrayList<Integer>> board = new ArrayList<ArrayList<Integer>>();
                        controleNumber = splitBuf[0];
                        start = 1;
                   ArrayList<Integer> row = new ArrayList<Integer>();
                   // fill row from the buffer fields...
                   for(int b = start, last = start+9; b < last; b++) {
                        if(b >= splitBuf.length || splitBuf.length() == 0)
                             row.add(0);
                        else
                             row.add(Integer.valueOf(splitBuf[b]));
              }This is my main problem:createBoard(controleNumber, board);
         board.clear();
         row.clear();The board that i created using the createBord method doesn't hold any numbers because i cleared the arrays i used to create it *after* creating it.
    got my software construction teacher to help me today :)
    works!     public static void importCSV(ArrayList<String> buff) {
              ArrayList<ArrayList<Integer>> board = new ArrayList<ArrayList<Integer>>();
              ArrayList<Integer> row = new ArrayList<Integer>();
              String controleNumber = "";
              int line;
              for(int i=0;i<buff.size();i++) {
                   line = i % 3;
                   String[] splitBuf = buff.get(i).split(";");
                   int start = 0;
                   if(line==0) { // new board
                        board = new ArrayList<ArrayList<Integer>>();
                        controleNumber = splitBuf[0];
                        start = 1;
                   row = new ArrayList<Integer>();
                   // fill row from the buffer fields...
                   for(int b = start, last = start+9; b < last; b++) {
                        if(b >= splitBuf.length || splitBuf[b].length() == 0)
                             row.add(0);
                        else
                             row.add(Integer.valueOf(splitBuf[b]));
                   board.add(row);
                   if(line==2) {
                        createBoard(controleNumber, board);
         }Edited by: Briam on Apr 12, 2010 12:37 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • ARRAY object creation problem in Java

    Hi I am encountring when trying to create ARRAY in one case
    while the same code works perfectly in other case.
    The following code works fine:
    Connection con=getConnection();
    String[][] elements = new String[1][2];
    elements[0][0] =new Long(1111).toString();
    elements[0][1] =new Long(2222).toString();
    ArrayDescriptor desc = ArrayDescriptor.createDescriptor("TYPE1",con);
    toReturn = new ARRAY(desc,con,elements);
    The following CODE GIVES ERROR :
    Connection con=getConnection();
    String[] elements = new String[1];
    elements[0] =new Long(1111).toString();
    ArrayDescriptor desc = ArrayDescriptor.createDescriptor("TYPE2",con);
    toReturn = new ARRAY(desc,con,elements);
    Please help.
    FYI :
    type TYPE1 is table of OBJECT : (ID NUMBER, Name VARCHAR2(50));
    type TYPE2 is table of OBJECT : (ID NUMBER);
    I tried to pass array of long ,int etc in case of TYPE2 but with no advantage.

    Hi Lawrence,
    I have checked the system in the correct path only. I am checking in the following path
      System Admnistration -->System Landscape-->then Portal content (on the left hand side)
    What do you mean by consistancy problem ??? Mean while i will check with basis guys Apart from consulting them , As a Ep consultant do i need to check anything???
    please correct me if i am wrong.....

  • Bussiness object serialization problem

    Hi, I have a little problem with serialization, when I want to create xml from Business object. Example:
    MyBoObject obj = new MyBoObject ();
    obj.atr1 = "aaa";
    obj.atr2 = "bbb";
    String xml = DynamicXml.createXmlTextFor(object : obj, topLevelTag : "something");
    display(xml);
    And displayed result is:
    <something>
    <atr2>bbb</atr2>
    </something>
    atr1 is attribute, which is inherited from db table.
    atr2 is atribute, which I created (it is not inherited from db table)
    Whole problem is, that it only serialize atr2 - from some reason it completely ignores atr1 and his value.
    Like I can't serialize attributes, which are inherited from db table.
    But when I created new attribute atr2 in my Business Object (which is not inherited from db table), everything work ok. Where's the problem? I read docs, but found nothing...
    Edited by: user12189610 on Nov 9, 2009 2:42 AM
    Edited by: user12189610 on Nov 9, 2009 2:46 AM

    If you need a simple project that duplicates this problem for customer support, here's where I put one: http://www.4shared.com/file/181611971/d21e9444/_2__DynamicXMLBug.html.
    Have them import the project, start Studio's Engine, login as "test" and start the Workspace. Create a work item instance and then run the work item when it reaches the "Test" activity. When you run the logic, you'll see this displayed:
    <?xml version="1.0" encoding="UTF-8"?>
    <poHeir xmlns="http://bea.com/albpm/DynamicXml/version/2.0">
        <nameForPO>Dan</nameForPO>
    </poHeir>They should note that only the "nameForPO" tag is created by the DynamicXml.createXmlTextFor() method. "nameForPO" is an attribute I manually added to the XML Heir BPM Object. The attributes of the inherited heir (e.g. "poHeir.orderDate" and "poHeir.billTo") are not included as tags in the generated XML even though these attributes have been set in the logic.

  • Creating callable object+ authorization problem

    Hi,
    I am following the tutorial to create the first process (GP). I assigned all designtime specific roles. I can now  create a content package object. But when I try to create the callable object, I come across the following error:
    You are not authorized to start the design time
    What going wrong! A quick reply will be appreciated!
    Mayukh

    I restarted the server. But the problem persists.
    Let me give more details:
    It says :
    YOU CAN
    and then the following list
    Create Action  #
    Create Callable Object #
    Create Process #
    Create Object View
    Create Block #
    Create Content Package Object
    Create Simple Process
    Create Process by Semantics
    The problem is with the ones I marked as # and for the others it works fine.
    I assigned the role : designtime_all and all other roles where the term designtime occurs.
    Namely:
    UME com.sap.caf.eu.gp designtime.businessobject
    UME com.sap.caf.eu.gp designtime.admin
    UME com.sap.caf.eu.gp designtime.process
    UME com.sap.caf.eu.gp designtime.callableobject
    UME com.sap.caf.eu.gp designtime.logicalcriteria
    UME com.sap.caf.eu.gp designtime.businessobject
    UME com.sap.caf.eu.gp designtime.admin
    UME com.sap.caf.eu.gp designtime.process
    UME com.sap.caf.eu.gp designtime.callableobject
    UME com.sap.caf.eu.gp designtime.logicalcriteria
    UME com.sap.caf.eu.gp designtime.translation
    UME com.sap.caf.eu.gp designtime.cpkgobject
    UME com.sap.caf.eu.gp designtime.ertemplate
    UME com.sap.caf.eu.gp designtime.all
    UME sap.com_tclmwebadmin~permissions Applications_Start_Stop
    Phew!
    Mayukh

  • Applet-servlet communication, object serialization, problem

    hi,
    I encountered a problem with tomcat 5.5. Grazing the whole web i didn't find any solution (some guys are having the same problem but they also got no useful hint up to now). The problem is as follows:
    I try to build an applet-servlet communication using serialized objects. In my test scenario i write a serialized standard java object (e.g. a String object) onto the ObjectOutputStream of the applet/test-application (it doesn't matters wheter to use the first or the latter one for test cases) and the doPost method of the servlet reads the object from the ObjectInputStream. That works fine. But if i use customized objects (which should also work fine) the same code produces an classnotfound exception. When i try to read and cast the object:
    TestMessage e = (TestMessage)objin.readObject();
    java.lang.ClassNotFoundException: TestMessage
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1359)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1205)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    ...That seems strange to me, because if i instantiate an object of the same customized class (TestMessage) in the servlet code, the webappclassloader doesn't have any problems loading and handling the class and the code works fine!
    The class is located in the web-inf/classes directory of the application. I've already tried to put the class (with and without the package structure) into the common/classes and server/classes directory, but the exception stays the same (I've also tried to build a jar and put it in the appropriate lib directories).
    I've also tried to catch a Throwable object in order to get information on the cause. But i get a "null" value (the docu says, that this will may be caused by an unknown error).
    I've also inspected the log files intensively. But they gave me no hint. Until now I've spend a lot of time on searching and messing around but i always get this classnotfound exception.
    I hope this is the right place to post this problem and i hope that there is anyone out there who can give me some hint on solving this problem.
    Kindly regards,
    Daniel

    hi, thanks for the reply,
    all my classes are in the web-inf/classes of the web-app and have an appropriate package structure. thus the TestMessage class is inside a package.
    i tried some names for the testclass but it didn't matter. the exception stays the same. I also tried to put the jar in the common/lib but the problem stays.
    Well the problem with loaded classes: As i mentioned in the post above i can instantiate an object of TestMessage in the code without any problems (so the classloader of my webapp should know the class!!)
    only when reading from the objectinputstream the classloader doesn't seem to know the class?? maybe theres a parent classloader resposible for that and doesn't know the class?
    strange behaviour...
    p.s. sending the same object from the servlet to the client works well
    regards
    daniel
    Message was edited by:
    theazazel

  • Object Type Problem

    Hi
    I faced some problems with O8(Release 8.0.5.0.0) object types.
    Look at the following definition:
    CREATE TYPE T_JMJX AS OBJECT( LBNO NUMBER(3),...);
    CREATE TYPE LIST_JMJX AS TABLE of T_JMJX;
    CREATE TABLE JXGC.JMJXJL
    (JMJX LIST_JMJX,...)
    NESTED TABLE JMJX STORE AS N_JMJXJL;
    One day when I opened Schema Manager,I got a shock: TABLE JXGC.JMJXJL
    has four colunms with the same name !!
    name     schema datatype
    JMJX     none LIST_JMJX
    JMJX     none LIST_JMJX
    JMJX     none LIST_JMJX
    JMJX     JXGC LIST_JMJX
    And I query USER_TAB_COLUMNS, it do have 4 records.
    But in SQL*Plus I type 'decs JMJXJL',the column JMJX appears only once.
    Other tables that has object type columns face the same problem.
    This doesn't has any infection on my applications.
    The real problem comes when one day I want to move the user JXGC to an
    other server.
    Export was done successfully but has a curious phenomenon:
    Exporting NJMJXJL(the Nested Table)......19678 Exported
    The number of rows Exported is about four times than the rows it
    should has.
    When Impport goes to the tables that have object type columns ,I got
    the following errors:
    Importing Table JMJXJL ........
    IMP-00009: abnormal end of export file
    Import terminated successfully with warnings.
    Please help me to solve this problem.Thanks a lot!

    Stone,
    You need to go to metalink.oracle.com to file an iTAR on this.
    Regards,
    Geoff
    Hi
    I faced some problems with O8(Release 8.0.5.0.0) object types.
    Look at the following definition:
    CREATE TYPE T_JMJX AS OBJECT( LBNO NUMBER(3),...);
    CREATE TYPE LIST_JMJX AS TABLE of T_JMJX;
    CREATE TABLE JXGC.JMJXJL
    (JMJX LIST_JMJX,...)
    NESTED TABLE JMJX STORE AS N_JMJXJL;
    One day when I opened Schema Manager,I got a shock: TABLE JXGC.JMJXJL
    has four colunms with the same name !!
    name     schema datatype
    JMJX     none LIST_JMJX
    JMJX     none LIST_JMJX
    JMJX     none LIST_JMJX
    JMJX     JXGC LIST_JMJX
    And I query USER_TAB_COLUMNS, it do have 4 records.
    But in SQL*Plus I type 'decs JMJXJL',the column JMJX appears only once.
    Other tables that has object type columns face the same problem.
    This doesn't has any infection on my applications.
    The real problem comes when one day I want to move the user JXGC to an
    other server.
    Export was done successfully but has a curious phenomenon:
    Exporting NJMJXJL(the Nested Table)......19678 Exported
    The number of rows Exported is about four times than the rows it
    should has.
    When Impport goes to the tables that have object type columns ,I got
    the following errors:
    Importing Table JMJXJL ........
    IMP-00009: abnormal end of export file
    Import terminated successfully with warnings.
    Please help me to solve this problem.Thanks a lot!

  • Restrict access with object F_LFA1_BEK - problem with F4 search

    Hello,
    we want to restrict access to some vendor accounts, which can be shown with transaction FK03 for example.
    There is an authorization object F_LFA1_BEK, which can be maintained in the special vendor accounts in field authorization group.
    A user with authorization for vendor account with authorization group ZZZZ in it can see all vendors with authorization group ZZZZ and all vendors with no authorization group. But he can't see vendor accounts with authorization group YYYY. To this point, it's ok.
    If the user uses the F4 search help he is able to see the vendor accounts with authorization group YYYY too. And this is the problem - the user should not see these vendor accounts. With this option user is able to see address data of a vendor account he should not see.
    Is there any possiblity to solve this problem?
    Regards,
    Julia

    I don't know the current status, but this is being looked into generally as it is not only limited to the F4 on LFA/B/M1.
    As you only access the name and some attribute data which you can display, it is not necessarily critical and there is no transaction data involved.
    Good news is that the BAPIs for search help make these same granular checks which you are expecting.
    If I hear something further about these developments I will let you know.
    Cheers,
    Julius

  • View Object Encoding problem

    I'm using Jdeveloper version 11.1.2.1. I have a encoding problem when creating View Object based on a query. This is my query:
    select id, DECODE(id,'11','Индивидуално,'13','Semejno','14','Grupno') naziv
    from ins_type
    where class_id = '14' and id in ('11', '13', '14')
    It is a simple LOV query with cyrilic letters. When I save the ViewObject and re-open it im getting question marks(???????) instead of the cyrilic letters. This only happens in the view object. I dont have other encoding issues when working with cyrilic letters only when im trying to build a View Object based on a query that has cyrilic letters. If i read those values from the database everything is fine
    Thanks,

    Change the encoding of your application to UTF-8 which appears to be sufficient for cyrilic chars. Here is a quick guide on how to do this http://docs.oracle.com/cd/E17984_01/doc.898/e14693/appa_configuring_jdev.htm
    You may also need to update any pages that have encoding explicitly set

  • Repeated object sending problem

    why when you serialize the same reference multiple times after an internal state change does it not update in the sent copy?
    meaning , if i have a Tree object with a height parameter , and i send it with height=50 and then i update the same objects (SAME!!!) height
    to 30 and send it , it will still arive to its destination with 30 .
    Tree t=new Tree(30);
    out.writeObject(t);
    t.setHeight(50);
    out.writeObject(t); ...
    Tree t=(Tree)in.readObject();
    System.out.println(t); //height : 30
    t=(Tree)in.readObject();
    System.out.println(t); //height:30 i think it maybe JVM cache problem that saves the objects fields in order to send it faster in future times .

    ObjectInput/OutputStreams have this functionality to keep and object from being serialized multiple times if the object is reference multiple times in an object graph. If you want to resend and object that you have already sent, and you want your changes to go with it, then you must call:
    ois.reset();

  • System object create problem in EP 7.3 Version.

    Hi Exports,
    i was created system object in sap ep 7.3 but  i got some error please give me solutions...........
    Connection Test for Connectors:
    : Test Details:
    The test consists of the following steps:
    1. Retrieve the default alias of the system
    2. Check the connection to the back-end application using the connector defined in this system object
    Results
    Default alias retrieved successfully
    Connection failed. Make sure user mapping is set correctly and all connection properties are correct.
    Thanks
    Reddy

    Hi,
    System Object is a set of connection properties to represent an external or SAP systems (SAP R3, /CRM/BW) used to retrieve data into portal iViews. We can create a System Object in any one of the three ways
    The system object can be created from either of the following:
    u2022Based on System Template (Template)
    u2022Based on Portal Content      (PAR)
    u2022Coping Existing Systems     (System)
    The Required Steps to Create a System Object in the portal are as :
    1.          System Alias settings
    2.        Connector settings
    3.        ITS settings
    4.        WAS settings
    5.    User Management Settings
    This may help
    http://wiki.sdn.sap.com/wiki/display/EP/HowtoCreateSystemObjectinthePortalforConnectingtoSAPbackend+System
    https://wiki.sdn.sap.com/wiki/display/EP/User+Management
    Forum links:
    SSO problem for system
    Regards,
    Jyothi.
    Edited by: Venkata Naga Jyothi on Dec 14, 2011 9:58 AM
    Edited by: Venkata Naga Jyothi on Dec 14, 2011 10:04 AM

Maybe you are looking for

  • My MacPro was stolen.  How can I retrieve the serial number?

    My 3.5 yr Macbook Pro was stolen and I didn't record the serial number.  I need it for the police.  Who can I contact at Apple to see if they have my number?  I financed the computer through Apple. Is there some kind of internal tracking device in th

  • Caching problem of javascript with servlet

    Hi guys There is a problem of caching with the our project. This project contains two servlets first is getAdServlet and second is richMediaServlet. getadservlet is called thru <script src=""> following is the code: <script LANGUAGE="JAVASCRIPT" src=

  • ITunes music folder organisation

    On my old PC, when I added an MP3 etc to iTunes it would automatically remove it from the folder it was in and add it to my (iTunes?) music folder. For some reason on my new laptop it does not do this, I have tried with the 'copy to itunes folder' op

  • A Way to Tell if a New Doc is Created from an INX?

    Dear all, Is there a way to tell if the newly document created has just been recreated from an INX? I was guessing that IDocument::IsConverted would provide some kind of a clue, but apparently no. Thanks!

  • Odd RAW behaviour

    PS Elements 5.0 Camera Raw 4.1 Core 2 Duo E6600 Windows XP SP2 2GB DDR2 I have the Camera Raw 4.1 plugin and a Fuji S6000fd camera (RAF files). I noticed when I open an RAF file and then for example save it as a TIF or PNG the resolution is different