ArrayList issues

Hello everyone,
I have an arraylist mishap that I can't spot, and at this point I need a second pair of eyes. The offending class "Places" compiles, as do the other classes that include the main method (that's MedievalQuestGame1) and The Wilderness Class. However, when I run the program, calling the GoToPlace() method in Places, an exception is thrown: IndexOutOfBounds: index: 0, size: 0. I'm not sure why it says this. If someone could tell me what I'm overlooking, or what needs to be done differently, it would be most appreciated. Here are the classes (abbreviated for your convenience). The first is the main() method class:
import java.lang.*;
import java.util.*;
public class MedievalQuestGame1{     
     public static void main(String[] args){
          Places1.GoToPlace(0);
}And the second is a class called wilderness the Places class holds an arraylist of, and is suppossed to call methods from:
import java.lang.*;
import java.util.*;
public class Wilderness1{     
     String WildName;
//CLASS CONSTRUCTOR
     public Wilderness1(String name){
          WildName = name;
//GETWILDNAME
     public String getWildName(){
          return WildName;
//INTERFACE
     public void Interface(){
          System.out.println("Wilderness Interace online");     
}import java.lang.*;
import java.util.*;
public class Places1{
     static int i;
     static Object WhatClass = new Object();
     static Wilderness1 WildernessObject = new Wilderness1("happy place");
     static ArrayList<Object> Places = new ArrayList<Object>(1);
//CLASS CONSTRUCTOR
     private Places1(){
          Wilderness1 BoisonBerry_Forest = new Wilderness1("happy place");
          Places.add(BoisonBerry_Forest);
//GOTOPLACE method
     public static void GoToPlace(int n){
          i += n;
          WhatClass = Places.get(i);
          if(WhatClass instanceof Wilderness1){
               //cast Places.get(i) object back to it's correct class
               WildernessObject = (Wilderness1) Places.get(i);
               //all this to call wilderness methods on the former "Object"
               WildernessObject.Interface();

make your class constructor in Places1 public instead of private:
//CLASS CONSTRUCTOR
public Places1 () {
    Wilderness1 BoisonBerry_Forest = new Wilderness1("happy place");
    Places.add(BoisonBerry_Forest);
}then remove the static keyword from GoToPlace:
public void GoToPlace(int n)finally, in your main method call GoToPlace from a created Places1 object, not a static call:
public static void main(String[] args){
    Places1 places = new Places1 ();
    places.GoToPlace (0);
}

Similar Messages

  • Arraylist issue: pass all the arrayList `s object to other arrayList ...

    hi all...i hope somebody could show me some direction on my problem...i want to pass a arraylist `s cd information to an other arraylist
    and save the new arraylist `s object to a file...i try to solve for a long ..pls help...
    import java.text.*;
    import java.util.*;
    import java.io.*;
    public class Demo{
         readOperation theRo = new readOperation();
         errorCheckingOperation theEco = new errorCheckingOperation();
         ArrayList<MusicCd>  MusicCdList;
         private void heading()
              System.out.println("\tTesting read data from console, save to file, reopen that file\t");
         private void readDataFromConsole()
         //private void insertCd()
            MusicCdList = new ArrayList<MusicCd>( ); 
            MusicCd theCd;
            int muiseCdsYearOfRelease;
            int validMuiseCdsYearOfRelease;
            String muiseCdsTitle;
              while(true)
                    String continueInsertCd = "Y";
                   do
                        muiseCdsTitle = theRo.readString("Please enter your CD`s title : ");
                        muiseCdsYearOfRelease = theRo.readInt("Please enter your CD`s year of release : ");
                        validMuiseCdsYearOfRelease = theEco.errorCheckingInteger(muiseCdsYearOfRelease, 1000, 9999);
                        MusicCdList.add(new MusicCd(muiseCdsTitle, validMuiseCdsYearOfRelease));//i try add the cd`s information to the arrayList
                        MusicCdList.trimToSize();
                        //saveToFile(MusicCdList);
                        continueInsertCd = theRo.readString("Do you have another Cd ? (Y/N) : ");
                   }while(continueInsertCd.equals("Y") || continueInsertCd.equals("y") );
                   if(continueInsertCd.equals("N") || continueInsertCd.equals("n"));
                                                    //MusicCdList.add(new MusicCd(muiseCdsTitle, muiseCdsYearOfRelease));                              
                        break;
                      //System.out.println("You `ve an invalid input " + continueInsertCd + " Please enter (Y/N) only!!");
         //i want to pass those information that i just add to the arrayList to file
         //I am going to pass the arraylist that contains my cd`s information to new arraylist "saveitems and save it to a file...
         //i stuck on this problem
         //how do i pass all the arrayList `s object to another arraylist ..pls help
         //it is better show me some example how to solve thx a lot
         private void saveToFile(ArrayList<MusicCd> tempItems)
              ArrayList<MusicCd> saveItems;
              saveItems = new ArrayList<MusicCd>();
              try
                   File f = new File("cdData.txt");
                   FileOutputStream fos = new FileOutputStream(f);
                   ObjectOutputStream oos = new ObjectOutputStream(fos);
                   saveItems.add(ArrayList<MusicCd> tempItems);
                   //items.add("Second item.");
                   //items.add("Third item.");
                   //items.add("Blah Blah.");
                   oos.writeObject(items);
                   oos.close();
              catch (IOException ioe)
                   ioe.printStackTrace();
              try
                   File g = new File("test.fil");
                   FileInputStream fis = new FileInputStream(g);
                   ObjectInputStream ois = new ObjectInputStream(fis);
                   ArrayList<String> stuff = (ArrayList<String>)ois.readObject();
                   for( String s : stuff ) System.out.println(s);
                   ois.close();
              catch (Exception ioe)
                   ioe.printStackTrace();
         public static void main(String[] args)
              Demo one = new Demo();
              one.readDataFromConsole();
              //one.saveToFile();
              //the followring code for better understang
    import java.io.Serializable;
    public class MusicCd implements Serializable
         private String musicCdsTitle;
            private int yearOfRelease;
         public MusicCd()
              musicCdsTitle = "";
              yearOfRelease = 1000;
         public MusicCd(String newMusicCdsTitle, int newYearOfRelease)
              musicCdsTitle = newMusicCdsTitle;
              yearOfRelease = newYearOfRelease;
         public String getTitle()
              return musicCdsTitle;
         public int getYearOfRelease()
              return yearOfRelease;
         public void setTitle(String newMusicCdsTitle)
              musicCdsTitle = newMusicCdsTitle;
         public void setYearOfRelease(int newYearOfRelease)
              yearOfRelease = newYearOfRelease;
         public boolean equalsName(MusicCd otherCd)
              if(otherCd == null)
                   return false;
              else
                   return (musicCdsTitle.equals(otherCd.musicCdsTitle));
         public String toString()
              return("Music Cd`s Title: " + musicCdsTitle + "\t"
                     + "Year of release: " + yearOfRelease + "\t");
         public ArrayList<MusicCd> getMusicCd(ArrayList<MusicCd> tempList)
              return new ArrayList<MusicCd>(ArrayList<MusicCd> tempList);
    import java.util.Scanner;
    import java.util.InputMismatchException;
    import java.util.NoSuchElementException;
    public class errorCheckingOperation
         public int errorCheckingInteger(int checkThing, int lowerBound, int upperBound)
               int aInt = checkThing;
               try
                    while((checkThing < lowerBound ) || (checkThing > upperBound) )
                         throw new Exception("Invaild value....Please enter the value between  " +  lowerBound + " & " +  upperBound );
               catch (Exception e)
                 String message = e.getMessage();
                 System.out.println(message);
               return aInt;
           public int errorCheckingSelectionValue(String userInstruction)
                int validSelectionValue = 0;
                try
                     int selectionValue;
                     Scanner scan = new Scanner(System.in);
                     System.out.print(userInstruction);
                     selectionValue = scan.nextInt();
                     validSelectionValue = errorCheckingInteger(selectionValue , 1, 5);
               catch (NoSuchElementException e)
                   //if no line was found
                   System.out.println("\nNoSuchElementException error occurred (no line was found) " + e);
              catch (IllegalStateException e)
                   // if this scanner is closed
                   System.out.println("\nIllegalStateException error occurred (scanner is closed)" + e);
              return validSelectionValue;
    import java.util.*;
    public class readOperation{
         public String readString(String userInstruction)
              String aString = null;
              try
                         Scanner scan = new Scanner(System.in);
                   System.out.print(userInstruction);
                   aString = scan.nextLine();
              catch (NoSuchElementException e)
                   //if no line was found
                   System.out.println("\nNoSuchElementException error occurred (no line was found) " + e);
              catch (IllegalStateException e)
                   // if this scanner is closed
                   System.out.println("\nIllegalStateException error occurred (scanner is closed)" + e);
              return aString;
         public char readTheFirstChar(String userInstruction)
              char aChar = ' ';
              String strSelection = null;
              try
                   //char charSelection;
                         Scanner scan = new Scanner(System.in);
                   System.out.print(userInstruction);
                   strSelection = scan.next();
                   aChar =  strSelection.charAt(0);
              catch (NoSuchElementException e)
                   //if no line was found
                   System.out.println("\nNoSuchElementException error occurred (no line was found) " + e);
              catch (IllegalStateException e)
                   // if this scanner is closed
                   System.out.println("\nIllegalStateException error occurred (scanner is closed)" + e);
              return aChar;
         public int readInt(String userInstruction) {
              int aInt = 0;
              try {
                   Scanner scan = new Scanner(System.in);
                   System.out.print(userInstruction);
                   aInt = scan.nextInt();
              } catch (InputMismatchException e) {
                   System.out.println("\nInputMismatchException error occurred (the next token does not match the Integer regular expression, or is out of range) " + e);
              } catch (NoSuchElementException e) {
                   System.out.println("\nNoSuchElementException error occurred (input is exhausted)" + e);
              } catch (IllegalStateException e) {
                   System.out.println("\nIllegalStateException error occurred (scanner is closed)" + e);
              return aInt;
    }

    sorry for my not-clear descprtion...thc for your help....i got a problem on store some data to a file ....u can see my from demo..
    Step1: i try to prompt the user to enter his/her cd `s information
    and i pass those cd `s information to an object "MuiscCd" ..and i am going to add this "MuiscCd" to the arrayList " MusicCdList ". i am fine here..
    Step2: and i want to save the object that `s in my arrayList " MusicCdList " to a file....i got stuck here..<_> ..(confused).
    Step3:
    i will reopen the file and print it out..(here i am alright )

  • Issue with xsd Data type mapping for collection of user defined data type

    Hi,
    I am facing a issue with wsdl for xsd mapping for collection of user defined data type.
    Here is the code snippet.
    sample.java
    @WebMethod
    public QueryPageOutput AccountQue(QueryPageInput qpInput)
    public class QueryPageInput implements Serializable, Cloneable
    protected Account_IO fMessage = null;
    public class QueryPageOutput implements Serializable, Cloneable
    protected Account_IO fMessage = null;
    public class Account_IO implements Serializable, Cloneable {
    protected ArrayList <AccountIC> fintObjInst = null;
    public ArrayList<AccountIC>getfintObjInst()
    return (ArrayList<AccountIC>)fintObjInst.clone();
    public void setfintObjInst(AccountIC val)
    fintObjInst = new ArrayList<AccountIC>();
    fintObjInst.add(val);
    Public class AccountIC
    protected String Name;
    protected String Desc;
    public String getName()
    return Name;
    public void setName(String name)
    Name = name;
    For the sample.java code, the wsdl generated is as below:
    <?xml version="1.0" encoding="UTF-8" ?>
    <wsdl:definitions
    name="SimpleService"
    targetNamespace="http://example.org"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:tns="http://example.org"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
    >
    <wsdl:types>
    <xs:schema version="1.0" targetNamespace="http://examples.org" xmlns:ns1="http://example.org/types"
    xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:import namespace="http://example.org/types"/>
    <xs:element name="AccountWSService" type="ns1:accountEMRIO"/>
    </xs:schema>
    <xs:schema version="1.0" targetNamespace="http://example.org/types" xmlns:ns1="http://examples.org"
    xmlns:tns="http://example.org/types" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:import namespace="http://examples.org"/>
    <xs:complexType name="queryPageOutput">
    <xs:sequence>
    <xs:element name="fSiebelMessage" type="tns:accountEMRIO" minOccurs="0"/>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="accountEMRIO">
    <xs:sequence>
    <xs:element name="fIntObjectFormat" type="xs:string" minOccurs="0"/>
    <xs:element name="fMessageType" type="xs:string" minOccurs="0"/>
    <xs:element name="fMessageId" type="xs:string" minOccurs="0"/>
    <xs:element name="fIntObjectName" type="xs:string" minOccurs="0"/>
    <xs:element name="fOutputIntObjectName" type="xs:string" minOccurs="0"/>
    <xs:element name="fintObjInst" type="xs:anyType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="queryPageInput">
    <xs:sequence>
    <xs:element name="fPageSize" type="xs:string" minOccurs="0"/>
    <xs:element name="fSiebelMessage" type="tns:accountEMRIO" minOccurs="0"/>
    <xs:element name="fStartRowNum" type="xs:string" minOccurs="0"/>
    <xs:element name="fViewMode" type="xs:string" minOccurs="0"/>
    </xs:sequence>
    </xs:complexType>
    </xs:schema>
    <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://example.org"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://example.org" xmlns:ns1="http://example.org/types">
    <import namespace="http://example.org/types"/>
    <xsd:complexType name="AccountQue">
    <xsd:sequence>
    <xsd:element name="arg0" type="ns1:queryPageInput"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:element name="AccountQue" type="tns:AccountQue"/>
    <xsd:complexType name="AccountQueResponse">
    <xsd:sequence>
    <xsd:element name="return" type="ns1:queryPageOutput"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:element name="AccountQueResponse" type="tns:AccountQueResponse"/>
    </schema>
    </wsdl:types>
    <wsdl:message name="AccountQueInput">
    <wsdl:part name="parameters" element="tns:AccountQue"/>
    </wsdl:message>
    <wsdl:message name="AccountQueOutput">
    <wsdl:part name="parameters" element="tns:AccountQueResponse"/>
    </wsdl:message>
    <wsdl:portType name="SimpleService">
    <wsdl:operation name="AccountQue">
    <wsdl:input message="tns:AccountQueInput" xmlns:ns1="http://www.w3.org/2006/05/addressing/wsdl"
    ns1:Action=""/>
    <wsdl:output message="tns:AccountQueOutput" xmlns:ns1="http://www.w3.org/2006/05/addressing/wsdl"
    ns1:Action=""/>
    </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="SimpleServiceSoapHttp" type="tns:SimpleService">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="AccountQue">
    <soap:operation soapAction=""/>
    <wsdl:input>
    <soap:body use="literal"/>
    </wsdl:input>
    <wsdl:output>
    <soap:body use="literal"/>
    </wsdl:output>
    </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="SimpleService">
    <wsdl:port name="SimpleServicePort" binding="tns:SimpleServiceSoapHttp">
    <soap:address location="http://localhost:7101/WS-Project1-context-root/SimpleServicePort"/>
    </wsdl:port>
    </wsdl:service>
    </wsdl:definitions>
    In the above wsdl the collection of fintObjInst if of type xs:anytype. From the wsdl, I do not see the xsd mapping for AccountIC which includes Name and Desc. Due to which, when invoking the web service from a different client like c#(by creating proxy business service), I am unable to set the parameters for AccountIC. I am using JAX-WS stack and WLS 10.3. I have already looked at blog http://weblogs.java.net/blog/kohlert/archive/2006/10/jaxws_and_type.html but unable to solve this issue. However, at run time using a tool like SoapUI, when this wsdl is imported, I am able to see all the params related to AccountIC class.
    Can some one help me with this.
    Thanks,
    Sudha.

    Did you try adding the the XmlSeeAlso annotation to the webservice
    @XmlSeeAlso({<package.name>.AccountIC.class})
    This will add the schema for the data type (AccountIC) to the WSDL.
    Hope this helps.
    -Ajay

  • ArrayList() problems

    Hi!
    I need a little help getting an ArrayList to work. I am refactoring some of the classes in one of the O'Reilly books for a class assignment. I believe that I cannot get my ArrayList to add elements into itself. I'm not quite sure what I'm doing wrong. I'll post the code below. The problem arises in the last part of the code (at least I think it does) where i can't get my variable "size" (see the "for loop" below) to be resolved. I have tried initializing the variable at the beginning of the entire class in which case I can get the file to compile to a class. But when I run the class, I still get an ArrayOutOfBounds exception letting me know that my array is still initialized to 1 when i believe that and my index is a larger number (the number I input into the console). the message I get from the command line is:
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    Error:
    java.lang.ArrayIndexOutOfBoundsException: -1
    at java.util.ArrayList.get(ArrayList.java:326)
    at MyFactorial.computeFactorialCacheB(MyFactorial.java:115) // this would be the second line of the "for" loop
    at MyFactorial.main(MyFactorial.java:134)
    Any help would be greatly appreciated. Thanks in advance.
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    Here is my code
         public static synchronized BigInteger computeFactorialCacheB(String s) {
         private static int size;
    ArrayList table = new ArrayList();
              table.add(BigInteger.valueOf(1));
              int x = 0;
              try {
                   x = Integer.parseInt(s);
              catch (NumberFormatException e) {
                   System.out.println("the number you enter must be an integer");
              if (x<0) {
                   throw new IllegalArgumentException("x must not be a negative number");     
              else {
                   for(int size = table.size(); size <= x; size++);{
                        BigInteger lastfact = (BigInteger)table.get(size-1);
                        BigInteger nextfact = lastfact.multiply(BigInteger.valueOf(size));
                        table.add(nextfact);
              return (BigInteger) table.get(size-1);
         }

    Thanks for your reply.
    As I said in my original posting, I am refactoring code from one of the O'Reilly books for an assignment. So no, this isn't all my code, just some of it (copyright is duly noted in my assignment).
    The semicolon was a great cach (thanks!) I truly didn't see it. The issue of the "size" variable is what I am trying to solve. When I originally entered the code int my IDE (eclipse) the first declaration of int size inside the for loop was OK but subsequent references to it (still in the for loop) wouldn't resolve.
         for(int size = table.size(); size <= x; size++){
               BigInteger lastfact = (BigInteger)table.get(size-1);
               BigInteger nextfact = lastfact.multiply(BigInteger.valueOf(size));
                    table.add(nextfact);Hence the experimentation with the "size" variable. The use of the ArrayList was one of the parameters of the assignment. I see what you mean by creating a new list each time. The purpose of the method is to return a factorial (n!) using a BigInteger. This loop is pretty much just as it came out of O'rilley. It seems to work fine in their rendition (I guess that's why they get to write books).
    Tanks so much for your help. I'll refactor again and repost (probably tomorrow).
    � regards!

  • Passing arraylist between constructors?

    Hi guys,
    I've pretty new to java, and I think i'm having a little trouble
    understanding scope. The program I'm working on is building a jtree
    from an xml file, to do this an arraylist (xmlText) is being built and
    declared in the function Main. It's then called to an overloaded
    constructor which processes the XML into a jtree:
    public Editor( String title, ArrayList xmlText ) throws
    ParserConfigurationException
    Later, in the second constructor which builds my GUI, I try and call
    the same arraylist so I can parse this XML into a set of combo boxes,
    but get an error thrown up at me that i'm having a hard time solving- :
    public Editor( String title ) throws ParserConfigurationException
    // additional code
    // Create a read-only combobox- where I get an error.
    String [] items = (String []) xmlText.toArray (new String[
    xmlText.size () ]);
    JComboBox queryBox = new JComboBox(items);
    JComboBox queryBox2 = new JComboBox(items);
    JComboBox queryBox3 = new JComboBox(items);
    JComboBox queryBox4 = new JComboBox(items);
    JComboBox queryBox5 = new JComboBox(items);
    This is the way I understand the Arraylist can be converted to a string
    to use in the combo boxs. However I get an error thrown up at me here
    at about line 206, which as far as I understand, is because when the
    overloaded constructor calls the other constructor:
    public Editor( String title ) throws ParserConfigurationException -
    It does not pass in the variable xmlText.
    I'm told that the compiler complains because xmlText is not defined
    at that point:
    - it is not a global variable or class member
    - it has not been passed into the function
    and
    - it has not been declared inside the current function
    Can anyone think of a solution to this problem? As I say a lot of this
    stuff is still fairly beyond me, I understand the principles behind the
    language and the problem, but the solution has been evading me so far.
    If anyone could give me any help or a solution here I'd be very
    grateful- I'm getting totally stressed over this.
    The code I'm working on is below, I've highlighted where the error
    crops up too- it's about line 200-206 area. Sorry for the length, I was
    unsure as to how much of the code I should post.
    public class Editor extends JFrame implements ActionListener
    // This is the XMLTree object which displays the XML in a JTree
    private XMLTree XMLTree;
    private JTextArea textArea, textArea2, textArea3;
    // One JScrollPane is the container for the JTree, the other is for
    the textArea
    private JScrollPane jScroll, jScrollRt, jScrollUp,
    jScrollBelow;
    private JSplitPane splitPane, splitPane2;
    private JPanel panel;
    // This JButton handles the tree Refresh feature
    private JButton refreshButton;
    // This Listener allows the frame's close button to work properly
    private WindowListener winClosing;
    private JSplitPane splitpane3;
    // Menu Objects
    private JMenuBar menuBar;
    private JMenu fileMenu;
    private JMenuItem newItem, openItem, saveItem,
    exitItem;
    // This JDialog object will be used to allow the user to cancel an exit
    command
    private JDialog verifyDialog;
    // These JLabel objects will be used to display the error messages
    private JLabel question;
    // These JButtons are used with the verifyDialog object
    private JButton okButton, cancelButton;
    private JComboBox testBox;
    // These two constants set the width and height of the frame
    private static final int FRAME_WIDTH = 600;
    private static final int FRAME_HEIGHT = 450;
    * This constructor passes the graphical construction off to the
    overloaded constructor
    * and then handles the processing of the XML text
    public Editor( String title, ArrayList xmlText ) throws
    ParserConfigurationException
    this( title );
    textArea.setText( ( String )xmlText.get( 0 ) + "\n" );
    for ( int i = 1; i < xmlText.size(); i++ )
    textArea.append( ( String )xmlText.get( i ) + "\n" );
    try
    XMLTree.refresh( textArea.getText() );
    catch( Exception ex )
    String message = ex.getMessage();
    System.out.println( message );
    }//end try/catch
    } //end Editor( String title, String xml )
    * This constructor builds a frame containing a JSplitPane, which in
    turn contains two
    JScrollPanes.
    * One of the panes contains an XMLTree object and the other contains
    a JTextArea object.
    public Editor( String title ) throws ParserConfigurationException
    // This builds the JFrame portion of the object
    super( title );
    Toolkit toolkit;
    Dimension dim, minimumSize;
    int screenHeight, screenWidth;
    // Initialize basic layout properties
    setBackground( Color.lightGray );
    getContentPane().setLayout( new BorderLayout() );
    // Set the frame's display to be WIDTH x HEIGHT in the middle of
    the screen
    toolkit = Toolkit.getDefaultToolkit();
    dim = toolkit.getScreenSize();
    screenHeight = dim.height;
    screenWidth = dim.width;
    setBounds( (screenWidth-FRAME_WIDTH)/2,
    (screenHeight-FRAME_HEIGHT)/2, FRAME_WIDTH,
    FRAME_HEIGHT );
    // Build the Menu
    // Build the verify dialog
    // Set the Default Close Operation
    // Create the refresh button object
    // Add the button to the frame
    // Create two JScrollPane objects
    jScroll = new JScrollPane();
    jScrollRt = new JScrollPane();
    // First, create the JTextArea:
    // Create the JTextArea and add it to the right hand JScroll
    textArea = new JTextArea( 200,150 );
    jScrollRt.getViewport().add( textArea );
    // Next, create the XMLTree
    XMLTree = new XMLTree();
    XMLTree.getSelectionModel().setSelectionMode(
    TreeSelectionModel.SINGLE_TREE_SELECTION
    XMLTree.setShowsRootHandles( true );
    // A more advanced version of this tool would allow the JTree to
    be editable
    XMLTree.setEditable( false );
    // Wrap the JTree in a JScroll so that we can scroll it in the
    JSplitPane.
    jScroll.getViewport().add( XMLTree );
    // Create the JSplitPane and add the two JScroll objects
    splitPane = new JSplitPane( JSplitPane.HORIZONTAL_SPLIT, jScroll,
    jScrollRt );
    splitPane.setOneTouchExpandable(true);
    splitPane.setDividerLocation(200);
    jScrollUp = new JScrollPane();
    jScrollBelow=new JScrollPane();
    // Here is were the error is coming up
    String [] items = (String []) xmlText.toArray (new String[
    xmlText.size () ]);
    JComboBox queryBox = new JComboBox(items);
    JComboBox queryBox2 = new JComboBox(items);
    JComboBox queryBox3 = new JComboBox(items);
    JComboBox queryBox4 = new JComboBox(items);
    JComboBox queryBox5 = new JComboBox(items);
    * I'm adding the scroll pane to the split pane,
    * a panel to the top of the split pane, and some uneditible
    combo boxes
    * to them. Then I'll rearrange them to rearrange them, but
    unfortunately am getting an error thrown up above.
    panel = new JPanel();
    panel.add(queryBox);
    panel.add(queryBox2);
    panel.add(queryBox3);
    panel.add(queryBox4);
    panel.add(queryBox5);
    jScrollUp.getViewport().add( panel );
    // Now building a text area
    textArea3 = new JTextArea(200, 150);
    jScrollBelow.getViewport().add( textArea3 );
    splitPane2 = new JSplitPane(JSplitPane.VERTICAL_SPLIT,
    jScrollUp, jScrollBelow);
    splitPane2.setPreferredSize( new Dimension(300, 200) );
    splitPane2.setDividerLocation(100);
    splitPane2.setOneTouchExpandable(true);
    // in here can change the contents of the split pane
    getContentPane().add(splitPane2,BorderLayout.SOUTH);
    // Provide minimum sizes for the two components in the split pane
    minimumSize = new Dimension(200, 150);
    jScroll.setMinimumSize( minimumSize );
    jScrollRt.setMinimumSize( minimumSize );
    // Provide a preferred size for the split pane
    splitPane.setPreferredSize( new Dimension(400, 300) );
    // Add the split pane to the frame
    getContentPane().add( splitPane, BorderLayout.CENTER );
    //Put the final touches to the JFrame object
    validate();
    setVisible(true);
    // Add a WindowListener so that we can close the window
    winClosing = new WindowAdapter()
    public void windowClosing(WindowEvent e)
    verifyDialog.show();
    addWindowListener(winClosing);
    } //end Editor()
    * When a user event occurs, this method is called. If the action
    performed was a click
    * of the "Refresh" button, then the XMLTree object is updated using
    the current XML text
    * contained in the JTextArea
    public void actionPerformed( ActionEvent ae )
    if ( ae.getActionCommand().equals( "Refresh" ) )
    try
    XMLTree.refresh( textArea.getText() );
    catch( Exception ex )
    String message = ex.getMessage();
    ex.printStackTrace();
    }//end try/catch
    else if ( ae.getActionCommand().equals( "OK" ) )
    exit();
    else if ( ae.getActionCommand().equals( "Cancel" ) )
    verifyDialog.hide();
    }//end if/else if
    } //end actionPerformed()
    // Program execution begins here. An XML file (*.xml) must be passed
    into the method
    public static void main( String[] args )
    String fileName = "";
    BufferedReader reader;
    String line;
    ArrayList xmlText = null;
    Editor Editor;
    // Build a Document object based on the specified XML file
    try
    if( args.length > 0 )
    fileName = args[0];
    if ( fileName.substring( fileName.indexOf( '.' ) ).equals(
    ".xml" ) )
    reader = new BufferedReader( new FileReader( fileName )
    xmlText = new ArrayList();
    while ( ( line = reader.readLine() ) != null )
    xmlText.add( line );
    } //end while ( ( line = reader.readLine() ) != null )
    // The file will have to be re-read when the Document
    object is parsed
    reader.close();
    // Construct the GUI components and pass a reference to
    the XML root node
    Editor = new Editor( "Editor 1.0", xmlText );
    else
    help();
    } //end if ( fileName.substring( fileName.indexOf( '.' )
    ).equals( ".xml" ) )
    else
    Editor = new Editor( "Editor 1.0" );
    } //end if( args.length > 0 )
    catch( FileNotFoundException fnfEx )
    System.out.println( fileName + " was not found." );
    exit();
    catch( Exception ex )
    ex.printStackTrace();
    exit();
    }// end try/catch
    }// end main()
    // A common source of operating instructions
    private static void help()
    System.out.println( "\nUsage: java Editor filename.xml" );
    System.exit(0);
    } //end help()
    // A common point of exit
    public static void exit()
    System.out.println( "\nThank you for using Editor 1.0" );
    System.exit(0);
    } //end exit()
    class newMenuHandler implements ActionListener
    public void actionPerformed( ActionEvent ae )
    textArea.setText( "" );
    try
    // Next, create a new XMLTree
    XMLTree = new XMLTree();
    XMLTree.getSelectionModel().setSelectionMode(
    TreeSelectionModel.SINGLE_TREE_SELECTION );
    XMLTree.setShowsRootHandles( true );
    // A more advanced version of this tool would allow the JTree
    to be editable
    XMLTree.setEditable( false );
    catch( Exception ex )
    String message = ex.getMessage();
    ex.printStackTrace();
    }//end try/catch
    }//end actionPerformed()
    }//end class newMenuHandler
    class openMenuHandler implements ActionListener
    JFileChooser jfc;
    Container parent;
    int choice;
    openMenuHandler()
    super();
    jfc = new JFileChooser();
    jfc.setSize( 400,300 );
    jfc.setFileFilter( new XmlFileFilter() );
    parent = openItem.getParent();
    }//end openMenuHandler()
    public void actionPerformed( ActionEvent ae )
    // Displays the jfc and sets the dialog to 'open'
    choice = jfc.showOpenDialog( parent );
    if ( choice == JFileChooser.APPROVE_OPTION )
    String fileName, line;
    BufferedReader reader;
    fileName = jfc.getSelectedFile().getAbsolutePath();
    try
    reader = new BufferedReader( new FileReader( fileName ) );
    textArea.setText( reader.readLine() + "\n" );
    while ( ( line = reader.readLine() ) != null )
    textArea.append( line + "\n" );
    } //end while ( ( line = reader.readLine() ) != null )
    // The file will have to be re-read when the Document
    object is parsed
    reader.close();
    XMLTree.refresh( textArea.getText() );
    catch ( Exception ex )
    String message = ex.getMessage();
    ex.printStackTrace();
    }//end try/catch
    jfc.setCurrentDirectory( new File( fileName ) );
    } //end if ( choice == JFileChooser.APPROVE_OPTION )
    }//end actionPerformed()
    }//end class openMenuHandler
    class saveMenuHandler implements ActionListener
    JFileChooser jfc;
    Container parent;
    int choice;
    saveMenuHandler()
    super();
    jfc = new JFileChooser();
    jfc.setSize( 400,300 );
    jfc.setFileFilter( new XmlFileFilter() );
    parent = saveItem.getParent();
    }//end saveMenuHandler()
    public void actionPerformed( ActionEvent ae )
    // Displays the jfc and sets the dialog to 'save'
    choice = jfc.showSaveDialog( parent );
    if ( choice == JFileChooser.APPROVE_OPTION )
    String fileName;
    File fObj;
    FileWriter writer;
    fileName = jfc.getSelectedFile().getAbsolutePath();
    try
    writer = new FileWriter( fileName );
    textArea.write( writer );
    // The file will have to be re-read when the Document
    object is parsed
    writer.close();
    catch ( IOException ioe )
    ioe.printStackTrace();
    }//end try/catch
    jfc.setCurrentDirectory( new File( fileName ) );
    } //end if ( choice == JFileChooser.APPROVE_OPTION )
    }//end actionPerformed()
    }//end class saveMenuHandler
    class exitMenuHandler implements ActionListener
    public void actionPerformed( ActionEvent ae )
    verifyDialog.show();
    }//end actionPerformed()
    }//end class exitMenuHandler
    class XmlFileFilter extends javax.swing.filechooser.FileFilter
    public boolean accept( File fobj )
    if ( fobj.isDirectory() )
    return true;
    else
    return fobj.getName().endsWith( ".xml" );
    }//end accept()
    public String getDescription()
    return "*.xml";
    }//end getDescription()
    }//end class XmlFileFilter
    } //end class Editor
    Sorry if this post has been a bit lengthy, any help you guys could give
    me solving this would be really appreciated.
    Thanks,
    Iain.

    Hey. Couple pointers:
    When posting, try to keep code inbetween code tags (button between spell check and quote original). It will pretty-print the code.
    Posting code is good. Usually, though, you want to post theminimum amount of code which runs and shows your problem.
    That way people don't have to wade through irrelevant stuff and
    they have an easier time helping.
    http://homepage1.nifty.com/algafield/sscce.html
    As for your problem, this is a scope issue. You declare an
    ArrayList xmlText in main(). That means that everywhere after
    the declaration in main(), you can reference your xmlText.
    So far so good. Then, inside main(), you call
    Editor = new Editor( "Editor 1.0", xmlText );Now you've passed the xmlText variable to a new method,
    Editor(String title, ArrayList xmlText) [which happens to be a
    constructor, but that's not important]. When you do that, you
    make the two variables title and xmlText available to the whole
    Editor(String, ArrayList) method.
    This is where you get messed up. You invoke another method
    from inside Editor(String, ArrayList). When you call
    this(title);you're invoking the method Editor(String title). You aren't passing
    in your arraylist, though. You've got code in the Editor(String) method
    which is trying to reference xmlText, but you'd need to pass in
    your ArrayList in order to do so.
    My suggestion would be to merge the two constructor methods into
    one, Editor(String title, ArrayList xmlText).

  • Issue with web publisher services

    hello,
    i try to use the bi publisher services and in particulary SecurityService(Jdeveloper 11.1.2.0.0 and publisher 11.1.1.5) .
    the security model is setting on Bi publisher security.
    i use the http://bipconsulting.blogspot.com/2010/04/how-to-use-bi-publisher-web-service.html for help
    when i run this code
    package com.oracle.xmlns.oxp.service.v2;
    import java.net.URL;
    import java.util.ArrayList;
    import java.util.List;
    import javax.xml.namespace.QName;
    // This source file is generated by Oracle tools.
    // Contents may be subject to change.
    // For reporting problems, use the following:
    // Generated by Oracle JDeveloper 11g Release 2 11.1.2.0.0.6017
    public class SecurityServiceClient
    public static void main(String [] args)
    try {
    SecurityService_Service securityService_Service = new SecurityService_Service();
    SecurityService securityService = securityService_Service.getSecurityService();
    String sess_id=securityService.login( "Administrator", "password");
    System.out.println(sess_id);
    securityService.createUser("jean", "jean", "Administrator", "password");
    } catch (Exception ade_e) {
    System.out.println(ade_e);
    i have the following output
    3447993075936D60EEF980C3472AC415
    javax.xml.ws.soap.SOAPFaultException: java.lang.SecurityException: Security violation: /~jean; administrator does not have permission to create this folder.
    Process exited with exit code 0.
    If someone can help me,it would be great.
    best regards
    jean marc

    i try with soapui for the method createuser,
    i have the same issue.
    any help ?

  • Issue while parsing the MYSAPSSO2 Cookie

    Hi All,
    We are trying to establish SSO with a non SAP web application using MYSAPSSO2 cookie.
    Plan is to write a java class which can parse out the MYSAPSSO2 cookie, extract the user Id and use it for single sign on.
    Following Libraries are used:
    logging.jar
    i18n_cp.jar
    iaik_jce.jar
    com.sap.security.api.jar
    com.sap.security.core.jar
    rscp4j.dll(this is downloaded from a SAP EP 7.0 instance running in windows 2003 server in our landscape).
    Our Source SAP EP 7.0 instance which will be issuing the cookie is running in Solaris.
    The target application in which the cookie is parsed, is running in Windos 2003 64 bit server.
    Following is the code which we are using.
    //Instantiate the rpovider
    IAIK provider = new IAIK();
    Security.addProvider(provider);
    //Instantiate the ticket
    tv  =   new com.sap.security.core.ticket.imp.Ticket();
    //set teh certificates
    tv.setCertificates(certificates);
    //set the MYSAPSSO2 cookie
    tv.setTicket(strCookie);
    if (!tv.isValid()){
         System.out.println("Ticket is not valid");
    //Verify the ticket
    tv.verify();
    isValid method is working fine - it is returning true or false exactly based on the validity.
    ISSUE:
    tv.verify();--->Raises the following exception:
    java.security.SignatureException-Certificate (Issuer="CN=SID,OU=XX,O=XYZ,L=LO,ST=ST,C=CO", S/N=1234567890) not found.
    When analyzed, it looks like the verify method is trying to compare the issuer's serial number in integer format
    but the portal is providing the serial number in hexadecimal format.
    So the keystore has the certificate with the same issuer and serial number but the serial number is in hexadecimal format.
    The certificate from SAP Enterprise Portal was imported to the local keystore using the keytool -import option.
    Could anyone help resolve this issue?
    Thanks in advance.

    Hi,
    im facing the exact same problem, and I think I found the reason for the behavior described above.
    The Problem seems to be located at
    [http://help.sap.com/javadocs/NW73/SPS01/CE/se/com.sap.se/com/sap/security/api/ticket/TicketVerifier.html#verify()]
    from com.sap.security.api.jar, just like mentioned.
    But the Problem seems to be the issuer, not the serial number.
    When decompiling  com.sap.security.api.jar with JD-GUI ([http://java.decompiler.free.fr/?q=jdgui]),
    you can see the following:
         public static java.security.cert.X509Certificate[] findCertificates(
                   java.security.cert.X509Certificate[] certificates, String issuer, BigInteger serial) {
              if ((certificates == null) || (certificates.length == 0)) {
                   return null;
              ArrayList certificateList = new ArrayList();
              for (int i = 0; i < certificates.length; i++) {
                   java.security.cert.X509Certificate certificate = certificates<i>;
                   if ((certificate.getIssuerDN().getName().equals(issuer)) && (certificate.getSerialNumber().equals(serial))) {
                        certificateList.add(certificate);
              if (certificateList.size() == 0) {
                   return null;
              java.security.cert.X509Certificate[] matchedCertificates = new java.security.cert.X509Certificate[certificateList
                        .size()];
              certificateList.toArray(matchedCertificates);
              return matchedCertificates;
    As you can see, the issuer-parameter is beeing compared with the issuer from the certificate. And here comes the weird stuff: While the  issuer-parameter contains an issuer like
    "OU=J2EE,CN=EXAMPLE"
    the issuer retrieved from the certificate is
    "OU=J2EE, CN=EXAMPLE"
    (see toString() of the java.security.cert.X509Certificate)
    You see the missing whitespace after the comma? This is the reason why the if-condition fails and you get something like
    java.security.SignatureException: Certificate (Issuer="OU=J2EE,CN=EXAMPLE", S/N=1234) not found.
    A workaround (a really UGLY one, I admit), is the following:
    1. Open  com.sap.security.api.jar with a ZIP-tool and delete
    /com/sap/security/api/ticket/TicketVerifier.class
    2. Copy the decompilied Version of TicketVerifier to Java-Class /com/sap/security/api/ticket/TicketVerifier.java
    3. Change
    for (int i = 0; i < certificates.length; i++) {
         java.security.cert.X509Certificate certificate = certificates<i>;
         if ((certificate.getIssuerDN().getName().equals(issuer)) && (certificate.getSerialNumber().equals(serial))) {
              certificateList.add(certificate);
    to
    for (int i = 0; i < certificates.length; i++) {
         X509Certificate certificate = certificates<i>;
         String dnNameFromCert = certificate.getIssuerDN().getName().replaceAll(", ", ",");
         BigInteger serialNumberFromCert = certificate.getSerialNumber();
         if ((dnNameFromCert.equals(issuer)) && (serialNumberFromCert.equals(serial))) {
              certificateList.add(certificate);
    4. Package this class into a jar and make it available in your classpath.
    5. Enjoy
    To me, this is a huge bug in the SAP-Library and has to be fixed.
    Regards
    Matthias
    Edited by: Matthias82 on Sep 29, 2011 12:47 PM

  • URLClassLoader issues

    Hi,
    I'm trying to create a dynamic "class finding" ClassLoader using URLClassLoader and, at run-time, adding various dependency jar files to the class loader and then creating an instance of a class with this ClassLoader.
    However, the issue I am running into is that the ClassLoader is throwing both a NoClassDefFoundError and a ClassNotFoundException.
    Here is the code I am using to load the classes dynamically from jar files:
    ClassLoader cl = new URLClassLoader(getUrls());
    Class<?> clazz = cl.loadClass("com.example.foo.JAXBDevTest");
    JAXBDevTest jaxb = (JAXBDevTest) clazz.newInstance();
    jaxb.testJAXBMarshalling();Here is the definition of the getUrls() static method in my test class:
    private static URL[] getUrls() {
            List<URL> urls = new ArrayList<URL>();
            try {
                String jaxbHome = "/path/to/jaxb-ri/lib";
                urls.add(new File("/path/to/mappings/ib-client-mappings.jar").toURL());
                urls.add(new File(jaxbHome + "/jaxb-api.jar").toURL());
                urls.add(new File(jaxbHome + "/jaxb-impl.jar").toURL());
                urls.add(new File(jaxbHome + "/activation.jar").toURL());
                urls.add(new File(jaxbHome + "/jaxb1-impl.jar").toURL());
                urls.add(new File(jaxbHome + "/jsr173_1.0_api.jar").toURL());
         } catch (Exception e) {
                e.printStackTrace();
            return urls.toArray(new URL[urls.size()]);
        }The ObjectFactory class is instantiated in the testJAXBMarshalling method of my test object. However, without the jar containing it being on the system classpath, it isn't found. However, this quote from the ClassLoader javadoc suggests that my custom classloader would be responsible for loading it:
    +"The methods and constructors of objects created by a class loader may reference other classes. To determine the class(es) referred to, the Java virtual machine invokes the loadClass method of the class loader that originally created the class."+
    However, this appears not to be the case as the classes that are referred to by the original class are included as URL's in the URLClassLoader instance cannot be found:
    Exception in thread "main" java.lang.NoClassDefFoundError: com/example/foo/ObjectFactory
         at us.mn.hennepin.co.esb.mapping.JAXBDevTest.testJAXBMarshalling(JAXBDevTest.java:88)
         at us.mn.hennepin.co.esb.mapping.JAXBDevTest.main(JAXBDevTest.java:81)
    Caused by: java.lang.ClassNotFoundException: com.example.foo.ObjectFactory
         at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
         ... 2 moreI've spent a considerable amount of time researching this and working on it and am completely frustrated. Any help or insight is greatly appreciated.
    Thanks,
    John

    jdubchak wrote:
    jschell,
    Thanks for your response. I'm sorry if I gave you the impression, in my original description, that I wanted URLClassLoader to handle anything other than simple jar files.
    Well if you are loading jars or directories then the URLClassLoader does it exactly right.
    So there is something in your code or the assumptions that lead to your code which is incorrect.
    That being said, the example I presented (that causes the error) was only adding jar file to the classpath by using the URLClassLoader. To be clear it does not add to the class path. That is not possible using any method in java.
    And if fact it is usually a good idea with classloaders to insure that the loaded classes can not appear in the class path.
    However, even writing a custom class loader, my override of either the findClass or loadClass method is not called.
    You should not be overriding those if all you are using are jars/directories.
    Is it reasonable to assume, that if I write a custom class loader that loads a class from some location (possibly a jar file) that an import statement in that class that loads another class will use the same classloader? Or does it default back to the original classloader?Import statements have nothing to do with it nor even with how java runs when class loaders are not in play. Imports serve as nothing more than a hint to the compiler (not VM) where to find a class which the compiler can then use to define the fully qualified class name (FQCN) which the VM does use.
    The VM decides if a class needs to be loaded. When it loads it uses the context of the call to determine the class loader. The classloader (normal ones) defer to parents to see if the class can be loaded by them.
    Thus using String will end up being loaded by the System class loader. On the other hand if you use MyPackage.MyClass2 in MyPackage.MyClass1 where MyClass1 was loaded by a custom loader and MyClass2 is not loaded by a parent then the custom loader will load it (or at least attempt to.)

  • Issue with deleting a group using Request APIs in OIM 11g R1

    Hi,
    I am facing an issue with Request Based provisioning in OIM 11g R1.
    I am currently testing a scenario where i have imported a data set for 'Modify Provisioned Resource' and am able to add a group/entitlement to an already provisioned resource by using the following code :
            RequestBeneficiaryEntityAttribute childEntityAttribute= new RequestBeneficiaryEntityAttribute();
            childEntityAttribute.setName("AD User Group Details");
            childEntityAttribute.setType(TYPE.String);
            List<RequestBeneficiaryEntityAttribute> childEntityAttributeList=new ArrayList<RequestBeneficiaryEntityAttribute>();
            RequestBeneficiaryEntityAttribute attr = new RequestBeneficiaryEntityAttribute("Group Name", <group>,                                                                       RequestBeneficiaryEntityAttribute.TYPE.String);
            childEntityAttributeList.add(attr);
            childEntityAttribute.setChildAttributes(childEntityAttributeList);
            childEntityAttribute.setAction(RequestBeneficiaryEntityAttribute.ACTION.Add);
            beneficiaryEntityAttributeList = new ArrayList<RequestBeneficiaryEntityAttribute>();   
            beneficiaryEntityAttributeList.add(childEntityAttribute);
            beneficiarytEntity.setEntityData(beneficiaryEntityAttributeList);
    This works fine for adding a group but if i try to remove a group by changing the action to Delete in the same code, the request fails. The only change made is in the following line:
    childEntityAttribute.setAction(RequestBeneficiaryEntityAttribute.ACTION.Delete);
    Could you please suggest where can this possibly be wrong.
    Thanks for your time and help

    Hi BB,
    I am trying to follow up your response.
    You are suggestng to use prepopulate adapter for to populate respource object name, that means We have to just use an sql query from obj tabke to get the resource object name. right ?? it could be like below, what should I have entity-type value here ??
    <AttributeReference name="Field1" attr-ref="act_key"
    available-in-bulk="false" type="Long" length="20" widget="ENTITY" required="true"
    entity-type="????"/>
    <PrePopulationAdapter name="prepopulateResurceObject"
    classname="my.sample.package.prepopulateResurceObject" />
    </AttributeReference>
    <AttributeReference name="Field2" attr-ref="Field2" type="String" length="256" widget="lookup-query"
    available-in-bulk="true" required="true">
    <lookupQuery lookup-query="select lkv_encoded as Value,lkv_decoded as Description from lkv lkv,lku lku
    where lkv.lku_key=lku.lku_key and lku_type_string_key='Lookup.xxx.BO.Field2'
    and instr(lkv_encoded,concat('$Form data.Field1', '~'))>0" display-field="Description" save-field="Value" />
    </AttributeReference>
    Then I need think about the 'Lookup.xxx.BO.Field2' format.
    Could you please let me know if my understanding is correct?? What is the entity-type value of the first attribute reference value?
    Thanks for your all help.

  • Issue with validation of signature

    Hello,
    I am facing a problem in producing a correct signature and I hope someone can help me understand the root of the problem. Most of us are familiar with the Java (Sun) examples of GenDetached, GenEnveloped, GenEnveloping, and Validate code samples. The code below is a small variation of the GenDetached:
    public class GenerateDetachedWithManifest {
      public static void main(String[] args) throws Exception {
        // First, create a DOM XMLSignatureFactory that will be used to
        // generate the XMLSignature and marshal it to DOM.
        String providerName = System.getProperty("jsr105Provider",
            "org.jcp.xml.dsig.internal.dom.XMLDSigRI");
        XMLSignatureFactory fac = XMLSignatureFactory.getInstance("DOM",
            (Provider) Class.forName(providerName).newInstance());
        // Create a Reference to an external URI that will be digested
        // using the SHA1 digest algorithm
        Reference ref = fac.newReference("http://www.w3.org/TR/xml-stylesheet", fac
            .newDigestMethod(DigestMethod.SHA1, null));
        Reference xref = fac.newReference("#object", fac.newDigestMethod(
            DigestMethod.SHA1, null), null, "http://www.w3.org/2000/09/xmldsig#Object", null);
        Manifest manifest = fac.newManifest(Collections.singletonList(ref));
        List<XMLObject> objs = new ArrayList<XMLObject>();
        objs.add(fac.newXMLObject(Collections.singletonList(manifest), "object", null, null));
        // Create the SignedInfo
        SignedInfo si = fac.newSignedInfo(fac.newCanonicalizationMethod(
            CanonicalizationMethod.INCLUSIVE,
            (C14NMethodParameterSpec) null), fac.newSignatureMethod(
            SignatureMethod.DSA_SHA1, null), Collections.singletonList(xref));
        // Create a DSA KeyPair
        KeyPairGenerator kpg = KeyPairGenerator.getInstance("DSA");
        kpg.initialize(512);
        KeyPair kp = kpg.generateKeyPair();
        // Create a KeyValue containing the DSA PublicKey that was generated
        KeyInfoFactory kif = fac.getKeyInfoFactory();
        KeyValue kv = kif.newKeyValue(kp.getPublic());
        // Create a KeyInfo and add the KeyValue to it
        KeyInfo ki = kif.newKeyInfo(Collections.singletonList(kv));
        // Create the XMLSignature (but don't sign it yet)
        XMLSignature signature = fac.newXMLSignature(si, ki, objs, "SignatureIdValue", null);
        // Create the Document that will hold the resulting XMLSignature
        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        dbf.setNamespaceAware(true); // must be set
        Document doc = dbf.newDocumentBuilder().newDocument();
        // Create a DOMSignContext and set the signing Key to the DSA
        // PrivateKey and specify where the XMLSignature should be inserted
        // in the target document (in this case, the document root)
        DOMSignContext signContext = new DOMSignContext(kp.getPrivate(), doc);
        // Marshal, generate (and sign) the detached XMLSignature. The DOM
        // Document will contain the XML Signature if this method returns
        // successfully.
        signature.sign(signContext);
        // output the resulting document
        OutputStream os;
        if (args.length > 0) {
          os = new FileOutputStream(args[0]);
        } else {
          os = System.out;
        TransformerFactory tf = TransformerFactory.newInstance();
        Transformer trans = tf.newTransformer();
        trans.transform(new DOMSource(doc), new StreamResult(os));
    }If you wonder why I am doing this the answer is that I am trying to sign a format based on OPC. Anyway, the problem I have is that the output of the above program fails to validate when running the Validate sample. I don't think the issue is with the Validate program because it correctly validates output of a .NET signing application whose behavior I am trying to replicate in Java.
    So the question is: why does the above code produce an incorrect signature?
    Thanks,
    Luis

    Can you post relevant sections of the OPC standard (or a link to it) that describes the requirement? Its possible that they have written the requirements differently from the examples. Its also possible that the DSIG library in the JDK only does things in a specifc way (I'll let Sean Mullan weigh in on this part of the discussion if he's monitoring this list/thread - he's the developer from Sun who wrote the library).
    Here's the wording from the W3C spec on the Object element:
    +"The Object's Id is commonly referenced from a Reference in SignedInfo, or Manifest. This element is typically used for enveloping signatures where the object being signed is to be included in the signature element. The digest is calculated over the entire Object element including start and end tags."+
    What you have is neither an Enveloping Signature nor Detached - but a combination of the two. So its possible that the JDK library doesn't work with Object references in this manner (although in theory is should). Based on this thread (XML dsig: Can I sign a SignatureProperty of the Signature? it appears that this theory holds up for child-elements of Object , but not for the Object element itself.
    Arshad Noor
    StrongAuth, Inc.

  • Issue with creating array of custom data type - WebLogic Integration

    Hi,
    We are doing WebLogic integration with Siebel for which from Siebel side we have generated java wrapper class which has all the methods, input\outputs defined and in\out params are serialized along with get\set methods. Following are the details of the input\output args.
    Account_EMRIO.java
    public class Account_EMRIO implements Serializable, Cloneable, SiebelHierarchy {
    protected String fIntObjectFormat = null;
    protected String fMessageType = "Integration Object";
    protected String fMessageId = null;
    protected String fIntObjectName = "Account_EMR";
    protected String fOutputIntObjectName = "Account_EMR";
    protected ArrayList <AccountIC> fintObjInst = null;
    Above class also includes constructors\overloaded constructor\getters\setters
    public AccountIC getfintObjInst() {    
    if(fintObjInst != null) {
    return (AccountIC)fintObjInst.clone();
    }else{
    return null;
    public void setfintObjInst(AccountIC val) {
    if(val != null) {
    if(fintObjInst == null) { 
    fintObjInst = new ArrayList<AccountIC>();
    fintObjInst.add(val);
    For the nested user defined data type AccountIC, it is defined in another java class as below
    AccountIC.java
    public class AccountIC implements Serializable, Cloneable, SiebelHierarchy {
    protected String fname = null;
    protected String fParent_Account_Id= null;
    protected String fPrimary_Organization = null;
    With the above, I was able to get all the AccountIC in the wsdl correctly and using this I was able to set the input param in the client
    WSDL:
    <xs:complexType name="accountEMRIO">
    <xs:sequence>
    <xs:element name="fIntObjectFormat" type="xs:string" minOccurs="0"/>
    <xs:element name="fIntObjectName" type="xs:string" minOccurs="0"/>
    <xs:element name="fMessageId" type="xs:string" minOccurs="0"/>
    <xs:element name="fMessageType" type="xs:string" minOccurs="0"/>
    <xs:element name="fOutputIntObjectName" type="xs:string" minOccurs="0"/>
    <xs:element name="fintObjInst" type="tns:accountIC" minOccurs="0"/>
    </xs:sequence>
    <xs:complexType name="accountIC">
    <xs:sequence>
    <xs:element name="fName" type="xs:string" minOccurs="0"/>
    <xs:element name="fParent_Account_Id" type="xs:string" minOccurs="0"/>
    <xs:element name="fPrimary_Organization" type="xs:string" minOccurs="0"/>
    minOccurs="0"/>
    </xs:sequence>
    </xs:complexType>
    Now, I wanted to make slight difference in getter method of class Account_EMRIO method getfintObjInst so that an array of AccountIC is retured as output.
    public ArrayList<AccountIC> getfintObjInst() {    
    if(fintObjInst != null) {
    return (ArrayList<AccountIC>)fintObjInst.clone();
    }else{
    return null;
    With the above change, once the wsdl is generated, I am no longer getting fintObjInst field for AccountIC due to which I am unable to get the array list of accountIC
    WSDL:
    <xs:complexType name="accountEMRIO">
    <xs:sequence>
    <xs:element name="fIntObjectFormat" type="xs:string" minOccurs="0"/>
    <xs:element name="fIntObjectName" type="xs:string" minOccurs="0"/>
    <xs:element name="fMessageId" type="xs:string" minOccurs="0"/>
    <xs:element name="fMessageType" type="xs:string" minOccurs="0"/>
    <xs:element name="fOutputIntObjectName" type="xs:string" minOccurs="0"/>
    </xs:sequence>
    </xs:complexType>
    The issue that I am facing here is, we have a custom data type(AccountIC) which has several fields in it. In the output I need a array of AccountIC. In the java bean, when this type was defined as
    protected ArrayList <AccountIC> fintObjInst = null; I was unable to get a array of AccountIC. this gets complicated as inside a AccountIC there is array of contacts as well and all the time I am getting just the first records and not a array.
    To summarize: How to get xsd:list or maxoccurs property for a field in WSDL for the user defined\custom datatype?
    Can someone help me with this.
    Thanks,
    Sudha.

    can someone help with this??

  • Issue with Generate Create Script in new ODT 11.1.0.6.10 beta

    I've tried this on several tables in my database. I choose Generate Script to ... a file, for a given table it gives me the error message "An error occurred while writing to fil: \nValue was either too large or too smal for an Int32."
    (It doesn't matter if I'm in a Oracle database project or some other project.)
    Trying to Generate Script To Project... when I'm in a Oracle Database Project, Visual Studio (2005) crashes. It appears to be some overflow exception according to crashinfo:
    EventType : clr20r3 P1 : devenv.exe P2 : 8.0.50727.762 P3 : 45716759
    P4 : mscorlib P5 : 2.0.0.0 P6 : 461eee3d P7 : 407b P8 : a3
    P9 : system.overflowexception
    (With ODT 11.1.0.5.10 beta it worked fine dispite the issue discussed in thread: Re: Issue with Generate Create Script in new ODT 11.1.0.5.10 beta
    /Tomas

    Tried to debug this error and got these exception details. Hope it helps!
    /Tomas
    System.OverflowException was unhandled
    Message="Value was either too large or too small for an Int32."
    Source="mscorlib"
    StackTrace:
    Server stack trace:
    at System.Decimal.ToInt32(Decimal d)
    at System.Decimal.op_Explicit(Decimal value)
    at Oracle.Management.Omo.TableSpaceQuotaDetails.FillTableSpaceQuota(OracleDataReader reader)
    at Oracle.Management.Omo.User.FillTableSpaceQuotas(OracleDataReader reader)
    at Oracle.Management.Omo.Connection.GetUserCollection(Boolean refresh)
    at Oracle.Management.Omo.Connection.GetUsers(Boolean refresh)
    at Oracle.Management.Omo.TableSQLGenerator.GetCreateSQLs(OmoObject obj, ArrayList& typeAndNames, Boolean checkRequired, Boolean appendSchemaName)
    at Oracle.Management.Omo.TableViewBase.GetCreateSQLs(Boolean appendSchemaName)
    at Oracle.VsDevTools.OracleUILDBProjectServices.GenerateCreateScript(OracleUILConnCtx connCtx, String[] objectNames, String objectOwner, OracleUILObjectType objectType)
    at Oracle.VsDevTools.OracleUILDBProjectServices.GenerateCreateScriptAsyncMethod(IntPtr ppvObj, OracleUILConnCtx connCtx, String[] objectNames, String objectOwner, OracleUILObjectType objectType, ICollection& scriptText)
    at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
    at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
    at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)
    Exception rethrown at [0]:
    at System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(Message reqMsg, Boolean bProxyCase)
    at System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(Object NotUsed, MessageData& msgData)
    at Oracle.VsDevTools.OracleUILDBProjectServices.GenerateScriptAsyncMethodDelegate.EndInvoke(ICollection& scriptText, IAsyncResult result)
    at Oracle.VsDevTools.OracleUILDBProjectServices.OnGenerateScriptAsyncCompletion(IAsyncResult ar)
    at System.Runtime.Remoting.Messaging.AsyncResult.SyncProcessMessage(IMessage msg)
    at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)
    at System.Runtime.Remoting.Proxies.AgileAsyncWorkerItem.ThreadPoolCallBack(Object o)
    at System.Threading._ThreadPoolWaitCallback.WaitCallback_Context(Object state)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
    at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(Object state)

  • What is the difference between iterator.remove() ArrayList.remove()?

    Following code uses iterator.remove() ArrayList.remove().
    public class CollectionRemove
        private static void checkIteratorRemove()
             List<String> list = new ArrayList<String>();     
              list.add("1");
              list.add("2");
              list.add("3");     
             System.out.println("in checkWithIterator*************");
            Iterator<String> iter = list.iterator();
            while (iter.hasNext()) {
                String str = iter.next();           
                if (str.equals("2")) {
                    iter.remove();
                System.out.println("list Size: " + list.size() + " Element: " +  str);
        private static void checkListRemove()
             List<String> list = new ArrayList<String>();     
              list.add("1");
              list.add("2");
              list.add("3");     
            System.out.println("in ncheckWithForLoop*************");
            Iterator<String> iter = list.iterator();
            while (iter.hasNext()) 
                 String str = (String) iter.next();    
                if (str.equals("2")) {
                    list.remove(str);
                System.out.println("list Size: " + list.size() + " Element: " +  str);
        public static void main(String args[])
             checkIteratorRemove();
             checkListRemove();
    output is :
    in checkWithIterator*************
    list Size: 3 Element: 1
    list Size: 2 Element: 2
    list Size: 2 Element: 3
    in ncheckWithForLoop*************
    list Size: 3 Element: 1
    list Size: 2 Element: 2Why is this difference ? what is the difference between iterator.remove() ArrayList.remove()?

    In the case of Fail-fast iterator, if a thread modifies a collection directly while iterating over it, the iterator will thow ConcurrentModificationException . Say,
    for (Iterator it = collection.iterator(); it.hasNext()) {
        Object object = it.next();
        if (isConditionTrue) {
            // collection.remove(object);  can throw ConcurrentModificationException
            it.remove(object);
    }As per specs,
    Note that this exception does not always indicate that an object has been concurrently modified by a different thread. If a single thread issues a sequence of method invocations that violates the contract of an object, the object may throw this exception. For example, if a thread modifies a collection directly while it is iterating over the collection with a fail-fast iterator, the iterator will thow this exception.

  • Facing issue in suggested meeting time in ews-java-api

    Hi,
    I have a meeting room id , and i want to get Free and Busy schedule of the meeting room , below is the code i am using
    List<AttendeeInfo> attendees = new ArrayList<AttendeeInfo>();
    attendees.add(new AttendeeInfo([email protected]));
    SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    Date startDate = formatter.parse("2015-03-03 00:00:00");
    Date endDate = formatter.parse("2015-03-05 00:00:00");
    // Call the availability service.
    GetUserAvailabilityResults results = exchangService.getUserAvailability(
    attendees,
    new TimeWindow(startDate, endDate),
    AvailabilityData.FreeBusyAndSuggestions);
    // Output attendee availability information.
    int attendeeIndex = 0;
    for (AttendeeAvailability attendeeAvailability : results.getAttendeesAvailability()) {
    System.out.println("Availability for " + attendees.get(attendeeIndex).getSmtpAddress());
    //if (attendeeAvailability.getErrorCode() == ServiceError.NoError) {
    for (CalendarEvent calendarEvent : attendeeAvailability.getCalendarEvents()) {
    System.out.println("Calendar event : "+ calendarEvent.getFreeBusyStatus().toString());
    System.out.println(" Start time: " + calendarEvent.getStartTime().toString());
    System.out.println(" End time: " + calendarEvent.getEndTime().toString());
    if (calendarEvent.getDetails() != null)
    System.out.println(" Subject: " + calendarEvent.getDetails().getSubject());
    // Output additional properties.
    attendeeIndex++;
    for (Suggestion suggestion : results.getSuggestions()) {
    System.out.println("Suggested day: " + suggestion.getDate().toString());
    //System.out.println("Overall quality of the suggested day: " + suggestion.getQuality().toString());
    for (TimeSuggestion timeSuggestion : suggestion.getTimeSuggestions()) {
    System.out.println("Suggested time: " + timeSuggestion.getMeetingTime().toString());
    // Output additonal properties.
    } catch (Exception e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    I am getting output like,
    Calendar event : Busy
    Start time: Tue Mar 03 10:00:00 GMT+05:30 2015
    End time: Tue Mar 03 17:00:00 GMT+05:30 2015
    Calendar event : Busy
    Start time: Wed Mar 04 12:00:00 GMT+05:30 2015
    End time: Wed Mar 04 13:00:00 GMT+05:30 2015
    Calendar event : Busy
    Start time: Wed Mar 04 13:00:00 GMT+05:30 2015
    End time: Wed Mar 04 18:30:00 GMT+05:30 2015
    Suggested day: Tue Mar 03 00:00:00 GMT+05:30 2015
    Suggested time: Tue Mar 03 17:00:00 GMT+05:30 2015
    Suggested time: Tue Mar 03 17:30:00 GMT+05:30 2015
    Suggested time: Tue Mar 03 18:00:00 GMT+05:30 2015
    Suggested time: Tue Mar 03 18:30:00 GMT+05:30 2015
    Suggested time: Tue Mar 03 19:00:00 GMT+05:30 2015
    Suggested time: Tue Mar 03 19:30:00 GMT+05:30 2015
    Suggested time: Tue Mar 03 20:00:00 GMT+05:30 2015
    Suggested time: Tue Mar 03 20:30:00 GMT+05:30 2015
    Suggested time: Tue Mar 03 21:00:00 GMT+05:30 2015
    Suggested time: Tue Mar 03 21:30:00 GMT+05:30 2015
    Suggested day: Wed Mar 04 00:00:00 GMT+05:30 2015
    Suggested time: Wed Mar 04 05:30:00 GMT+05:30 2015
    Suggested time: Wed Mar 04 06:00:00 GMT+05:30 2015
    Suggested time: Wed Mar 04 06:30:00 GMT+05:30 2015
    Suggested time: Wed Mar 04 07:00:00 GMT+05:30 2015
    Suggested time: Wed Mar 04 07:30:00 GMT+05:30 2015
    Suggested time: Wed Mar 04 08:00:00 GMT+05:30 2015
    Suggested time: Wed Mar 04 08:30:00 GMT+05:30 2015
    Suggested time: Wed Mar 04 09:00:00 GMT+05:30 2015
    Suggested time: Wed Mar 04 09:30:00 GMT+05:30 2015
    Suggested time: Wed Mar 04 10:00:00 GMT+05:30 2015
    In the above output, for the corresponding date Mar 03, it is showing busy time correctly, but in the suggested time which is free , it is showing until 21.30 only, it need to showed until 23.30 as that also a suggested time which is free, Similarly, in
    next day ie. Mar 04, it shows busy time correctly, but suggested time which is free is shown until 10:00 am only, why it is not showing after 10 am. Please help me to solve this issue and how to proceed further to show the remaining free meeting time also.
    Thanks,
    Akshea.

    Hi Jason,
    Thanks for your response, your answer works ,i gave max. number of suggestions per day as 48, but i have a doubt,
    Suggested day: Wed Mar 04 00:00:00 GMT+05:30 2015
    Suggested time: Wed Mar 04 11:00:00 GMT+05:30 2015
    Suggested time: Wed Mar 04 18:30:00 GMT+05:30 2015
    Suggested time: Wed Mar 04 19:00:00 GMT+05:30 2015
    Suggested time: Wed Mar 04 19:30:00 GMT+05:30 2015
    Suggested time: Wed Mar 04 20:00:00 GMT+05:30 2015
    Suggested time: Wed Mar 04 20:30:00 GMT+05:30 2015
    Suggested time: Wed Mar 04 21:00:00 GMT+05:30 2015
    Suggested time: Wed Mar 04 21:30:00 GMT+05:30 2015
    Suggested time: Wed Mar 04 22:00:00 GMT+05:30 2015
    Suggested time: Wed Mar 04 22:30:00 GMT+05:30 2015
    Suggested time: Wed Mar 04 23:00:00 GMT+05:30 2015
    Suggested time: Wed Mar 04 23:30:00 GMT+05:30 2015
    Suggested time: Thu Mar 05 00:00:00 GMT+05:30 2015
    Suggested time: Thu Mar 05 00:30:00 GMT+05:30 2015
    Suggested time: Thu Mar 05 01:00:00 GMT+05:30 2015
    Suggested time: Thu Mar 05 01:30:00 GMT+05:30 2015
    Suggested time: Thu Mar 05 02:00:00 GMT+05:30 2015
    Suggested time: Thu Mar 05 02:30:00 GMT+05:30 2015
    Suggested time: Thu Mar 05 03:00:00 GMT+05:30 2015
    Suggested time: Thu Mar 05 03:30:00 GMT+05:30 2015
    Suggested time: Thu Mar 05 04:00:00 GMT+05:30 2015
    Suggested time: Thu Mar 05 04:30:00 GMT+05:30 2015
    Suggested time: Thu Mar 05 05:00:00 GMT+05:30 2015
    Suggested day: Thu Mar 05 00:00:00 GMT+05:30 2015
    Suggested time: Thu Mar 05 05:30:00 GMT+05:30 2015
    Suggested time: Thu Mar 05 06:00:00 GMT+05:30 2015
    Suggested time: Thu Mar 05 06:30:00 GMT+05:30 2015
    Suggested time: Thu Mar 05 07:00:00 GMT+05:30 2015
    Suggested time: Thu Mar 05 07:30:00 GMT+05:30 2015
    Suggested time: Thu Mar 05 08:00:00 GMT+05:30 2015
    Suggested time: Thu Mar 05 10:00:00 GMT+05:30 2015
    Suggested time: Thu Mar 05 10:30:00 GMT+05:30 2015
    Suggested time: Thu Mar 05 11:00:00 GMT+05:30 2015
    Suggested time: Thu Mar 05 11:30:00 GMT+05:30 2015
    Suggested time: Thu Mar 05 12:00:00 GMT+05:30 2015
    Suggested time: Thu Mar 05 12:30:00 GMT+05:30 2015
    Suggested time: Thu Mar 05 13:00:00 GMT+05:30 2015
    Suggested time: Thu Mar 05 13:30:00 GMT+05:30 2015
    Suggested time: Thu Mar 05 14:00:00 GMT+05:30 2015
    Suggested time: Thu Mar 05 14:30:00 GMT+05:30 2015
    Suggested time: Thu Mar 05 15:00:00 GMT+05:30 2015
    Suggested time: Thu Mar 05 15:30:00 GMT+05:30 2015
    Suggested time: Thu Mar 05 16:00:00 GMT+05:30 2015
    Suggested time: Thu Mar 05 16:30:00 GMT+05:30 2015
    Suggested time: Thu Mar 05 17:00:00 GMT+05:30 2015
    Suggested time: Thu Mar 05 17:30:00 GMT+05:30 2015
    Suggested time: Thu Mar 05 18:00:00 GMT+05:30 2015
    Suggested time: Thu Mar 05 18:30:00 GMT+05:30 2015
    Suggested time: Thu Mar 05 19:00:00 GMT+05:30 2015
    Suggested time: Thu Mar 05 19:30:00 GMT+05:30 2015
    Suggested time: Thu Mar 05 20:00:00 GMT+05:30 2015
    Suggested time: Thu Mar 05 20:30:00 GMT+05:30 2015
    Suggested time: Thu Mar 05 21:00:00 GMT+05:30 2015
    Suggested time: Thu Mar 05 21:30:00 GMT+05:30 2015
    Suggested time: Thu Mar 05 22:00:00 GMT+05:30 2015
    Suggested time: Thu Mar 05 22:30:00 GMT+05:30 2015
    Suggested time: Thu Mar 05 23:00:00 GMT+05:30 2015
    Suggested time: Thu Mar 05 23:30:00 GMT+05:30 2015
    Suggested time: Fri Mar 06 00:00:00 GMT+05:30 2015
    Suggested time: Fri Mar 06 00:30:00 GMT+05:30 2015
    Suggested time: Fri Mar 06 01:00:00 GMT+05:30 2015
    Suggested time: Fri Mar 06 01:30:00 GMT+05:30 2015
    Suggested time: Fri Mar 06 02:00:00 GMT+05:30 2015
    Suggested time: Fri Mar 06 02:30:00 GMT+05:30 2015
    Suggested time: Fri Mar 06 03:00:00 GMT+05:30 2015
    Suggested time: Fri Mar 06 03:30:00 GMT+05:30 2015
    Suggested time: Fri Mar 06 04:00:00 GMT+05:30 2015
    Suggested time: Fri Mar 06 04:30:00 GMT+05:30 2015
    Suggested time: Fri Mar 06 05:00:00 GMT+05:30 2015
    Suggested day: Fri Mar 06 00:00:00 GMT+05:30 2015
    Suggested time: Fri Mar 06 05:30:00 GMT+05:30 2015
    Suggested time: Fri Mar 06 06:00:00 GMT+05:30 2015
    Suggested time: Fri Mar 06 06:30:00 GMT+05:30 2015
    Suggested time: Fri Mar 06 07:00:00 GMT+05:30 2015
    Suggested time: Fri Mar 06 09:00:00 GMT+05:30 2015
    Suggested time: Fri Mar 06 09:30:00 GMT+05:30 2015
    Suggested time: Fri Mar 06 10:00:00 GMT+05:30 2015
    Suggested time: Fri Mar 06 10:30:00 GMT+05:30 2015
    Suggested time: Fri Mar 06 11:00:00 GMT+05:30 2015
    Suggested time: Fri Mar 06 11:30:00 GMT+05:30 2015
    Suggested time: Fri Mar 06 12:00:00 GMT+05:30 2015
    Suggested time: Fri Mar 06 12:30:00 GMT+05:30 2015
    Suggested time: Fri Mar 06 13:00:00 GMT+05:30 2015
    Suggested time: Fri Mar 06 13:30:00 GMT+05:30 2015
    Suggested time: Fri Mar 06 14:00:00 GMT+05:30 2015
    Suggested time: Fri Mar 06 14:30:00 GMT+05:30 2015
    Suggested time: Fri Mar 06 15:00:00 GMT+05:30 2015
    Suggested time: Fri Mar 06 15:30:00 GMT+05:30 2015
    Suggested time: Fri Mar 06 16:00:00 GMT+05:30 2015
    Suggested time: Fri Mar 06 16:30:00 GMT+05:30 2015
    Suggested time: Fri Mar 06 17:00:00 GMT+05:30 2015
    Suggested time: Fri Mar 06 17:30:00 GMT+05:30 2015
    Suggested time: Fri Mar 06 18:00:00 GMT+05:30 2015
    Suggested time: Fri Mar 06 18:30:00 GMT+05:30 2015
    Suggested time: Fri Mar 06 19:00:00 GMT+05:30 2015
    Suggested time: Fri Mar 06 19:30:00 GMT+05:30 2015
    Suggested time: Fri Mar 06 20:00:00 GMT+05:30 2015
    Suggested time: Fri Mar 06 20:30:00 GMT+05:30 2015
    Suggested time: Fri Mar 06 21:00:00 GMT+05:30 2015
    Suggested time: Fri Mar 06 21:30:00 GMT+05:30 2015
    Suggested time: Fri Mar 06 22:00:00 GMT+05:30 2015
    Suggested time: Fri Mar 06 22:30:00 GMT+05:30 2015
    Suggested time: Fri Mar 06 23:00:00 GMT+05:30 2015
    Suggested time: Fri Mar 06 23:30:00 GMT+05:30 2015
    Suggested time: Sat Mar 07 00:00:00 GMT+05:30 2015
    Suggested time: Sat Mar 07 00:30:00 GMT+05:30 2015
    Suggested time: Sat Mar 07 01:00:00 GMT+05:30 2015
    Suggested time: Sat Mar 07 01:30:00 GMT+05:30 2015
    Suggested time: Sat Mar 07 02:00:00 GMT+05:30 2015
    Suggested time: Sat Mar 07 02:30:00 GMT+05:30 2015
    Suggested time: Sat Mar 07 03:00:00 GMT+05:30 2015
    Suggested time: Sat Mar 07 03:30:00 GMT+05:30 2015
    Suggested time: Sat Mar 07 04:00:00 GMT+05:30 2015
    Suggested time: Sat Mar 07 04:30:00 GMT+05:30 2015
    This is my output,
    i gave start date from 04-Mar-2015 and end date 07-Mar-2015, so it shows me the meeting suggestion time from 04-Mar to 06-Mar till 23.30, that is fine, but for 07-Mar, it just shows first 10 meeting time only till 4.30 only, y so, on 07-Mar-2015 also it
    should give time till 23.30 . right.

  • Typed Arraylist in a JSP

    I need to use a typed ArrayList in a JSP and it doesn't like the less than and greater than characters around the type. Similar to this:
    ArrayList<MyType> a = new MyType();How do I format that syntax correctly?

    I am running Apache Tomcat 5.5.12 on Win32 and the JAVA_HOME is pointing to the correct JRE (1.5).
    If I do not type the ArrayList in the JSP's it will work. However I would like to know why this would work. If I run straight Java code on this system because it is 1.5 I have to type the ArrayList's. One can compile the Java to still work without the typed ArrayList's but I don't want to do that. I wonder if there are any special options Apache uses that negate having to use the typed ArrayList's. Seems strange that would be the case.
    As long as this code doesn't start breaking when using future versions I wouldn't have an issue but being that 1.5 without any special options wanted the ArrayList's typed I would have rather been able to just type them.

Maybe you are looking for