XML Schema Class Generator Problem compiling generated java programs

Hi,
I ran oracg on the po.xsd schema from X3Cs XML Schema Part 0: Primer which successfully generated the java codes. I ran into problems when I compile the generated classes. Here's what I'm getting:
C:\oracle\xml\xdk\demo\java\classgen\Po2>javac -classpath ".;C:\oracle\xml/lib/xmlparserv2.jar;C:\oracle\xml/lib/xschema.jar;C:\oracle\xml/l
ib/classgen.jar;.;C:\Program Files\VicunaJ521\java\lib\collections.jar;C:\Program Files\VicunaJ521\java\lib\vicunalite.jar;C:\Program Files\
XConverter\XConverter.jar;C:\Program Files\XConverter\IDLGenerator.jar; c:\jdk1.2.2\lib\dt.jar;c:\jdk1.2.2\lib\jvm.jar;c:\jdk1.2.2\lib\tools
.jar;c:\oracle\ora81\jdbc\lib\classes12.zip;c:\oracle\ora81\jdbc\nls_charset12.zip;C:\oracle\xml\lib\classgen.jar;C:\oracle\xml\lib\xmlparse
rv2.jar" *.java
.\types\PurchaseOrderType.java:75: Type expected.
public void addComment(null.Comment thecomment)
^
.\types\Items.java:141: Type expected.
public void addComment(null.Comment thecomment)
^
2 errors
Running the demo which comes with oracles version of po.xsd was OK. What's the difference between the po.xsd from oracle and the po.xsd from W3C? Are there any W3C recommendation for XML Schema not supported by Oracle's class generator?

Which po.xsd do you use? Would you post it?
Thanks. Here's the copy of the po.xsd from the W3C website. (http://www.w3.org/TR/xmlschema-0/#po.xsd)
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:annotation>
<xsd:documentation xml:lang="en">
Purchase order schema for Example.com.
Copyright 2000 Example.com. All rights reserved.
</xsd:documentation>
</xsd:annotation>
<xsd:element name="purchaseOrder" type="PurchaseOrderType"/>
<xsd:element name="comment" type="xsd:string"/>
<xsd:complexType name="PurchaseOrderType">
<xsd:sequence>
<xsd:element name="shipTo" type="USAddress"/>
<xsd:element name="billTo" type="USAddress"/>
<xsd:element ref="comment" minOccurs="0"/>
<xsd:element name="items" type="Items"/>
</xsd:sequence>
<xsd:attribute name="orderDate" type="xsd:date"/>
</xsd:complexType>
<xsd:complexType name="USAddress">
<xsd:sequence>
<xsd:element name="name" type="xsd:string"/>
<xsd:element name="street" type="xsd:string"/>
<xsd:element name="city" type="xsd:string"/>
<xsd:element name="state" type="xsd:string"/>
<xsd:element name="zip" type="xsd:decimal"/>
</xsd:sequence>
<xsd:attribute name="country" type="xsd:NMTOKEN"
fixed="US"/>
</xsd:complexType>
<xsd:complexType name="Items">
<xsd:sequence>
<xsd:element name="item" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="productName" type="xsd:string"/>
<xsd:element name="quantity">
<xsd:simpleType>
<xsd:restriction base="xsd:positiveInteger">
<xsd:maxExclusive value="100"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="USPrice" type="xsd:decimal"/>
<xsd:element ref="comment" minOccurs="0"/>
<xsd:element name="shipDate" type="xsd:date" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="partNum" type="SKU" use="required"/>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<!-- Stock Keeping Unit, a code for identifying products -->
<xsd:simpleType name="SKU">
<xsd:restriction base="xsd:string">
<xsd:pattern value="\d{3}-[A-Z]{2}"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>

