Tokenize error

hello all;
recently i want to do some program with string tokenizer but i get an error when compile using terminal(g++). the error related to tokenizer then i copy string tokenizer souce code to (4.0.0)c++ directory in include directory of usr directory ..... but now i found the error like as follows....
Undefined symbols:
"StringTokenizer::StringTokenizer(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from:
_main in ccx4YKZK.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
please tell me that now what to do. if there is any need to install any library or other thing please give any suggestion as soon as possible
thanks in advance

I'm not sure of whether Xalan supports 2.0, but I'd bet it does not -- based on your error.
Setting the stylesheet version to 2.0 is a declaritive action, I don't think it will cause a 2.0 transformer to be located and started.
Check out Saxon, or write code to do the perform the tokenize function yourself. I did a google serach for "tokenize xslt" and the first hit was old code to tokenize a string.
Those are your two basic choices -- go to a 2.0-compliant transformer with tokenize or use a 1.0-compliant transformer with code that does not need tokenize.
Dave Patterson

Similar Messages

  • Need Help! (Tokenizer error)

    Hello,
    i am currently ubdertaking an introduction to programming coarse and for one of my assignments i have been asked to create a program that will read read a file that contains the number 1-10 in this format;
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    The program must read these numbers, print them, find there sum then print the out put. i am completly lost, my program will compile yet i have an error while running it. java.util.NoSuchElementException please help.
    here is my code.
    import java.io.*;
    import java.util.StringTokenizer;
    //import java.util.NoSuchElementException;     Tried Writting this in but still didnt work
    public class addLine
         public static void main(String[] args) throws IOException, FileNotFoundException
              int test1, test2, test3, test4,test5, test6, test7, test8, test9, test10;
              int sumOfNum;
              StringTokenizer tokenizer;
              BufferedReader inFile = new
                   BufferedReader(new FileReader("test.txt"));
              tokenizer =
                        new StringTokenizer(inFile.readLine());
              test1 = Integer.parseInt(tokenizer.nextToken());
              test2 = Integer.parseInt(tokenizer.nextToken());
              test3 = Integer.parseInt(tokenizer.nextToken());
              test4 = Integer.parseInt(tokenizer.nextToken());
              test5 = Integer.parseInt(tokenizer.nextToken());
              test6 = Integer.parseInt(tokenizer.nextToken());
              test7 = Integer.parseInt(tokenizer.nextToken());
              test8 = Integer.parseInt(tokenizer.nextToken());
              test9 = Integer.parseInt(tokenizer.nextToken());
              test10 = Integer.parseInt(tokenizer.nextToken());
              System.out.println("Test scores: " + (test1) + " "
              + (test2) + " "
              + (test3) + " "
              + (test4) + " "
              + (test5) + " "
              + (test6) + " "
              + (test7) + " "
              + (test8) + " "
              + (test9) + " "
              + (test10));
              sumOfNum = (test1 + test2 + test3 + test4 + test5+ test6 + test7 + test8+ test9 + test10);
              System.out.println("Sum of all numbers: " + (sumOfNum));
              inFile.close();
    }Thanks for the help

    A StringTokenizer takes a String and splits it up into separate Strings. So if you gave it the String "1 2 3 4 5 6 7 8 9" it could be split apart with a StringTokenizer. But you don't have that. You have a String with the contents "1".
    Take a look at the documentation for readLine() and you'll see that it does just that - it reads a single line of a text from a file.
    So, instead of the code you have you'll want to do something a bit different. You'll want a loop of some sort that keeps reading the file until it gets a null. For each line you read you'll want to use the Integer.parse() method like you're doing now and do the appropriate math.

  • String Tokenizer error

    I have code that is supposed to read in some information from a file related to students inrolled in a college. The program is supposed to then print the info to the screen and store it. The code compiles but dosnt run.
    try{
    BufferedReader inputStream = new BufferedReader(new FileReader(fileNameOne));
    while(inputStream.readLine() != null);  {
            temp = inputStream.readLine();
            StringTokenizer finder = new StringTokenizer(temp);
         id = finder.nextToken();
         hours = finder.nextToken();
         points = finder.nextToken();
         while(finder.hasMoreTokens()) {
              tempName = tempName + " " + finder.nextToken(); }
         name = tempName;
         System.out.println(id + hours + points + name); } }anyone know why this isnt working? A sample of the text file is this.
    759253939 12 37 SMITH BOB DAVID

    well I got the code to work a bit by removing the ; after the while loop(doh)
    errors I get are
    Exception in thread "main" java.lang.NullPointerException
    at java.util.StringTokenizer.<init>(StringTokenizer.java:119)
    at java.util.StringTokenizer.<init>(StringTokenizer.java:149)
    at StudentInfo.main(StudentInfo.java:20)
    line 20 in my code is
                        StringTokenizer finder = new StringTokenizer(temp);
    that piece of code.

  • Getting error using tokenize in xsl

    We are on 12.1.3 and am getting the following error while using the tokenize function in the custom po xsl file.
    error obtained:
    <Line 3030, Column 51>: XML-22015: (Error) Function 'tokenize' not found.
    Code used::
      <xsl:variable name="tcline" select="unparsed-text('/generic_tc.txt','UTF-8')">
      <xsl:for-each select="tokenize($tcline,'\r\n')">
        <xsl:value-of select="replace($tcline,'s/\"<b>"(.*?)\"<b>"/<em>$1\/em/g;')"/>
      </xsl:for-each>
      </xsl:variable>
    Any idea, if tokenize is supported or not?
    NOTE: unparsed-text which is XSL 2.0 function works fine without issues
    Thanks,
    Maha

    I was on a call a short time ago with several people, all attempting to access cr.com.  Some had no issues (myself included), whereas others experienced security problems.    This probably explains the differences.
    As far as the problem with the publishing tool, I take it that the issue runs a little deeper, since I can't get it to publish, even though I am able to log in to cr.com successfully.
    Peter

  • REP-0495: Internal Error - Unable to tokenize the query.

    Hi
    I am getting error when I run xml reports .
    log file is as follow
    Receivables: Version : 11.5.0 - Development
    Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
    FLUNARD module: UFlex-Debtors Trial Balance
    Current system time is 27-JAN-2010 13:10:22
    +-----------------------------
    | Starting concurrent program execution...
    +-----------------------------
    Arguments
    P_START_DATE='1999/01/01 00:00:00'
    P_END_DATE='31-JAN-09'
    P_CHART_OF_ACCOUNTS_ID='50268'
    P_ORG_ID='103'
    XML_REPORTS_XENVIRONMENT is :
    /applprod/oracle/prdora/8.0.6/guicommon6/tk60/admin/Tk2Motif_UTF8.rgb
    XENVIRONMENT is set to /applprod/oracle/prdora/8.0.6/guicommon6/tk60/admin/Tk2Motif_UTF8.rgb
    Current NLS_LANG and NLS_NUMERIC_CHARACTERS Environment Variables are :
    American_America.UTF8
    REP-0495: Internal Error - Unable to tokenize the query.
    Report Builder: Release 6.0.8.25.0 - Production on Wed Jan 27 13:10:30 2010
    (c) Copyright 1999 Oracle Corporation. All rights reserved.
    Enter Username:
    Start of log messages from FND_FILE
    End of log messages from FND_FILE
    Program exited with status 1
    Concurrent Manager encountered an error while running Oracle*Report for your concurrent request 1929569.
    Review your concurrent request log and/or report output file for more detailed information.
    Executing request completion options...
    Finished executing request completion options.
    Concurrent request completed
    Current system time is 27-JAN-2010 13:10:49
    Thanks
    Rahul

    I suggest opening a case with Cisco TAC.  This could be an issue with the device itself.
    Please remember to select a correct answer and rate helpful posts

  • Problem with PDFBox-0.7.3 library - Runtime Error

    Hello,
    The problem is inside the method "chamaConversor".
    " conversor.pdfToText(arquivoPdf,arquivoTxt);" make a file.txt from one file.pdf. After that it don?t return the control to "ConstrutorDeTemplate2.java", and show the following error message:
    Exception in thread "AWT-EventQueue-O" java.lang.NoClassDefFoundError : org/fontbox/afm/FontMetric
    at org.pdfbox.pdmodel.font.PDFont.getAFM (PDFont.java:334)
    I am using the NetBeans IDE 5.5.
    I have added all of these libraries below to my project from c:\Program Files\netbeans-5.5\PDFBox-0.7.3\external:
    * FontBox-0.1.0-dev.jar
    * ant.jar
    * bcmail-jdk14-132.jar
    * junit.jar
    * bcprov-jdk14-132.jar
    * lucene-core-2.0.0.jar
    * checkstyle-all-4.2.jar
    * lucene-demos-2.0.0.jar
    and PDFBox-0.7.3.jar from c:\Program Files\netbeans-5.5\PDFBox-0.7.3\lib.
    There are no more jar from PDFBox-0.7.3 directory.
    All of these libraries are in "Compile-time Libraries" option in Project Properties. Should I add they to "Run-time Libraries" option?
    What is going on?
    Thank you!
      * ConstrutorDeTemplate2.java
      * Created on 11 de Agosto de 2007, 14:54
      * @author
    package br.unifacs.dis2007.template2;
    // Java core packages
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.text.*;
    import java.util.*;
    // Java extension packages
    import javax.swing.*;
    import org.pdfbox.*;
    public class ConstrutorDeTemplate2 extends JFrame
        implements ActionListener {
        private JTextField enterField;
        private JTextArea outputArea;
        private BufferedWriter out;
        private String word;
        private PdfToText conversor = new PdfToText();
        // ajusta a interface do usu?rio
        public ConstrutorDeTemplate2()
           super( "Testing class File" );
           enterField = new JTextField("Digite aqui o nome do arquivo :" );
           enterField.addActionListener( this );
           outputArea = new JTextArea();
           ScrollPane scrollPane = new ScrollPane();
           scrollPane.add( outputArea );
           Container container = getContentPane();
           container.add( enterField, BorderLayout.NORTH );
           container.add( scrollPane, BorderLayout.CENTER );
           setSize( 400, 400 );
           show();
        // Exibe as informa??es sobre o arquivo especificado pelo usu?rio
        public void actionPerformed( ActionEvent actionEvent )
           File name = new File( actionEvent.getActionCommand() );
           // Se o arquivo existe, envia para a sa?da as informa??es sobre ele
           if ( name.exists() ) {
              outputArea.setText(
                 name.getName() + " exists\n" +
                 ( name.isFile () ?
                    "is a file\n" : "is not a file\n" ) +
                 ( name.isDirectory() ?
                    "is a directory\n" : "is not a directory\n" ) +
                 ( name.isAbsolute() ? "is absolute path\n" :
                    "is not absolute path\n" ) +
                 "Last modified: " + name.lastModified() +
                 "\nLength: " + name.length () +
                 "\nPath: " + name.getPath() +
                 "\nAbsolute path: " + name.getAbsolutePath() +
                 "\nParent: " + name.getParent() );
              // informa??o de sa?da se "name" ? um arquivo
              if ( name.isFile() ) {
                 String nameString = String.valueOf(name.getPath());
                 String nameTeste = new String(nameString);
                 if (nameString.endsWith(".pdf"))
                     nameTeste = chamaConversor(nameString);
                 else
                     if (nameString.endsWith(".doc"))
                         nameTeste = chamaConversorDoc(nameString); // chama conversor de arquivos DOC
                     else
                         if (nameString.endsWith(".txt"))
                             nameTeste = nameString;
                 // se o arquivo termina com ".txt"           
                 if (nameTeste.endsWith(".txt"))
                     // acrescenta conte?do do arquivo ? ?rea de sa?da
                     try {
                         // Create the tokenizer to read from a file
                         FileReader rd = new FileReader(nameTeste);
                         StreamTokenizer st = new StreamTokenizer(rd);
                         // Prepare the tokenizer for Java-style tokenizing rules
                         st.parseNumbers();
                         st.wordChars('_', '_');
                         st.eolIsSignificant (true);
                         // If whitespace is not to be discarded, make this call
                         st.ordinaryChars(0, ' ');
                         // These calls caused comments to be discarded
                         st.slashSlashComments(true);
                         st.slashStarComments(true);
                         // Parse the file
                         int token = st.nextToken();
                         String word_ant = "";
                         outputArea.append( " \n" );
                         out = new BufferedWriter(new FileWriter(nameTeste, true));
                         while (token != StreamTokenizer.TT_EOF) {
                             token = st.nextToken();
                             if (token == StreamTokenizer.TT_EOL){
                                 //out.write(word);
                                 out.flush();
                                 out = new BufferedWriter(new FileWriter(nameTeste, true));
                                 //outputArea.append( word + "\n" );
                                 // out.append ( "\n" );
                             switch (token) {
                             case StreamTokenizer.TT_NUMBER:
                                 // A number was found; the value is in nval
                                 double num = st.nval;
                                 break;
                             case StreamTokenizer.TT_WORD:
                                 // A word was found; the value is in sval
                                 word = st.sval;
                                 //   if (word_ant.equals("a") || word_ant.equals("an") || word_ant.equals("the") || word_ant.equals("The") || word_ant.equals("An"))
                                 outputArea.append( word.toString() + " \n " );
                                // out.append( word + "   " );
                                 //     word_ant = word;
                                 break;
                             case '"':
                                 // A double-quoted string was found; sval contains the contents
                                 String dquoteVal = st.sval;
                                 break;
                             case '\'':
                                 // A single-quoted string was found; sval contains the contents
                                 String squoteVal = st.sval;
                                 break;
                             case StreamTokenizer.TT_EOL:
                                 // End of line character found
                                 break;
                             case StreamTokenizer.TT_EOF:
                                 // End of file has been reached
                                 break;
                             default:
                                 // A regular character was found; the value is the token itself
                                 char ch = (char)st.ttype;
                                 break;
                             } // fim do switch
                         } // fim do while
                         rd.close();
                         out.close();
                     } // fim do try
                     // process file processing problems
                     catch( IOException ioException ) {
                         JOptionPane.showMessageDialog( this,
                         "FILE ERROR",
                         "FILE ERROR", JOptionPane.ERROR_MESSAGE );
                 } // fim do if da linha 92 - testa se o arquivo ? do tipo texto
              } // fim do if da linha 78 - testa se ? um arquivo
              // output directory listing
              else if ( name.isDirectory() ) {
                     String directory[] = name.list();
                 outputArea.append( "\n\nDirectory contents:\n");
                 for ( int i = 0; i < directory.length; i++ )
                    outputArea.append( directory[ i ] + "\n" );
              } // fim do else if da linha 184 - testa se ? um diret?rio
           } // fim do if da linha 62 - testa se o arquivo existe
           // not file or directory, output error message
           else {
              JOptionPane.showMessageDialog( this,
                 actionEvent.getActionCommand() + " Does Not Exist",
                 "ERROR", JOptionPane.ERROR_MESSAGE );
        }  // fim do m?todo actionPerformed
        // m?todo que chama o conversor
        public String chamaConversor(String arquivoPdf){
            String arquivoTxt = new String(arquivoPdf);
            arquivoTxt = arquivoPdf.replace(".pdf", ".txt");
            try {
                conversor.pdfToText(arquivoPdf,arquivoTxt);
            catch (Exception ex) {
                ex.printStackTrace();
            return (arquivoTxt);
        // executa a aplica??o
        public static void main( String args[] )
           ConstrutorDeTemplate2 application = new ConstrutorDeTemplate2();
           application.setDefaultCloseOperation (
              JFrame.EXIT_ON_CLOSE );
        } // fim do m?todo main
    }  // fim da classe ExtratorDeSubstantivos2
      * PdfToText.java
      * Created on 11 de Agosto de 2007, 10:57
      * To change this template, choose Tools | Template Manager
      * and open the template in the editor.
    //package br.unifacs.dis2007.template2;
      * @author www
    package br.unifacs.dis2007.template2;
    import java.io.File;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.OutputStreamWriter;
    import java.io.Writer;
    import java.net.MalformedURLException;
    import java.net.URL ;
    import org.pdfbox.pdmodel.PDDocument;
    import org.pdfbox.pdmodel.encryption.AccessPermission;
    import org.pdfbox.pdmodel.encryption.StandardDecryptionMaterial;
    import org.pdfbox.util.PDFText2HTML;
    import org.pdfbox.pdmodel.font.PDFont.* ;
    import org.pdfbox.util.PDFTextStripper;
    import org.pdfbox.util.*;
    import org.pdfbox.pdmodel.*;
    public class PdfToText
        public void pdfToText( String pdfFile, String textFile) throws Exception
                Writer output = null;
                PDDocument document = null;
                try
                    try
                        //basically try to load it from a url first and if the URL
                        //is not recognized then try to load it from the file system.
                        URL url = new URL( pdfFile );
                        document = PDDocument.load( url );
                        String fileName = url.getFile();
                        if( textFile == null && fileName.length () >4 )
                            File outputFile =
                                new File( fileName.substring( 0,fileName.length() -4 ) + ".txt" );
                            textFile = outputFile.getName();
                    catch( MalformedURLException e )
                        document = PDDocument.load( pdfFile );
                        if( textFile == null && pdfFile.length() >4 )
                            textFile = pdfFile.substring( 0,pdfFile.length() -4 ) + ".txt";
                       //use default encoding
                      output = new OutputStreamWriter( new FileOutputStream( textFile ) );
                    PDFTextStripper stripper = null;
                    stripper = new PDFTextStripper();
                    stripper.writeText( document, output );
                finally
                    if( output != null )
                        output.close();
                    if( document != null )
                        document.close();
                }//finally
            }//end funcao
     

    All of these libraries are in "Compile-time
    Libraries" option in Project Properties. Should I add
    they to "Run-time Libraries" option?Yes

  • I am getting a basic error in AppletPanel.

    Hello Friends,
    I am new to Java3D. Was surfing the web to find out a way as how to have a map of a city in 3d view and came across this code by a certain Mr. Daniel Selman... I am pasting his code as well as the error i am getting when i am trying to run it using eclipse...
    Copyright (C) 2001   Daniel Selman
    First distributed with the book "Java 3D Programming"
    by Daniel Selman and published by Manning Publications.
    http://manning.com/selman
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
    as published by the Free Software Foundation, version 2.
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
    The license can be found on the WWW at:
    http://www.fsf.org/copyleft/gpl.html
    Or by writing to:
    Free Software Foundation, Inc.,
    59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
    Authors can be contacted at:
    Daniel Selman: [email protected]
    If you make changes you think others would like, please
    contact one of the authors or someone at the
    www.j3d.org web site.
    * This example creates a 3D fly-over of the city of Boston. The viewer is
    * animated using a RotPosScaleTCBSplinePathInterpolator as well as 3
    * helicopters. The example uses PointSounds attached to the helicopters to
    * generate 3D spatial audio.
    import java.applet.Applet;
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.Component;
    import java.awt.Dimension;
    import java.awt.Frame;
    import java.awt.GraphicsConfigTemplate;
    import java.awt.GraphicsDevice;
    import java.awt.GraphicsEnvironment;
    import java.awt.image.BufferedImage;
    import java.io.File;
    import java.io.InputStream;
    import java.net.URL;
    import java.util.Enumeration;
    import java.util.Vector;
    import javax.media.j3d.Alpha;
    import javax.media.j3d.Appearance;
    import javax.media.j3d.AudioDevice;
    import javax.media.j3d.Background;
    import javax.media.j3d.BackgroundSound;
    import javax.media.j3d.Behavior;
    import javax.media.j3d.BoundingSphere;
    import javax.media.j3d.Bounds;
    import javax.media.j3d.BranchGroup;
    import javax.media.j3d.Canvas3D;
    import javax.media.j3d.ColoringAttributes;
    import javax.media.j3d.DistanceLOD;
    import javax.media.j3d.GeometryArray;
    import javax.media.j3d.GraphicsConfigTemplate3D;
    import javax.media.j3d.Group;
    import javax.media.j3d.ImageComponent2D;
    import javax.media.j3d.Locale;
    import javax.media.j3d.MediaContainer;
    import javax.media.j3d.Node;
    import javax.media.j3d.PhysicalBody;
    import javax.media.j3d.PhysicalEnvironment;
    import javax.media.j3d.PointSound;
    import javax.media.j3d.QuadArray;
    import javax.media.j3d.Shape3D;
    import javax.media.j3d.Sound;
    import javax.media.j3d.Switch;
    import javax.media.j3d.Texture;
    import javax.media.j3d.Transform3D;
    import javax.media.j3d.TransformGroup;
    import javax.media.j3d.View;
    import javax.media.j3d.ViewPlatform;
    import javax.media.j3d.VirtualUniverse;
    import javax.media.j3d.WakeupCondition;
    import javax.media.j3d.WakeupCriterion;
    import javax.media.j3d.WakeupOnCollisionEntry;
    import javax.media.j3d.WakeupOnCollisionExit;
    import javax.media.j3d.WakeupOr;
    import javax.swing.JButton;
    import javax.swing.JPanel;
    import javax.swing.JSlider;
    import javax.swing.event.ChangeEvent;
    import javax.swing.event.ChangeListener;
    import javax.vecmath.Color3f;
    import javax.vecmath.Point2f;
    import javax.vecmath.Point3d;
    import javax.vecmath.Point3f;
    import javax.vecmath.Quat4f;
    import javax.vecmath.Vector3d;
    import javax.vecmath.Vector3f;
    import javax.vecmath.Vector4f;
    import com.sun.j3d.audioengines.javasound.JavaSoundMixer;
    import com.sun.j3d.loaders.Scene;
    import com.sun.j3d.loaders.objectfile.ObjectFile;
    import com.sun.j3d.utils.applet.MainFrame;
    import com.sun.j3d.utils.behaviors.interpolators.RotPosScaleTCBSplinePathInterpolator;
    import com.sun.j3d.utils.behaviors.interpolators.TCBKeyFrame;
    import com.sun.j3d.utils.geometry.Primitive;
    import com.sun.j3d.utils.geometry.Sphere;
    import com.sun.j3d.utils.image.TextureLoader;
    * This example uses a Spline Interpolator to animate a fly-over the city of
    * Boston. The city is rendered using satellite images with a Level of Detail
    * behavior. The scene includes a number of moving helicopters, each with an
    * associated sound.
    public class SplineInterpolatorTest extends Java3dApplet {
      // size of the 3D window - enlage on powerful systems
      private static int m_kWidth = 200;
      private static int m_kHeight = 200;
      // a shared appearance for the buildings we create
      private Appearance m_BuildingAppearance = null;
      // the size of the high resolution "world".
      // the world is centered at 0,0,0 and extends
      // to +- LAND_WIDTH in the x direction and
      //+- LAND_LENGTH in the z direction.
      // These dimensions are loosely based on pixel
      // coordinates from the texture images
      private static final float LAND_WIDTH = 180;
      private static final float LAND_LENGTH = 180;
      // the satellite images used as textures have
      // been manually edited so that the water in the
      // images corresponds to the following RGB values.
      // this allows the application to avoid creating
      // buildings in the water!
      private static final float WATER_COLOR_RED = 0;
      private static final float WATER_COLOR_GREEN = 57;
      private static final float WATER_COLOR_BLUE = 123;
      public SplineInterpolatorTest() {
        initJava3d();
      // scale eveything so we can use pixel coordinates
      protected double getScale() {
        return 0.1;
      protected int getCanvas3dWidth(Canvas3D c3d) {
        return m_kWidth;
      protected int getCanvas3dHeight(Canvas3D c3d) {
        return m_kHeight;
      protected Bounds createApplicationBounds() {
        m_ApplicationBounds = new BoundingSphere(new Point3d(0.0, 0.0, 0.0),
            10.0);
        return m_ApplicationBounds;
      // we want a texture mapped background of a sky
      protected Background createBackground() {
        // add the sky backdrop
        Background back = new Background();
        back.setApplicationBounds(getApplicationBounds());
        BranchGroup bgGeometry = new BranchGroup();
        // create an appearance and assign the texture image
        Appearance app = new Appearance();
        Texture tex = new TextureLoader("sky.gif", this).getTexture();
        app.setTexture(tex);
        Sphere sphere = new Sphere(1.0f, Primitive.GENERATE_TEXTURE_COORDS
            | Primitive.GENERATE_NORMALS_INWARD, app);
        bgGeometry.addChild(sphere);
        back.setGeometry(bgGeometry);
        return back;
      // this controls how close to a helicopter we can
      // be and still hear it. If the helicopters sound
      // scheduling bounds intersect our ViewPlatformActivationRadius
      // the sound of the helicopter is potentially audible.
      protected float getViewPlatformActivationRadius() {
        return 20;
      // creates the objects within our world
      protected BranchGroup createSceneBranchGroup() {
        BranchGroup objRoot = super.createSceneBranchGroup();
        // create a root TG in case we need to scale the scene
        TransformGroup objTrans = new TransformGroup();
        objTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
        objTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
        Transform3D t3d = new Transform3D();
        objTrans.setTransform(t3d);
        Group hiResGroup = createLodLand(objTrans);
        createBuildings(objTrans);
        createHelicopters(objTrans);
        // connect
        objRoot.addChild(objTrans);
        return objRoot;
      // we create 2 TransformGroups above the ViewPlatform:
      // the first merely applies a scale, while the second
      // has a RotPosScaleTCBSplinePathInterpolator attached
      // so that the viewer of the scene is animated along
      // a spline curve.
      public TransformGroup[] getViewTransformGroupArray() {
        TransformGroup[] tgArray = new TransformGroup[2];
        tgArray[0] = new TransformGroup();
        tgArray[1] = new TransformGroup();
        Transform3D t3d = new Transform3D();
        t3d.setScale(getScale());
        t3d.invert();
        tgArray[0].setTransform(t3d);
        // create an Alpha object for the Interpolator
        Alpha alpha = new Alpha(-1, Alpha.INCREASING_ENABLE
            | Alpha.DECREASING_ENABLE, 0, 0, 25000, 4000, 100, 20000, 5000,
            50);
        // ensure the Interpolator can access the TG
        tgArray[1].setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
        try {
          // create the Interpolator and load the keyframes from disk
          RotPosScaleTCBSplinePathInterpolator splineInterpolator = Utils
              .createSplinePathInterpolator(new UiAlpha(alpha),
                  tgArray[1], new Transform3D(), new URL(
                      getWorkingDirectory(),
                      "rotate_viewer_spline.xls"));
          // set the scheduling bounds and attach to the scenegraph
          splineInterpolator.setSchedulingBounds(getApplicationBounds());
          tgArray[1].addChild(splineInterpolator);
        } catch (Exception e) {
          System.err.println(e.toString());
        return tgArray;
      // overidden so that the example can use audio
      protected AudioDevice createAudioDevice(PhysicalEnvironment pe) {
        return new JavaSoundMixer(pe);
      // creates a Switch group that contains two versions
      // of the world - the first is a high resolution version,
      // the second if a lower resolution version.
      public Group createLodLand(Group g) {
        Switch switchNode = new Switch();
        switchNode.setCapability(Switch.ALLOW_SWITCH_WRITE);
        Group hiResGroup = createLand(switchNode);
        createEnvirons(switchNode);
        // create a DistanceLOD that will select the child of
        // the Switch node based on distance. Here we are selecting
        // child 0 (high res) if we are closer than 180 units to
        // 0,0,0 and child 1 (low res) otherwise.
        float[] distanceArray = { 180 };
        DistanceLOD distanceLod = new DistanceLOD(distanceArray);
        distanceLod.setSchedulingBounds(getApplicationBounds());
        distanceLod.addSwitch(switchNode);
        g.addChild(distanceLod);
        g.addChild(switchNode);
        return hiResGroup;
      // creates a high resolution representation of the world.
      // a single texture mapped square and a larger (water colored)
      // square to act as a horizon.
      public Group createLand(Group g) {
        Land land = new Land(this, g, ComplexObject.GEOMETRY
            | ComplexObject.TEXTURE);
        Group hiResGroup = land.createObject(new Appearance(), new Vector3d(),
            new Vector3d(LAND_WIDTH, 1, LAND_LENGTH), "boston.gif", null,
            null);
        Appearance app = new Appearance();
        app.setColoringAttributes(new ColoringAttributes(
            WATER_COLOR_RED / 255f, WATER_COLOR_GREEN / 255f,
            WATER_COLOR_BLUE / 255f, ColoringAttributes.FASTEST));
        Land base = new Land(this, hiResGroup, ComplexObject.GEOMETRY);
        base.createObject(app, new Vector3d(0, -5, 0), new Vector3d(
            4 * LAND_WIDTH, 1, 4 * LAND_LENGTH), null, null, null);
        return hiResGroup;
      // creates a low resolution version of the world and
      // applies the low resolution satellite image
      public Group createEnvirons(Group g) {
        Land environs = new Land(this, g, ComplexObject.GEOMETRY
            | ComplexObject.TEXTURE);
        return environs.createObject(new Appearance(), new Vector3d(),
            new Vector3d(2 * LAND_WIDTH, 1, 2 * LAND_LENGTH),
            "environs.gif", null, null);
      // returns true if the given x,z location in the world
      // corresponds to water in the satellite image
      protected boolean isLocationWater(BufferedImage image, float posX,
          float posZ) {
        Color color = null;
        float imageWidth = image.getWidth();
        float imageHeight = image.getHeight();
        // range from 0 to 1
        float nPixelX = (posX + LAND_WIDTH) / (2 * LAND_WIDTH);
        float nPixelY = (posZ + LAND_LENGTH) / (2 * LAND_LENGTH);
        // rescale
        nPixelX *= imageWidth;
        nPixelY *= imageHeight;
        if (nPixelX >= 0 && nPixelX < imageWidth && nPixelY >= 0
            && nPixelY < imageHeight) {
          color = new Color(image.getRGB((int) nPixelX, (int) nPixelY));
          return (color.getBlue() >= WATER_COLOR_BLUE
              && color.getGreen() <= WATER_COLOR_GREEN && color.getRed() <= WATER_COLOR_RED);
        return false;
      // creates up to 120 building objects - ensures that
      // buildings are not positioned over water.
      public Group createBuildings(Group g) {
        m_BuildingAppearance = new Appearance();
        BranchGroup bg = new BranchGroup();
        Texture tex = new TextureLoader("boston.gif", this).getTexture();
        BufferedImage image = ((ImageComponent2D) tex.getImage(0)).getImage();
        final int nMaxBuildings = 120;
        for (int n = 0; n < nMaxBuildings; n++) {
          Cuboid building = new Cuboid(this, bg, ComplexObject.GEOMETRY
              | ComplexObject.TEXTURE);
          float posX = (int) Utils.getRandomNumber(0, LAND_WIDTH);
          float posZ = (int) Utils.getRandomNumber(0, LAND_LENGTH);
          if (isLocationWater(image, posX, posZ) == false) {
            building.createObject(m_BuildingAppearance, new Vector3d(posX,
                0, posZ), new Vector3d(Utils.getRandomNumber(3, 2),
                Utils.getRandomNumber(8, 7), Utils
                    .getRandomNumber(3, 2)), "house.gif", null,
                null);
        g.addChild(bg);
        return bg;
      // creates three helicopters
      public void createHelicopters(Group g) {
        for (int n = 0; n < 3; n++)
          createHelicopter(g);
      // edit the positions of the clipping
      // planes so we don't clip on the front
      // plane prematurely
      protected double getBackClipDistance() {
        return 50.0;
      protected double getFrontClipDistance() {
        return 0.1;
      // creates a single helicopter object
      public Group createHelicopter(Group g) {
        BranchGroup bg = new BranchGroup();
        Helicopter heli = new Helicopter(this, bg, ComplexObject.GEOMETRY
            | ComplexObject.SOUND);
        heli.createObject(new Appearance(), new Vector3d(Utils.getRandomNumber(
            0, LAND_WIDTH), Utils.getRandomNumber(15, 5), Utils
            .getRandomNumber(0, LAND_LENGTH)), new Vector3d(10, 10, 10),
            null, "heli.wav", null);
        g.addChild(bg);
        return bg;
      public static void main(String[] args) {
        SplineInterpolatorTest splineInterpolatorTest = new SplineInterpolatorTest();
        splineInterpolatorTest.saveCommandLineArguments(args);
        new MainFrame(splineInterpolatorTest, m_kWidth, m_kHeight);
    * Copyright (C) 2001 Daniel Selman
    * First distributed with the book "Java 3D Programming" by Daniel Selman and
    * published by Manning Publications. http://manning.com/selman
    * This program is free software; you can redistribute it and/or modify it under
    * the terms of the GNU General Public License as published by the Free Software
    * Foundation, version 2.
    * This program is distributed in the hope that it will be useful, but WITHOUT
    * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
    * details.
    * The license can be found on the WWW at: http://www.fsf.org/copyleft/gpl.html
    * Or by writing to: Free Software Foundation, Inc., 59 Temple Place - Suite
    * 330, Boston, MA 02111-1307, USA.
    * Authors can be contacted at: Daniel Selman: [email protected]
    * If you make changes you think others would like, please contact one of the
    * authors or someone at the www.j3d.org web site.
    * Java3dApplet
    * Base class for defining a Java 3D applet. Contains some useful methods for
    * defining views and scenegraphs etc.
    * @author Daniel Selman
    * @version 1.0
    abstract class Java3dApplet extends Applet {
      public static int m_kWidth = 300;
      public static int m_kHeight = 300;
      protected String[] m_szCommandLineArray = null;
      protected VirtualUniverse m_Universe = null;
      protected BranchGroup m_SceneBranchGroup = null;
      protected Bounds m_ApplicationBounds = null;
      //  protected com.tornadolabs.j3dtree.Java3dTree m_Java3dTree = null;
      public Java3dApplet() {
      public boolean isApplet() {
        try {
          System.getProperty("user.dir");
          System.out.println("Running as Application.");
          return false;
        } catch (Exception e) {
        System.out.println("Running as Applet.");
        return true;
      public URL getWorkingDirectory() throws java.net.MalformedURLException {
        URL url = null;
        try {
          File file = new File(System.getProperty("user.dir"));
          System.out.println("Running as Application:");
          System.out.println("   " + file.toURL());
          return file.toURL();
        } catch (Exception e) {
        System.out.println("Running as Applet:");
        System.out.println("   " + getCodeBase());
        return getCodeBase();
      public VirtualUniverse getVirtualUniverse() {
        return m_Universe;
      //public com.tornadolabs.j3dtree.Java3dTree getJ3dTree() {
      //return m_Java3dTree;
      public Locale getFirstLocale() {
        java.util.Enumeration e = m_Universe.getAllLocales();
        if (e.hasMoreElements() != false)
          return (Locale) e.nextElement();
        return null;
      protected Bounds getApplicationBounds() {
        if (m_ApplicationBounds == null)
          m_ApplicationBounds = createApplicationBounds();
        return m_ApplicationBounds;
      protected Bounds createApplicationBounds() {
        m_ApplicationBounds = new BoundingSphere(new Point3d(0.0, 0.0, 0.0),
            100.0);
        return m_ApplicationBounds;
      protected Background createBackground() {
        Background back = new Background(new Color3f(0.9f, 0.9f, 0.9f));
        back.setApplicationBounds(createApplicationBounds());
        return back;
      public void initJava3d() {
        //  m_Java3dTree = new com.tornadolabs.j3dtree.Java3dTree();
        m_Universe = createVirtualUniverse();
        Locale locale = createLocale(m_Universe);
        BranchGroup sceneBranchGroup = createSceneBranchGroup();
        ViewPlatform vp = createViewPlatform();
        BranchGroup viewBranchGroup = createViewBranchGroup(
            getViewTransformGroupArray(), vp);
        createView(vp);
        Background background = createBackground();
        if (background != null)
          sceneBranchGroup.addChild(background);
        //    m_Java3dTree.recursiveApplyCapability(sceneBranchGroup);
        //  m_Java3dTree.recursiveApplyCapability(viewBranchGroup);
        locale.addBranchGraph(sceneBranchGroup);
        addViewBranchGroup(locale, viewBranchGroup);
        onDoneInit();
      protected void onDoneInit() {
        //  m_Java3dTree.updateNodes(m_Universe);
      protected double getScale() {
        return 1.0;
      public TransformGroup[] getViewTransformGroupArray() {
        TransformGroup[] tgArray = new TransformGroup[1];
        tgArray[0] = new TransformGroup();
        // move the camera BACK a little...
        // note that we have to invert the matrix as
        // we are moving the viewer
        Transform3D t3d = new Transform3D();
        t3d.setScale(getScale());
        t3d.setTranslation(new Vector3d(0.0, 0.0, -20.0));
        t3d.invert();
        tgArray[0].setTransform(t3d);
        return tgArray;
      protected void addViewBranchGroup(Locale locale, BranchGroup bg) {
        locale.addBranchGraph(bg);
      protected Locale createLocale(VirtualUniverse u) {
        return new Locale(u);
      protected BranchGroup createSceneBranchGroup() {
        m_SceneBranchGroup = new BranchGroup();
        return m_SceneBranchGroup;
      protected View createView(ViewPlatform vp) {
        View view = new View();
        PhysicalBody pb = createPhysicalBody();
        PhysicalEnvironment pe = createPhysicalEnvironment();
        AudioDevice audioDevice = createAudioDevice(pe);
        if (audioDevice != null) {
          pe.setAudioDevice(audioDevice);
          audioDevice.initialize();
        view.setPhysicalEnvironment(pe);
        view.setPhysicalBody(pb);
        if (vp != null)
          view.attachViewPlatform(vp);
        view.setBackClipDistance(getBackClipDistance());
        view.setFrontClipDistance(getFrontClipDistance());
        Canvas3D c3d = createCanvas3D();
        view.addCanvas3D(c3d);
        addCanvas3D(c3d);
        return view;
      protected PhysicalBody createPhysicalBody() {
        return new PhysicalBody();
      protected AudioDevice createAudioDevice(PhysicalEnvironment pe) {
        JavaSoundMixer javaSoundMixer = new JavaSoundMixer(pe);
        if (javaSoundMixer == null)
          System.out.println("create of audiodevice failed");
        return javaSoundMixer;
      protected PhysicalEnvironment createPhysicalEnvironment() {
        return new PhysicalEnvironment();
      protected float getViewPlatformActivationRadius() {
        return 100;
      protected ViewPlatform createViewPlatform() {
        ViewPlatform vp = new ViewPlatform();
        vp.setViewAttachPolicy(View.RELATIVE_TO_FIELD_OF_VIEW);
        vp.setActivationRadius(getViewPlatformActivationRadius());
        return vp;
      protected Canvas3D createCanvas3D() {
        GraphicsConfigTemplate3D gc3D = new GraphicsConfigTemplate3D();
        gc3D.setSceneAntialiasing(GraphicsConfigTemplate.PREFERRED);
        GraphicsDevice gd[] = GraphicsEnvironment.getLocalGraphicsEnvironment()
            .getScreenDevices();
        Canvas3D c3d = new Canvas3D(gd[0].getBestConfiguration(gc3D));
        c3d.setSize(getCanvas3dWidth(c3d), getCanvas3dHeight(c3d));
        return c3d;
      protected int getCanvas3dWidth(Canvas3D c3d) {
        return m_kWidth;
      protected int getCanvas3dHeight(Canvas3D c3d) {
        return m_kHeight;
      protected double getBackClipDistance() {
        return 100.0;
      protected double getFrontClipDistance() {
        return 1.0;
      protected BranchGroup createViewBranchGroup(TransformGroup[] tgArray,
          ViewPlatform vp) {
        BranchGroup vpBranchGroup = new BranchGroup();
        if (tgArray != null && tgArray.length > 0) {
          Group parentGroup = vpBranchGroup;
          TransformGroup curTg = null;
          for (int n = 0; n < tgArray.length; n++) {
            curTg = tgArray[n];
            parentGroup.addChild(curTg);
            parentGroup = curTg;
          tgArray[tgArray.length - 1].addChild(vp);
        } else
          vpBranchGroup.addChild(vp);
        return vpBranchGroup;
      protected void addCanvas3D(Canvas3D c3d) {
        setLayout(new BorderLayout());
        add(c3d, BorderLayout.CENTER);
        doLayout();
      protected VirtualUniverse createVirtualUniverse() {
        return new VirtualUniverse();
      protected void saveCommandLineArguments(String[] szArgs) {
        m_szCommandLineArray = szArgs;
      protected String[] getCommandLineArguments() {
        return m_szCommandLineArray;
    * Utils
    * @author Daniel Selman
    * @version 1.0
    class Utils {
      // convert an angular rotation about an axis to a Quaternion
      static Quat4f createQuaternionFromAxisAndAngle(Vector3d axis, double angle) {
        double sin_a = Math.sin(angle / 2);
        double cos_a = Math.cos(angle / 2);
        // use a vector so we can call normalize
        Vector4f q = new Vector4f();
        q.x = (float) (axis.x * sin_a);
        q.y = (float) (axis.y * sin_a);
        q.z = (float) (axis.z * sin_a);
        q.w = (float) cos_a;
        // It is necessary to normalise the quaternion
        // in case any values are very close to zero.
        q.normalize();
        // convert to a Quat4f and return
        return new Quat4f(q);
      // convert three rotations about the Euler axes to a Quaternion
      static Quat4f createQuaternionFromEuler(double angleX, double angleY,
          double angleZ) {
        // simply call createQuaternionFromAxisAndAngle
        // for each axis and multiply the results
        Quat4f qx = createQuaternionFromAxisAndAngle(new Vector3d(1, 0, 0),
            angleX);
        Quat4f qy = createQuaternionFromAxisAndAngle(new Vector3d(0, 1, 0),
            angleY);
        Quat4f qz = createQuaternionFromAxisAndAngle(new Vector3d(0, 0, 1),
            angleZ);
        // qx = qx * qy
        qx.mul(qy);
        // qx = qx * qz
        qx.mul(qz);
        return qx;
      static public double getRandomNumber(double basis, double random) {
        return basis + ((float) Math.random() * random * 2f) - (random);
      static public double getRandomNumber(double basis, double random,
          double scale) {
        double value = basis + ((float) Math.random() * random * 2f) - (random);
        return value * scale;
      static public StringBuffer readFile(URL urlFile) {
        // allocate a temporary buffer to store the input file
        StringBuffer szBufferData = new StringBuffer();
        Vector keyFramesVector = new Vector();
        try {
          InputStream inputStream = urlFile.openStream();
          int nChar = 0;
          // read the entire file into the StringBuffer
          while (true) {
            nChar = inputStream.read();
            // if we have not hit the end of file
            // add the character to the StringBuffer
            if (nChar != -1)
              szBufferData.append((char) nChar);
            else
              // EOF
              break;
          inputStream.close();
        } catch (Exception e) {
          System.err.println(e.toString());
          return null;
        return szBufferData;
      static public RotPosScaleTCBSplinePathInterpolator createSplinePathInterpolator(
          Alpha alpha, TransformGroup tg, Transform3D axis, URL urlKeyframes) {
        TCBKeyFrame[] keyFrames = readKeyFrames(urlKeyframes);
        if (keyFrames != null)
          return new RotPosScaleTCBSplinePathInterpolator(alpha, tg, axis,
              keyFrames);
        return null;
      static public TCBKeyFrame[] readKeyFrames(URL urlKeyframes) {
        StringBuffer szBufferData = readFile(urlKeyframes);
        if (szBufferData == null)
          return null;
        Vector keyFramesVector = new Vector();
        // create a tokenizer to tokenize the input file at whitespace
        java.util.StringTokenizer tokenizer = new java.util.StringTokenizer(
            szBufferData.toString());
        // each keyframe is defined as follows
        // - knot (0 >= k <= 1)
        // - position (x,y,z)
        // - rotation (rx,ry,rz)
        // - scale (x,y,z)
        // - tension (-1 >= t <= 1)
        // - continuity (-1 >= c <= 1)
        // - bias (-1 >= b <= 1)
        // - linear (int - 0 or 1)
        while (true) {
          try {
            float knot = Float.parseFloat(tokenizer.nextToken());
            float posX = Float.parseFloat(tokenizer.nextToken());
            float posY = Float.parseFloat(tokenizer.nextToken());
            float posZ = Float.parseFloat(tokenizer.nextToken());
            float rotX = Float.parseFloat(tokenizer.nextToken());
            float rotY = Float.parseFloat(tokenizer.nextToken());
            float rotZ = Float.parseFloat(tokenizer.nextToken());
            float scaleX = Float.parseFloat(tokenizer.nextToken());
            float scaleY = Float.parseFloat(tokenizer.nextToken());
            float scaleZ = Float.parseFloat(tokenizer.nextToken());
            float tension = Float.parseFloat(tokenizer.nextToken());
            float continuity = Float.parseFloat(tokenizer.nextToken());
            float bias = Float.parseFloat(tokenizer.nextToken());
            int linear = Integer.parseInt(tokenizer.nextToken());
            TCBKeyFrame keyframe = new TCBKeyFrame(knot, linear,
                new Point3f(posX, posY, posZ),
                createQuaternionFromEuler(rotX, rotY, rotZ),
                new Point3f(scaleX, scaleY, scaleZ), tension,
                continuity, bias);
            keyFramesVector.add(keyframe);
          } catch (Exception e) {
            break;
        // create the return structure and populate
        TCBKeyFrame[] keysReturn = new TCBKeyFrame[keyFramesVector.size()];
        for (int n = 0; n < keysReturn.length; n++)
          keysReturn[n] = (TCBKeyFrame) keyFramesVector.get(n);
        // return the array
        return keysReturn;
    //this class defines an Alpha class that returns a random
    //value every N milliseconds.
    class UiAlpha extends Alpha implements ChangeListener {
      protected Alpha m_Alpha = null;
      protected float m_AlphaValue = 0.5f;
      JButton m_Button = null;
      boolean m_bAuto = true;
      public UiAlpha(Alpha alpha) {
        m_Alpha = alpha;
        Frame frame = new Frame("Alpha Control Panel");
        JPanel panel = new JPanel();
        frame.add(panel);
        addUiToPanel(panel);
        frame.pack();
        frame.setSize(new Dimension(400, 80));
        frame.validate();
        frame.setVisible(true);
      protected void addUiToPanel(JPanel panel) {
        JSlider slider = new JSlider();
        slider.addChangeListener(this);
        panel.add(slider);
        m_Button = new JButton("Auto");
        m_Button.addChangeListener(this);
        panel.add(m_Button);
      public void stateChanged(ChangeEvent e) {
        if (e.getSource() instanceof JSlider) {
          m_AlphaValue = ((JSlider) e.getSource()).getValue() / 100.0f;
          m_bAuto = false;
        } else {
          m_bAuto = true;
      // core method override
      // returns the Alpha value for a given time
      public float value(long time) {
        if (m_bAuto == true)
          return m_Alpha.value(time);
        return m_AlphaValue;
    class Land extends ComplexObject {
      public static final float WIDTH = 1.0f;
      public static final float LENGTH = 1.0f;
      public static final float HEIGHT = 0.0f;
      public Land(Component comp, Group g, int nFlags) {
        super(comp, g, nFlags);
      protected Group createGeometryGroup(Appearance app, Vector3d position,
          Vector3d scale, String szTextureFile, String szSoundFile) {
        int nFlags = GeometryArray.COORDINATES | GeometryArray.NORMALS;
        if ((m_nFlags & TEXTURE) == TEXTURE)
          nFlags |= Geom                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            

    If this is not your document class, since button1 is not created within the class, there is nothing provided to reference it as an external object.  You need to pass in a reference to it.

  • Error while activating the scenario

    Dear All,
    When I am activating my scenario, its throwing the following error, plz suggest how this can be resolved:
    Activation of the change list canceled
    Check result for <b>Message Mapping cXML_PS_File_Mail |</b> urn:ukedi:orderrequest:webapp: 
    Starting compilation 
    Source code has syntax error:  <b>D:/usr/sap/XD1/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Map255e3150d38611dbbd79001279934b36/source/com/sap/xi/tf/_cXML_PS_File_Mail_.java:360: cannot resolve symbol symbol : variable To
    location: class com.sap.xi.tf._cXML_PS_File_Mail_
    StringTokenizer st=new StringTokenizer(To,";");
    ^
    1 error</b>
    Warm Regards,
    N.Jain

    Hi nishu,
        could you explain your input and what you are expecting as output.
        The string tokenizer has implemented in three ways:
         StringTokenizer(String str)
         StringTokenizer(String str, String delim)
         StringTokenizer(String str, String delim, boolean returnDelims)
        Please any of the above based on your requirement.
      Hope I am clear.
      Thanks and Regards,
      Chandu....

  • Error in StringTokenizer

    I am trying to run this code that I got from a textbook. The only thing that I changed was the name of the file that was to be read in. It was "inventory.dat" and I changed it to "clients.txt".
    The code compiled fine but when I went to run it I got the following error:
    Exception in thread "main" java.util.NoSuchElementException
    at java.util.StringTokenizer.nextToken(Unknown Source)
    at CheckInventory.man(CheckInventory.java:34)
    What does this error mean? And why didn't it work? I took it right out of my textbook. Any insight would be appreciated.
    //  CheckInventory.java       Author: Lewis/Loftus
    //  Demonstrates the use of a character file input stream.
    import java.io.*;
    import java.util.StringTokenizer;
    public class CheckInventory
       //  Reads data about a store inventory from an input file,
       //  creating an array of InventoryItem objects, then prints them.
       public static void main (String[] args)
          final int MAX = 100;
          InventoryItem[] items = new InventoryItem[MAX];
          StringTokenizer tokenizer;
          String line, name, file = "clients.txt";
          int units, count = 0;
          float price;
          try
             FileReader fr = new FileReader ("clients.txt");
             BufferedReader inFile = new BufferedReader (fr);
             line = inFile.readLine();
             while (line != null)
                tokenizer = new StringTokenizer (line);
                name = tokenizer.nextToken();
                try
                   units = Integer.parseInt (tokenizer.nextToken());
                   price = Float.parseFloat (tokenizer.nextToken());
                   items[count++] = new InventoryItem (name, units, price);
                catch (NumberFormatException exception)
                   System.out.println ("Error in input. Line ignored:");
                   System.out.println (line);
                line = inFile.readLine();
             inFile.close();
             for (int scan = 0; scan < count; scan++)
                System.out.println (items[scan]);
          catch (FileNotFoundException exception)
             System.out.println ("The file " + file + " was not found.");
          catch (IOException exception)
             System.out.println (exception);
    //  InventoryItem.java       Author: Lewis/Loftus
    //  Represents an item in the inventory.
    import java.text.DecimalFormat;
    public class InventoryItem
       private String name;
       private int units;    // number of available units of this item
       private float price;  // price per unit of this item
       private DecimalFormat fmt;
       //  Sets up this item with the specified information.
       public InventoryItem (String itemName, int numUnits, float cost)
          name = itemName;
          units = numUnits;
          price = cost;
          fmt = new DecimalFormat ("0.##");
       //  Returns information about this item as a string.
       public String toString()
          return name + ":\t" + units + " at " + price + " = " +
                 fmt.format ((units * price));
    }clients.txt
    Widget 14 3.35
    spoke 132 0.32
    wrap 58 1.92
    thing 28 4.17

    when I went to run it I got the following error:
    Exception in thread "main" java.util.NoSuchElementException
    at java.util.StringTokenizer.nextToken(Unknown Source)
    at CheckInventory.man(CheckInventory.java:34)
    What does this error mean?It means that when you called nextToken() there weren't any more tokens. In other words the input line didn't contain as many tokens as you expected.

  • Error creating a web service standalone proxy

    Hi all,
    I'm new with Sap Netweaver Developer Studio (SNDS), so sorry if the question is too easy.
    I wuold create a stand alone proxy for a web service created by a function module in R3.
    I follow the help of SNDS but the project doesn't compile. The error is
    This compilation unit indirectly references the missing type com.sap.engine.lib.xml.parser.tokenizer.XMLTokenReader (typically some required class file is referencing a type outside the classpath)     ZhrWsStrAnagInd2.java     AnagIndStandAloneProxy/src/com/capitalia/webservice/anagind/types/p1     line 0
    Where I can find this package? or the problem is another?
    thanks for any help,
    enzo

    Hi Enzo,
    Add <Install folder of Netweaver developer Studio>\SAP\JDT\eclipse\plugins\com.sap.tc.ap\comp\SAP_BUILDT\DCs\sap.com\tc\bi\xml\_comp\gen\default\public\def\lib\java\sapxmltoolkit.jar to classpath of your project (hope you know how to do it).
    Best regards, Maksim Rashchynski.

  • Error in XSLT mapping while using string functions

    Hi All,
    While using tokenize() and substring-before() functions in XSLT mapping,we are getting an error.The error message is Unexpected symbol "" So while using string functions in XSLT mapping do we have to use any header functions.
    Please through light on syntax etc.,of string functions in XSLT.
    Thanx in advance,
    Lokesh Dhulipudi
    Edited by: LOKESH DHULIPUDI on Dec 27, 2007 7:32 AM

    Hi,
    Hope you have gone thru this help:
    http://w3schools.com/xsl/default.asp
    Rgds, Moorthy

  • XSLT Enhancement with Java, Tokenize Functionality

    I tried the following requirement using EXSLT with no luck. Is there any other alternative to tokenize in XSLT 1.0.
    The syntax i have here is  
    <xsl:for-each select="tokenize($this/Field1,',')">
           <xsl:variable name="f1v" select="."/>
         <xsl:for-each select="tokenize($this/Field2,'\|')">
              <xsl:variable name="f2v" select="."/>
              <xsl:for-each select="tokenize($this/Field3,'\|')">
                        <xsl:variable name="f3v" select="."/>
    There are multiple for-each based on tokens
    I am leaning towards to Enhancing XSLT with Java Function. As i have less experience with Java, can anybody help me with the code that can be used by XSLT for Tokenize functionality.
    I have written something like following. I still have errors to fix. But i am not sure about having resultSet or return at the end, to make sure all the tokens were sent to XSLT.
    public class MyStringToken
         public static void main(String [] args)
              String str = "sssd;wwer;ssswwwwdwwwwwwwwwww;wwwwe";
              String delimiter = ";";
              MyStringToken my = new MyStringToken();
              my.getTokens(str,delimiter);
         public void getTokens(String str,String delimiter)
              StringTokenizer st = new StringTokenizer(str,delimiter);
              while(st.hasMoreElements())
                   try
                        String delString = new String(st.nextElement().toString());
                        return (delString);
                   catch(Exception e)
                        e.printStackTrace();
    Any help is appreciated

    Hi,
    I have been searching about, and I have found the next example that maybe can help you, It's a template to tokenize in XSLT 1.0 from the web [http://stackoverflow.com/questions/1018974/tokenizing-and-sorting-with-xslt-1-0]
    <xsl:template name="tokenize">
      <xsl:param name="string" />
      <xsl:param name="delimiter" select="' '" />
      <xsl:choose>
        <xsl:when test="$delimiter and contains($string, $delimiter)">
          <token>
            <xsl:value-of select="substring-before($string, $delimiter)" />
          </token>
          <xsl:text> </xsl:text>
          <xsl:call-template name="tokenize">
            <xsl:with-param name="string"
                            select="substring-after($string, $delimiter)" />
            <xsl:with-param name="delimiter" select="$delimiter" />
          </xsl:call-template>
        </xsl:when>
        <xsl:otherwise>
          <token><xsl:value-of select="$string" /></token>
          <xsl:text> </xsl:text>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Also I have found the next example of use tokenize in EXSLT from [http://exslt.org/str/functions/tokenize/index.html] It can be that inI your tests you are not using "str:tokenize", no?
    <xsl:template match="a">
       <xsl:apply-templates />
    </xsl:template>
    <xsl:template match="*">
       <xsl:value-of select="." />
          <xsl:value-of select="str:tokenize(string(.), ' ')" />
       <xsl:value-of select="str:tokenize(string(.), '')" />
       <xsl:for-each select="str:tokenize(string(.), ' ')">
          <xsl:value-of select="." />
       </xsl:for-each>
       <xsl:apply-templates select="*" />
    </xsl:template>
    I hope that helps you.
    Best.
    Jorge

  • Txt file read in- StringTokenizer- Try Block Catch for errors

    Hello
    So I am having a few issues with a school project. First is with my ReadWithScanner. It does not read in the file giving me a NullPointerException error on the line <Scanner in = new>. I have tried a few other read in files and they do not seem to be working.
    I am also stuck on the logic on the try block catch statement. How does a person set up a �custom� try block that looks for errors like the ones below? I have attempted to start in the commented code.
    The text file has to read in 1000 individual lines of code and are separated by �;� and should be separated into tokens with the StringTokenizer class what I attempted to do below also. Both are mere attempts and need help�
    This is some what of the logic I thought of doing
    1.Read the first line in first with the scanner class
    2.use delimiter separated by �;�
    3.Tokenizer the line into separate tokens- invoiceCode, fName, lName�
    4.Check classes- check Name, check Date, checkPrice, checkPrice, checkGenre, checkShippingDate invoiceCode = "Error Code" checkInvoiceCode(String invoiceCode)checkName(String name), checkPrice(String price), checkGenre(String genre)
    5.Apply the regular expressions to each try block statement
    a.Assign a letter to each error for example if invoice was to short it would be assigned a letter A
    b.If invoice does have the right characters it would be assigned B
    c.If name has to few words it would be assigned D
    d.�
    This is an example of a good field from the text file
    XYG726;Smith,Mr. John M.;29.96;comedy;101008;100604
    Not so good line
    Lu15;Will, Mark;50.00;Science;030305;030807
    The file should then be printed out in the program not to a text file. It only needs to print the invoice number and error code letter assignment.
    If you have any questions feel free to let me know. Thanks for all or any help you have to offer.
    Invoice
    Three upper case letters followed by three digits
    Regular Expression "[A-Z]{3}[0-9]{3}"
    Customer Name
    Should be in the form: last name followed by a <,> optional title (Mrs. Mrs�) then first name optional middle initial Titles must be
    So regular expression something like �[a-z][A-Z]+([A-Z]{1}?[a-z][./})+[a-z][A-Z]�
    Sale Price
    Two decimal digits to the left of the decimal point. The price should not have a leading zero.
    Regular Expression [0-9]{2}*./[0-9]
    Genre
    The genre should only contain lowercase letters. Regular expression �[a-z]�
    ShipDate and Order Date-
    Must be standard dates- MMDDYY. The order date and shipping date has to be after today�s date. Regular expression �[0-9]{2}+[0-9]{2}+[0-9]{2}�
    package Project3;
    import java.util.StringTokenizer;
    import java.util.regex.Matcher;
    import java.util.regex.Pattern;
    import java.io.*;
    import java.util.Scanner;
    public class ReadWithScanner {
    private final File fFile;
    public static void main (String args[]){
    Scanner in = new Scanner(new File("e:\\work_space_java\\Project\\Package3\\movie.txt"));
    Scanner.processLineByLine();
    public ReadWithScanner(String aFileName){
    fFile = new File(aFileName);
    public final void processLineByLine(){
    try {
    //use a Scanner to get each line
    Scanner scanner = new Scanner(fFile);
    while ( scanner.hasNextLine() ){
    processLine( scanner.nextLine() );
    scanner.close();
    catch (IOException ex){
    protected void processLine(String aLine){
    //use a second scanner again to raed the content of each line
    Scanner scanner = new Scanner(aLine);
    scanner.useDelimiter(";");
    if (scanner.hasNext() ){
    //read each file?
    String name = scanner.next();
    String value = scanner.next();
    else {
    scanner.close();
    //Token Names that are seperated
    StringTokenizer st;
    String invoiceCode = st.nextToken();
    String fname = st.nextToken();
    String lname = st.nextToken();
    String price = st.nextToken();
    String genre = st.nextToken();
    String orderDate = st.nextToken();
    String shipDate = st.nextToken();
    String invoiceCode;
    invoiceCode = "A" checkInvoiceCode(String invoiceCode);
    Pattern p = Pattern.compile("[a-z]{6}[A-Z]{6}[0-9]{6}");
    Matcher m = p.matcher(invoiceCode);
    p.matcher(invoiceCode);
    if(m.matches()) {
    System.out.println(invoiceCode);
    else {
    System.out.println ("A");
    try
    invoiceCode = Integer.parseInt(String);
    catch (NumberFormatException e)
    { System.out.println ("B"); System.exit(1); }
    */

    I have made a quite a few updates to my code. Please look it over again. I have also made many comments to help with the logic. Once again if you have any questions please feel free to ask. Sorry about not using the tags before- I was no aware of them. Thanks for the advice sabre150.
    package Project3;
    import java.util.StringTokenizer;
    import java.util.regex.Matcher;
    import java.util.regex.Pattern;
    import java.io.*;
    import java.util.Scanner;
    public class ReadWithScanner {
         private final File fFile;
         public static void main (String args[]){
                   //read in text file from directory currently it can not read the file
                  Scanner in = new Scanner(new File("e:\\work_space_java\\Project\\Package3\\movie.txt"));
                  //Scans each line of the text in
                  Scanner.processLineByLine();
                //assigns new file name to file
                public ReadWithScanner(String aFileName){
                  fFile = new File(aFileName); 
                public final void processLineByLine(){
                  try {
                    //use a Scanner to get each line from the processLineByLine
                    Scanner scanner = new Scanner(fFile);
                    while ( scanner.hasNextLine() ){
                      processLine( scanner.nextLine() );
                    scanner.close();
                  catch (IOException ex){
                protected void processLine(String aLine){
                  //use a second scanner again to read the content of each line
                   //delmiter should then break each line in the text file into seperate "tokens"
                  Scanner scanner = new Scanner(aLine);
                  scanner.useDelimiter(";");
                  if (scanner.hasNext() ){
                       //reads each line from scanner
                    String name = scanner.next();
                  else {
                  scanner.close();
               /*Convert Tokens from Scanner into String Tokenizer with assigment to each variable
                * I am missing something
                * Need to convert each line read from the scanner (name variable) to the String
                * Tokenizer class
              //Tokens names now assigned a varaible
              StringTokenizer st;
              String invoice = st.nextToken();
              String name = st.nextToken();
              String price  = st.nextToken();
              String genre = st.nextToken();
              String orderDate = st.nextToken();
              String shipDate = st.nextToken();
          /*If statments (Try Block Statements?) with Regular Expressions
          * This is where I have the most issues on how to set up
          * "custom" try and block errors trying to match what I have
          * in the regular expressions. 
          * I believe try and catch statements
          * make this easier but I have used 'match' and 'pattern' with if
          * statments.  If try block statements are easier please show!
          * Regular Expressions may not be correct either
           invoice = checkInvoiceCode(invoice);
           //Defined cerita for Inovice are:
           //Error A = Invoice code is too short  
           //Error B = Invoice code does not have the right characters 
           //Error C = Invoice code digits are all zero
           //Checks for error A
           //Has at least six characters
            Pattern invoiceShort = Pattern.compile("{6}");
            Matcher shortInvoice = invoiceShort.matcher(invoice);
            p.matcher(invoiceCode);
            if(m.matches()) {
                 System.out.println(invoice);      
            else {
                 System.out.println ("A");
            //Checks for error B
            //3 Upper Case Letters followed by three numbers,
            Pattern rightChar = Pattern.compile("[A-Z]{3}[0-9]^0{3}");
            Matcher charRight = rightChar.matcher(invoice);
            p.matcher(invoiceCode);
            if(m.matches()) {
                 System.out.println(invoice);
            else {
                     System.out.println ("B");
            //Checks for error C
            //Where the last three digits are not all zeros
            Pattern notZero = Pattern.compile("*{3}^0{3}");
            Matcher ZeroNot = notZero.matcher(invoice);
            p.matcher(invoiceCode);
            if(m.matches()) {
                 System.out.println(invoice); 
                 else {
                     System.out.println ("C");
         //name = checkFullName(name);
         //Error D = Name field has fewer than two words
         //Error E = Name field has more than four words
         //Error F = Name field has no comma
         //Error G = Name field has a bad title 
         //Error H = Name field has a bad initial 
        /*Have a lot more to do...
        * Still need to go through the same if statement or Try Block statements with this data:
        *      String fname = st.nextToken();
              String lname = st.nextToken();
              String price  = st.nextToken();
              String genre = st.nextToken();
              String orderDate = st.nextToken();
              String shipDate = st.nextToken();
        * But for now I would like to see an example of an if statement I could use
        * (if mine is even right) or catch statement- the rest of the project we look
        * for similar certia as defined in the reg exp for invoice
         /*Writes to Report in the Console
         * Prints data into two columns:
         * Invoice Code and Error Type
         //Prints both column Headings
         private void columnHeadings ()
         System.out.println (padL("",5) +
         padL("Invoice",20) +padL("",20)+
         padL("Error Code",40));
         //movie is the name of the text file
         private void printMovie(Movie aReport) {
         System.out.println(aReport.getInvoiceCode()+"\t"+
               aReport.getErrorType()+"\t");
      *This method pads the string start to the length newLength leaving the
      *string left justified and returning the result.
      private String padL (String start, int newLength)
         String result = new String (start);
         while (result.length() <= newLength) result += " ";
         return result;
      } // end padL
       * This method pads the string start to the length newLength leaving the
       * string right justified and returning the result.
      private String padR (String start, int newLength)
         String result = new String (start);
         while (result.length() <= newLength) result = " " + result;
         return result;
    // end padRThanks a lot.

  • Error in XPath 2.0 expression

    Hi everybody,
    I am using XMLSPY to test a XPath expression:
    <xsl:value-of select="fn:tokenize('a b c', '\s')"></xsl:value-of>                                   
    But I get the error:
    "This file is not valid:
    Error in XPath 2.0 expression"
    Any ideas?
    Thanks, regards
    Mario

    http://help.sap.com/saphelp_nw04/helpdata/en/d6/e44fcf98baa24a9686a7643a33f26f/frameset.htm
    /people/prasadbabu.nemalikanti3/blog/2006/09/20/receiver-determination-based-on-the-payload-of-input-dataextended-xpathcontext-object
    /people/prasadbabu.nemalikanti3/blog/2006/03/30/xpath-functions-in-xslt-mapping
    Using substring in the XPATH expression for Receiver Determination

  • JSP compiler error (WL 4.5.1,  RH Linux 6.1, JDK 1.1.8)

    I am new to WebLogic, and have been trying to get it setup to serve JSP
    files. I followed the instructions in the documentation. However, when
    I try to access a JSP, I get the following errors. It looks like my
    java compiler doesn't like the syntax WebLogic uses to call the
    compiler. From the documentation, I have found that syntax is:
         java weblogic.jspc -d /working/directory /path/to/jsp/file
    I have tried this on the command line with the correct paths to my
    files, only to result in a series of class not found errors (e.g.,
    antlr.CharScanner, antlr.Tokenizer,
    com.sun.java.util.collections.ArrayList, etc.). I keep downloading more
    packages but everytime I try again, I need to download yet another
    class. I'm at the point where I cannot find the class it currently
    needs (antlr.Tokenizer).
    I have these questions:
    1. Should it really be this difficult & complicated to compile jsps?
    2. Are these problems happening because I'm running the WL server on
    Linux?
    3. Why are the errors so totally different between running a JSP on the
    web and running one on the command line?
    4. What should I do?
    The log below contains the error messages when attempting to compile
    from the web browser:
    Tue Feb 15 13:45:48 EST 2000:<I> <ServletContext-Servlets>
    weblogic.servlet.JSPServlet: Generated java file:
    /usr/local/weblogic/myserver/classfiles/jsp_servlet/_jax/_test.java
    Tue Feb 15 13:45:49 EST 2000:<E> <ServletContext-Servlets>
    weblogic.servlet.JSPServlet: Compilation of
    /usr/local/weblogic/myserver/classfiles/jsp_servlet/_jax/_test.java
    failed: -d: illegal argument
    Usage: java [-options] class
    where options include:
    -help print out this message
    -version print out the build version
    -fullversion print out the full version information
    -v -verbose turn on verbose mode
    -debug enable remote JAVA debugging
    -noasyncgc don't allow asynchronous garbage collection
    -verbosegc print a message when garbage collection occurs
    -noclassgc disable class garbage collection
    -cs -checksource check if source is newer when loading classes
    -ss<number> set the maximum native stack size for any thread
    -oss<number> set the maximum Java stack size for any thread
    -ms<number> set the initial Java heap size
    -mx<number> set the maximum Java heap size
    -D<name>=<value> set a system property
    -classpath <directories separated by colons>
    list directories in which to look for classes
    -prof[:<file>] output profiling data to ./java.prof or ./<file>
    -verify verify all classes when read in
    -verifyremote verify classes read in over the network [default]
    -noverify do not verify any class
    -nojit disable JIT compiler
    DEFAULTS:
    -ss: 256K, -oss: 400K, -ms: 1M, -mx: 32M
    Tue Feb 15 13:45:49 EST 2000:<E> <ServletContext-Servlets>
    java.io.IOException: Compiler failed
    executable.exec([Ljava.lang.String;[/usr/local/jdk118/bin/java,
    -classpath,
    /usr/local/jdk118/lib/classes.zip:/usr/local/weblogic/classes/boot:/usr/local/weblogic/classes:/usr/local/weblogic/license:/usr/local/weblogic/lib/weblogicaux.jar:/usr/local/weblogic/myserver/serverclasses:/weblogic/myserver/servletclasses:/usr/local/weblogic/myserver/classfiles,
    -d, /usr/local/weblogic/myserver/classfiles,
    /usr/local/weblogic/myserver/classfiles/jsp_servlet/_jax/_test.java])
    <and so on>
    If it helps, I will post the error messages from the command line, which
    are all, basically, class not found exceptions; I do not wish to make
    this an unnecessarily long email, though.
    Thank you for your help!
    Jacqui

    Run the command like this:
    java -classpath /opt/weblogic/classes:/opt/weblogic/lib/weblogicaux.jar:/usr/java/lib/classes.zip weblogic.jspc -d /working/directory /path/to/jsp/file
    Hope this helps,
    Robert
    Jacqui Maher wrote:
    I am new to WebLogic, and have been trying to get it setup to serve JSP
    files. I followed the instructions in the documentation. However, when
    I try to access a JSP, I get the following errors. It looks like my
    java compiler doesn't like the syntax WebLogic uses to call the
    compiler. From the documentation, I have found that syntax is:
    java weblogic.jspc -d /working/directory /path/to/jsp/file
    I have tried this on the command line with the correct paths to my
    files, only to result in a series of class not found errors (e.g.,
    antlr.CharScanner, antlr.Tokenizer,
    com.sun.java.util.collections.ArrayList, etc.). I keep downloading more
    packages but everytime I try again, I need to download yet another
    class. I'm at the point where I cannot find the class it currently
    needs (antlr.Tokenizer).
    I have these questions:
    1. Should it really be this difficult & complicated to compile jsps?
    2. Are these problems happening because I'm running the WL server on
    Linux?
    3. Why are the errors so totally different between running a JSP on the
    web and running one on the command line?
    4. What should I do?
    The log below contains the error messages when attempting to compile
    from the web browser:
    Tue Feb 15 13:45:48 EST 2000:<I> <ServletContext-Servlets>
    weblogic.servlet.JSPServlet: Generated java file:
    /usr/local/weblogic/myserver/classfiles/jsp_servlet/_jax/_test.java
    Tue Feb 15 13:45:49 EST 2000:<E> <ServletContext-Servlets>
    weblogic.servlet.JSPServlet: Compilation of
    /usr/local/weblogic/myserver/classfiles/jsp_servlet/_jax/_test.java
    failed: -d: illegal argument
    Usage: java [-options] class
    where options include:
    -help print out this message
    -version print out the build version
    -fullversion print out the full version information
    -v -verbose turn on verbose mode
    -debug enable remote JAVA debugging
    -noasyncgc don't allow asynchronous garbage collection
    -verbosegc print a message when garbage collection occurs
    -noclassgc disable class garbage collection
    -cs -checksource check if source is newer when loading classes
    -ss<number> set the maximum native stack size for any thread
    -oss<number> set the maximum Java stack size for any thread
    -ms<number> set the initial Java heap size
    -mx<number> set the maximum Java heap size
    -D<name>=<value> set a system property
    -classpath <directories separated by colons>
    list directories in which to look for classes
    -prof[:<file>] output profiling data to ./java.prof or ./<file>
    -verify verify all classes when read in
    -verifyremote verify classes read in over the network [default]
    -noverify do not verify any class
    -nojit disable JIT compiler
    DEFAULTS:
    -ss: 256K, -oss: 400K, -ms: 1M, -mx: 32M
    Tue Feb 15 13:45:49 EST 2000:<E> <ServletContext-Servlets>
    java.io.IOException: Compiler failed
    executable.exec([Ljava.lang.String;[/usr/local/jdk118/bin/java,
    -classpath,
    /usr/local/jdk118/lib/classes.zip:/usr/local/weblogic/classes/boot:/usr/local/weblogic/classes:/usr/local/weblogic/license:/usr/local/weblogic/lib/weblogicaux.jar:/usr/local/weblogic/myserver/serverclasses:/weblogic/myserver/servletclasses:/usr/local/weblogic/myserver/classfiles,
    -d, /usr/local/weblogic/myserver/classfiles,
    /usr/local/weblogic/myserver/classfiles/jsp_servlet/_jax/_test.java])
    <and so on>
    If it helps, I will post the error messages from the command line, which
    are all, basically, class not found exceptions; I do not wish to make
    this an unnecessarily long email, though.
    Thank you for your help!
    Jacqui

Maybe you are looking for

  • ME59N automatic PO

    Hi gurus, can anycbody please answer this? The user used ME59N to automatically create the PO from req. The system created the PO but for some reason it picked up DFPS, int ord type as the doc type for the PO. any ideas why this happened?This should

  • How can I secure/encrypt a file held on an external HD

    I would like to put items on my external wireless networked lacie HD which cannot be accessed by others who use it. I thought creating a disk image would work but after putting the files and transferring to the public folder on the HD, I want to dele

  • Cannot open LiveCycle protected pdf

    When trying the iOS reader to open a Livecycle DRM protected pdf, I get the following error (I'm obfuscating the server name on purpose) - "Access to this document is restricted by this remote server xxxxx.xxxxx.com, however we are unable to connect

  • IMovie cropping tops of still images in slideshow

    I've been bothered, or annoyed, by tops of my stills being cropped in the Ken Burns effect, when viewing my slideshows. Is there any way to ensure the whole image is seen? Ratio to be adhered to?

  • Cannot connect to Itunes/IApps

    I am trying to download a free app from the IApps store but everytime I put in my password I get the - "Cannot connect to Itunes"  Following some of the posts on this site I logged out of my account on Itunes and now I can't even get back in?  Can so