Similar Messages

  • Compiling one java program by another

    hi ppl
    how to compile a java program by another java program by using javac command.
    that is prog A must compile prog B using " javac B.java" command

    Try com.sun.tools.javac.Main.
    You require JDK_HOME/lib/tools.jar in CLASSPATH.

  • Problem compilling a java file

    I've got problems using my jdk1.2 .
    When i try to compile a java file using ms-dos console or kawa program, appears this error text:
    Javaw.exe has generated an error it's gonna be closed by windows , you must restart the program.
    A error register is gonna be created.
    UI have to tell tha this is a free translation that the text appears in spanish.
    thanks a lot

    Maybe you should compile with javac.

  • XML schemas in subfolders problem

    We have a large number of XML schemas and have partitioned them into different folders. This means that imported schemas are often located in a relative directory e.g.
         <import namespace="http://www.xyz.com/schema/Staff" schemaLocation="../../Staff.xsd"/>
    However, when building a BPEL app in JDeveloper, the JDeveloper Web Content/Miscellaneous Files folder doesn't seem to have the facility to create sub-folders and I get validation errors when importing the schema alongside the ones it imports. I'm not an expert JDeveloper user - is there something I've missed?
    thanks Ash

    Thanks, but actually I've yet to find that problem, as I haven't even got to creating any jars or anything yet. To clarify:
    Simply using the "Import" button in the BPEL structure window in JDeveloper, you get a single prompt to browse for a schema.
    Once imported, it ends up in a Web Content/Miscellaneous Files folder alongside every other schema. So I get JDeveloper flagging errors because my schema references other schemas relative to directory folder e.g. "../../ref.xsd".

  • Problems of running java program by crontab in Linux

    I have a java application program which runs great when started in command line, or in shell script, or Perl. However, when it is started by crontab in Linux, it stops in the middle when images are to be generated. I guess there might be some settings I need to handle in order to run this java application by crontab. We tried to start the shell script or Perl program in which the java program was invoked, but still didn't work.
    This may be a littler stretching. Does anyone have similar experience and success?
    Thanks in advance.
    ljiang006

    Dear dpz,
    We have used JComponents. Here's the error message I got. Could you further suggest what to do in my crobtap (which is "11 14 * * * java -classpath /home/VeggieB VHpack.VegHealthFrac" ). Looking forward to your reply. Thanks. ljiang006.
    Generate data and image products ...
    Save calibrated (unsmoothed) NDVI and T into Product/NDT/
    Save initial early products into Product/Initial/
    Save temporary products into Product/Tempo/
    Save final update products into Product/Final/
    Save calibrated (unsmoothed) NDVI and T into: Product/NDT/ Exception in thread "main" java.lang.NoClassDefFoundError
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:130)
         at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:62)
         at sun.awt.motif.MToolkit.<clinit>(MToolkit.java:70)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:130)
         at java.awt.Toolkit$2.run(Toolkit.java:712)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:703)
         at java.awt.Component.getToolkitImpl(Component.java:826)
         at java.awt.Component.getToolkit(Component.java:810)
         at java.awt.Component.createImage(Component.java:2564)
         at VHpack.ImageGenerator.createDataImage(ImageGenerator.java:395)
         at VHpack.ImageGenerator.makeImage(ImageGenerator.java:288)
         at VHpack.ImageGenerator.saveImage(ImageGenerator.java:162)
         at VHpack.LVItoProduct.SaveProduct(LVItoProduct.java:146)
         at VHpack.LVItoProduct.generateProducts(LVItoProduct.java:61)
         at VHpack.NoGuiVeg.<init>(NoGuiVeg.java:94)
         at VHpack.VegHealthFrac.main(VegHealthFrac.java:34)

  • Problem compiling my first program; Please Help me!

    Please HELP, what am I doing wrong?
    For over 5hours I have been trying to figure out how to compile a simple Hello world program using sdk1.3.1_02/j2re1.3.1_02 and I am getting the following errors: helloworld.java:2 cannot resolve symbol
    symbol : class string
    location : class helloworld
    cannot reolve the string symbol
    symbol : class out
    location : package system
    I want to program in java so badly but I am trying to get my environment set so that I can take off. To compile my first program has been a disaster!!
    This is my path:
    SET PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\JDK1.3.1_02\BIN
    Thanks very much in advance
    ::(

    Java is case sensitive,
    use String instead of string. and System.out instead of system.out
    Sudha

  • Problem with running java program

    Hey again!
    I missed out some information in last posting.. here is the full description
    I have just installed 1.5.0_06 and have set paths and what otherwise is necessary to run the java programs. I was testing the install and run a standard HelloWorld.java program
    I got the following error:
    Exception in thread main java.lang.NoClassDefFoundError: HelloWorld
    what is wrong...
    Here is the entire HelloWorld.java
    public class HelloWorld
    public HelloWorld()
    System.out.println("Hello World");
    public static void main(String[] args)
    HelloWorld hw = new HelloWorld();
    I have checked that the path is correct too..
    Hopefully someone can help me!
    Anders

    Your Path is set, probably the problem is classpath.
    Change the cmd/command prompt to the directory that contains your HelloWorld.class file, verifying that it exists. If it does, issue this command from that directory:
    java -cp . HelloWorld
    Important: include the period and surrounding spaces
    If that works, you can learn about setting and using the classpath here:
    http://java.sun.com/j2se/1.5.0/docs/tooldocs/index.html#general
    By the way, just add a reply to your original post with the additional information, rather than creating another post. That eliminates duplication of replies.

  • Problems running a java program

    Hello,
    I have absolutely no java experience whatsoever, and I need to fix a program that suddenly stopped running properly after several years without problems. Basically, I have a perl script that calls a java program. Everytime I run this perl script from the web browser, the java program returns an internal error:
    # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://www.blackdown.org/cgi-bin/jdk # # Error ID: 5649525455414C53504143450E4350500024 # # Problematic Thread: prio=5 tid=0x804e680 nid=0x6d16 runnable #
    However, when I run the perl script command line, it runs fine. I added the -verbose option to the java call, and I discovered that the program stops running after it opens the .jar files but before it loads them .... these files have full read permissions, so I don't think that's the problem. Any ideas?
    Thanks!

    ...fix a program that suddenly stopped running properly after several years without problems.Which means either the program changed or the environment changed. I would guess the environment. The most likely possibilities: new version of the operating system, new version of perl, new version of java. Also possible: new version installed of any of the previous without removing older versions, new software not associated with the first, new mapped drives and/or changed env vars.

  • Can we get file name which we are compiling in java program

    Hi,
    I want to know if we can get filename(when compiling) or jarfile(when running) which we are compiling in the program itself.
    EX:java -jar myjar.jar
    How can I display jar file(i.e myjar.jar) in my program
    ex:sop("file which compiled is:"<filename>);

    can you rephrase the question in english, please!!

  • Problem with a java program "the game five in a row"

    http://leepoint.net/notes-java/examples/games/five/five.html
    how to run this program and c the output

    i.arnav wrote:
    no i want it in java programming only
    plz help me how to run it if thr are any errorsI'm having a difficult time understanding your posts. THR? The Hollywood Reporter? Total Hip Replacement?The High Road (firearms forum)?

  • Problems compiling FlagMaker1.java

    import java.awt.*;
    import java.awt.event.*;
    class FlagMaker1 extends Frame
         FlagMaker1 ()
              add ("Center", new Flag ());
              addWindowsListener(new WindowAdapter ()
              public void windowClosing(WindowEvent e)
              System.exit(0);
              setTitle ("A Flag!");
              setSize (300,200);
              setVisible (true);
    class Flag extends Canvas
         public void paint (Graphics g)
              g.setColor (Color.black);
              g.fillRect (40,40,200,40);
              g.setColor (Color.red);
              g.fillRect (40,80,200,40);
              g.setColor (Color.yellow);
              g.fillRect (40,120,200,40);
              g.setColor (Color.black);
              g.drawString ("Deutschland",100,180);
    compiling gives the following error:
    --------------------Configuration: sdk 1-4-1 <Default>----------------
    E:\SysEng\SysEng1\Java\FlagMaker1.java:9: cannot resolve symbol
    symbol : method addWindowsListener (<anonymous java.awt.event.WindowAdapter>)
    location: class FlagMaker1
              addWindowsListener(new WindowAdapter ()
    ^
    1 error

    aha ,,not a good mistake,you have to check you spelling~~
    addWindowListener(this)
    Robbies
    1.java IDE tool : JawaBeginer
    2.Java Jar tool : JavaJar
    http://www.pivotonic.com

  • Problem running a Java program

    Hi...I'm developing a CORBA project and I'm using java to implement it. I wrote a Hello World program and I could compile all my files (IDL files and all the generated .java files). But when I try to run my Server program I get the following error message:
    Exception in thread "main" java.lang.NoClassDefFoundError: HelloApp/_HelloImplBase
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:486)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
    at HelloStringifiedServer.main(HelloStringifiedServer.java:24)
    Can anyone please help me!
    Thanks in advance

    Sure, here is the Server code:
    // HelloStringifiedServer.java, stringified object reference version
    import java.io.*;
    import org.omg.CORBA.*;
    import HelloApp.*;
    public class HelloStringifiedServer {
    class HelloServant extends _HelloImplBase
    public String sayHello()
    return "\nHello world !!\n";
    public static void main(String args[])
    try{
    // create and initialize the ORB
    ORB orb = ORB.init(args, null);
    // create servant and register it with the ORB
    HelloServant helloRef = new HelloServant();
    orb.connect(helloRef);
    // stringify the helloRef and dump it in a file
    String str = orb.object_to_string(helloRef);
    String filename = System.getProperty("user.home")+
    System.getProperty("file.separator")+"HelloIOR";
    FileOutputStream fos = new FileOutputStream(filename);
    PrintStream ps = new PrintStream(fos);
    ps.print(str);
    ps.close();
    // wait for invocations from clients
    java.lang.Object sync = new java.lang.Object();
    synchronized (sync) {
    sync.wait();
    } catch (Exception e) {
    System.err.println("ERROR: " + e);
    e.printStackTrace(System.out);
    I get the previous error message when I try to run this file. Other files are those generated by the IDL compiler
    PS: Are you familiar with CORBA?

  • Some differences in Java settings giving me problems running a java program

    Hello,
    We have a Java app in our web-site. We haven't done that app our self and it has been working for quite some time.
    Now on my computer the java app loads just nicely.
    But for other users there java app crashes. So basically there has to be somekind of settings problem between.
    But we have checked the settings and I simply can't find the difference.
    The other users keep getting error that class not found.
    Debug print:
    security: Certificate has been verified with Internet Explorer ROOT certificates successfully
    security: Valid certificate from HTTPS server
    security: Adding certificate in Deployment session certificate store
    security: Added certificate in Deployment session certificate store
    security: Saving certificates in Deployment session certificate store
    security: Saved certificates in Deployment session certificate store
    network: Connecting http://site.xxx.com:443/ with proxy=DIRECT
    security: Loading certificates from Deployment session certificate store
    security: Loaded certificates from Deployment session certificate store
    security: Checking if certificate is in Deployment denied certificate store
    security: Checking if certificate is in Deployment session certificate store
    network: Cache entry not found [url: https://site.xxx.com/EMS/classes/chart/Chart/class.class, version: null]
    network: Connecting https://site.xxx.com/EMS/classes/chart/Chart/class.class with proxy=DIRECT
    network: Connecting http://site.xxx.com:443/ with proxy=DIRECT
    security: Loading certificates from Deployment session certificate store
    security: Loaded certificates from Deployment session certificate store
    security: Checking if certificate is in Deployment denied certificate store
    security: Checking if certificate is in Deployment session certificate store
    network: Connecting http://site.xxx.com:443/ with proxy=DIRECT
    security: Loading certificates from Deployment session certificate store
    security: Loaded certificates from Deployment session certificate store
    security: Checking if certificate is in Deployment denied certificate store
    security: Checking if certificate is in Deployment session certificate store
    basic: load: class chart/Chart.class not found.
    load: class chart/Chart.class not found.
    java.lang.ClassNotFoundException: chart.Chart.class
         at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Exception: java.lang.ClassNotFoundException: chart.Chart.class
    Ignored exception: java.lang.ClassNotFoundException: chart.Chart.class
    So you guys have any idea what setting could be wrong between my and the other users machines.
    We have Windows Xp sp3 and Internet Explorer 8 in use.
    I actually made a clean Xp install the otherday. Installing latest java and no security settings added from domain. Also I put the site on trusted sites and allowed all in IE. And I still got that error in that new clean Xp install. On my personal computer the Java app still works just fine. Unlucky the one who has done the Java app is not able to help us.

    Hello,
    I downloaded the jar-file and opened it with Winzip. The class in question was in the jar-file.
    I also put logging on in my computer where the App is working.
    My debug print:
    security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.
    security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws
    security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws
    security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy
    security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy
    security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy,com.sun.jnlp
    security: property package.definition value null
    security: property package.definition new value com.sun.javaws
    security: property package.definition value com.sun.javaws
    security: property package.definition new value com.sun.javaws,com.sun.deploy
    security: property package.definition value com.sun.javaws,com.sun.deploy
    security: property package.definition new value com.sun.javaws,com.sun.deploy,com.sun.jnlp
    security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy,com.sun.jnlp
    security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy,com.sun.jnlp,org.mozilla.jss
    security: property package.definition value com.sun.javaws,com.sun.deploy,com.sun.jnlp
    security: property package.definition new value com.sun.javaws,com.sun.deploy,com.sun.jnlp,org.mozilla.jss
    basic: Added progress listener: sun.plugin.util.GrayBoxPainter$GrayBoxProgressListener@291aff
    network: Cache entry found [url: https://site.xxx.com/EMS/classes/chart/Chart.class, version: null] prevalidated=false/0
    network: Connecting https://site.xxx.com/EMS/classes/chart/Chart.class with proxy=DIRECT
    network: Connecting http://site.xxx.com:443/ with proxy=DIRECT
    security: Loading Root CA certificates from C:\Program Files\Java\jre6\lib\security\cacerts
    security: Loaded Root CA certificates from C:\Program Files\Java\jre6\lib\security\cacerts
    security: Loading SSL Root CA certificates from C:\Program Files\Java\jre6\lib\security\cacerts
    security: Loaded SSL Root CA certificates from C:\Program Files\Java\jre6\lib\security\cacerts
    security: Loading Deployment SSL certificates from C:\Documents and Settings\me\Application Data\Sun\Java\Deployment\security\trusted.jssecerts
    security: Loaded Deployment SSL certificates from C:\Documents and Settings\me\Application Data\Sun\Java\Deployment\security\trusted.jssecerts
    security: Loading certificates from Deployment session certificate store
    security: Loaded certificates from Deployment session certificate store
    security: Loading certificates from Internet Explorer ROOT certificate store
    security: Loaded certificates from Internet Explorer ROOT certificate store
    security: Checking if certificate is in Deployment denied certificate store
    security: Checking if certificate is in Deployment session certificate store
    security: Checking if SSL certificate is in Deployment permanent certificate store
    network: Connecting https://site.xxx.com/EMS/classes/chart/Chart.class with cookie "__utma=63616955.207177272.1293600941.1293600941.1298453489.2; __utmz=63616955.1293600941.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utmb=63616955.5.10.1298453489; __utmc=63616955"
    security: Loading certificates from Deployment session certificate store
    security: Loaded certificates from Deployment session certificate store
    security: Checking if certificate is in Deployment denied certificate store
    security: Checking if certificate is in Deployment session certificate store
    security: Checking if SSL certificate is in Deployment permanent certificate store
    network: ResponseCode for https://site.xxx.com/EMS/classes/chart/Chart.class : 304
    network: Encoding for https://site.xxx.com/EMS/classes/chart/Chart.class : null
    network: Disconnect connection to https://site.xxx.com/EMS/classes/chart/Chart.class
    network: Cache entry not found [url: https://site.xxx.com/EMS/classes/, version: null]
    network: Cache entry found [url: https://site.xxx.com/EMS/classes/bar/Bar.class, version: null] prevalidated=false/0
    network: Connecting https://site.xxx.com/EMS/classes/bar/Bar.class with proxy=DIRECT
    network: Connecting https://site.xxx.com/EMS/classes/bar/Bar.class with cookie "__utma=63616955.207177272.1293600941.1293600941.1298453489.2; __utmz=63616955.1293600941.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utmb=63616955.5.10.1298453489; __utmc=63616955"
    network: ResponseCode for https://site.xxx.com/EMS/classes/bar/Bar.class : 304
    network: Encoding for https://site.xxx.com/EMS/classes/bar/Bar.class : null
    network: Disconnect connection to https://site.xxx.com/EMS/classes/bar/Bar.class
    network: Cache entry found [url: https://site.xxx.com/EMS/classes/coordaxes/CoordAxes.class, version: null] prevalidated=false/0
    network: Connecting https://site.xxx.com/EMS/classes/coordaxes/CoordAxes.class with proxy=DIRECT
    network: Connecting https://site.xxx.com/EMS/classes/coordaxes/CoordAxes.class with cookie "__utma=63616955.207177272.1293600941.1293600941.1298453489.2; __utmz=63616955.1293600941.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utmb=63616955.5.10.1298453489; __utmc=63616955"
    network: ResponseCode for https://site.xxx.com/EMS/classes/coordaxes/CoordAxes.class : 304
    network: Encoding for https://site.xxx.com/EMS/classes/coordaxes/CoordAxes.class : null
    network: Disconnect connection to https://site.xxx.com/EMS/classes/coordaxes/CoordAxes.class
    network: Cache entry found [url: https://site.xxx.com/EMS/classes/xaxial/XAxial.class, version: null] prevalidated=false/0
    network: Connecting https://site.xxx.com/EMS/classes/xaxial/XAxial.class with proxy=DIRECT
    network: Connecting https://site.xxx.com/EMS/classes/xaxial/XAxial.class with cookie "__utma=63616955.207177272.1293600941.1293600941.1298453489.2; __utmz=63616955.1293600941.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utmb=63616955.5.10.1298453489; __utmc=63616955"
    network: ResponseCode for https://site.xxx.com/EMS/classes/xaxial/XAxial.class : 304
    network: Encoding for https://site.xxx.com/EMS/classes/xaxial/XAxial.class : null
    network: Disconnect connection to https://site.xxx.com/EMS/classes/xaxial/XAxial.class
    network: Cache entry found [url: https://site.xxx.com/EMS/classes/serie/Serie.class, version: null] prevalidated=false/0
    network: Connecting https://site.xxx.com/EMS/classes/serie/Serie.class with proxy=DIRECT
    network: Connecting https://site.xxx.com/EMS/classes/serie/Serie.class with cookie "__utma=63616955.207177272.1293600941.1293600941.1298453489.2; __utmz=63616955.1293600941.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utmb=63616955.5.10.1298453489; __utmc=63616955"
    network: ResponseCode for https://site.xxx.com/EMS/classes/serie/Serie.class : 304
    network: Encoding for https://site.xxx.com/EMS/classes/serie/Serie.class : null
    network: Disconnect connection to https://site.xxx.com/EMS/classes/serie/Serie.class
    basic: Applet loaded.
    basic: Applet resized and added to parent container
    basic: PERF: AppletExecutionRunnable - applet.init() BEGIN ; jvmLaunch dt 151766 us, pluginInit dt 14982493 us, TotalTime: 15134259 us
    basic: Applet initialized
    basic: Removed progress listener: sun.plugin.util.GrayBoxPainter$GrayBoxProgressListener@291aff
    basic: Applet made visible
    basic: Starting applet
    basic: completed perf rollup
    basic: Applet started
    basic: Told clients applet is started
    NullPointerException in interval part
    NullPointerException in interval label part
    Lot more security messages in this.

  • Problem with small java program

    need some help with a small Java assignment I am doing.
    When I compile the code i get 2 errors they are
    invalid method declaration: return type required
    public CreateRandomFile() LINE 87
    ^
    cannot resolve symbol
    new CreateRandomFile(); LINE 112
    ^
    Any help is greatly appreciated
    **********CODE BEGINS HERE ***********************
    import javax.swing.*;
    import java.io.*;
    import BreezySwing.*;
    public class RandomTest extends GBFrame
    JLabel accLabel = addLabel("Account Number",1,1,1,1);
    IntegerField accField = addIntegerField(0,1,2,1,1);
    JLabel firstLabel = addLabel("First Name",2,1,1,1);
    JTextField firstField = addTextField("",2,2,1,1);
    JLabel lastLabel = addLabel("Last Name",3,1,1,1);
    JTextField lastField = addTextField("",3,2,1,1);
    JTextArea resultArea = addTextArea("",4,1,2,3);
    JButton acceptButton = addButton("Accept",7,1,2,1);
    JButton accessButton = addButton("Access",8,1,2,1);
    JButton clearButton = addButton("Clear",9,1,2,1);
    private RandomAccessFile file;
    public void buttonClicked(JButton buttonObj)
    if (buttonObj == acceptButton)
    else
    if (buttonObj == accessButton)
    else
    accField.setNumber(0);
    resultArea.setText("");
    firstField.setText("");
    lastField.setText("");
    private void openFile()
    FileOutputStream foStream = new FileOutputStream ("acc.dat");
    ObjectOutputStream doStream = new ObjectOutputStream (foStream);
    if ("acc.dat" == null || "acc.dat".equals(""))
    System.out.println("Invalid File Name");
    else
    try{
    file = new RandomAccessFile ("acc.dat","rw");
    catch (IOException e)
    System.out.println("File does not exist or Invalid File Name");
    private Record getRecord()
    Record record = new Record();
    int accountNumber;
    try{
    accountNumber = Integer.parseInt(accField.getText());
    if (accountNumber <1 || accountNumber >100)
    System.out.println("Account doesn't exist");
    return null;
    file.seek((accountNumber -1)*Record.size());
    record.read(file);
    catch (NumberFormatException nfe)
    System.out.println("Account does not exist");
    System.out.println("Invalid Number Format");
    catch (IOException io)
    System.out.println("Error reading file");
    return record;
    public createRandomFile() // <----- ERROR HERE
    Record blank = new Record();
    openFile();
    try{
    file = new RandomAccessFile("acc.dat", "rw");
    for (int i=0;i<100;i++)
    blank.write(file);
    System.exit(0);
    catch (IOException e )
    System.out.println("File doesn't exist");
    System.out.println("Invalid File Name");
    System.exit(1);
    public static void main(String args[])
    JFrame tpo = new RandomTest();
    tpo.setTitle("Assignment 1");
    tpo.setSize(200,330);
    tpo.setVisible(true);
    new createRandomFile(); // <--- ERROR HERE
    }

    I changed the things you suggested by have a new error of
    cannot resolve symbol
    symbol : method createRandomFile ()
    location: class javax.swing.JFrame
    tpo.createRandomFile();
    ^
    **************new code here***************************
    import javax.swing.*;
    import java.io.*;
    import BreezySwing.*;
    public class RandomTest extends GBFrame
         JLabel accLabel = addLabel("Account Number",1,1,1,1);
         IntegerField accField = addIntegerField(0,1,2,1,1);
         JLabel firstLabel = addLabel("First Name",2,1,1,1);
         JTextField firstField = addTextField("",2,2,1,1);
         JLabel lastLabel = addLabel("Last Name",3,1,1,1);
         JTextField lastField = addTextField("",3,2,1,1);
    JTextArea resultArea = addTextArea("",4,1,2,3);
    JButton acceptButton = addButton("Accept",7,1,2,1);
    JButton accessButton = addButton("Access",8,1,2,1);
         JButton clearButton = addButton("Clear",9,1,2,1);
         private RandomAccessFile file;
    public void buttonClicked(JButton buttonObj)
         if (buttonObj == acceptButton)
         else
         if (buttonObj == accessButton)
         else
         accField.setNumber(0);
         resultArea.setText("");
         firstField.setText("");
         lastField.setText("");
    private void openFile()
         FileOutputStream foStream = new FileOutputStream ("acc.dat");
         ObjectOutputStream doStream = new ObjectOutputStream (foStream);
         if ("acc.dat" == null || "acc.dat".equals(""))
         System.out.println("Invalid File Name");
         else
         try{
              file = new RandomAccessFile ("acc.dat","rw");
         catch (IOException e)
              System.out.println("File does not exist or Invalid File Name");
    private Record getRecord()
         Record record = new Record();
         int accountNumber;
         try{
              accountNumber = Integer.parseInt(accField.getText());
         if (accountNumber <1 || accountNumber >100)
              System.out.println("Account doesn't exist");
              return null;
         file.seek((accountNumber -1)*Record.size());
         record.read(file);
         catch (NumberFormatException nfe)
         System.out.println("Account does not exist");
         System.out.println("Invalid Number Format");
         catch (IOException io)
              System.out.println("Error reading file");
    return record;
    public void createRandomFile()
    Record blank = new Record();
    openFile();
    try{
         file = new RandomAccessFile("acc.dat", "rw");
         for (int i=0;i<100;i++)
         blank.write(file);
         System.exit(0);
    catch (IOException e )
         System.out.println("File doesn't exist");
         System.out.println("Invalid File Name");
         System.exit(1);     
    public static void main(String args[])
    JFrame tpo = new RandomTest();
    tpo.setTitle("Assignment 1");
    tpo.setSize(200,330);
    tpo.setVisible(true);
    tpo.createRandomFile();
    }     

  • Unable to compile my java program in TextPad or Eclipse

    Hello - Finals are next week and I have one last assignment due....and my harddrive crashed last week. I reinstalled everything and set environment variables. When I open my program in TextPad and press ctrl-1 to compile nothing happens. Nothing happens with ctrl-2 (to run) either.
    In eclipse, I open the files and try to run the java file with the main method but I get "Selection does not contain a main type" error! I don't know what to do and I am at a standstill and I failed finding helpful information on my own.
    Please help!
    import java.util.Scanner;
    import java.io.*;
    import java.util.ArrayList;
    public class BookPrinter {
         public static void main(String args)
              try
                   FileReader reader = new FileReader("input.txt");
                   Scanner in = new Scanner(reader);
                   String inputFile = "";
                   while(in.hasNext())
                        inputFile.concat(in.nextLine());
                   Book b = new Book(inputFile);
                   System.out.println("The book's size is: " + b.bookSize());
                   System.out.println("\nThe number of times \"the\" occurs in the book: " + b.count("the"));
                   System.out.println("\nThe longest word in the book: " + b.longest());
                   ArrayList<String> longList = b.allLongest();
                   System.out.println("\nThe words that are all the longest length: ");
                   while(longList.size() > 0)
                        for(String e: longList)
                             System.out.println(e);
              catch(FileNotFoundException exception)
                   System.out.println("Error processing file: " + exception);
    }

    This:
    public static void main(String args)is wrong.
    You want this:
    public static void main(String[] args)Understand the difference?

Maybe you are looking for