Compilation Error in basic java class

Hello,
I am newbie. And, I have developed following java classes. But the child class is results in error. Below is step by step event. What am I doing wrong?
Step 1. Created a compiled class Shirt(parent). No issues
public class Shirt {
public int shirtID =0;
public String description = "description required";
// color codes
public char colorCode = 'U';
public double price = 0.0;
public int quantityInStock = 0;
// methods
public void displayShirtInformation() {
   System.out.println("Shirt ID: " + shirtID);
   System.out.println("Shirt description:" + description);
   System.out.println("Color Code:" + colorCode);
   System.out.println("Shirt price: " + price);
   System.out.println("Quantity in Stock :" + quantityInStock);
} // end of method
} // end of class
Step 2. Child class results in compilation error
public class ShirtTest{
public static void main (String[] args) {
     Shirt myShirt;
     myShirt = new Shirt();
     myShirt.displayShirtInformation();
Step 3. Error show below
C:Java>javac ShirtTest.java
ShirtTest.java:4: cannot find symbol
symbol  : class Shirt
location: class ShirtTest
     Shirt myShirt;
     ^
ShirtTest.java:5: cannot find symbol
symbol  : class myShirt
location: class ShirtTest
     myShirt = new myShirt();
                   ^
2 errors Thanks D,

Hello all. I am in a similar boat as far as getting the error message:
javac ShirtTest.java
ShirtTest.java:7: cannot find symbol
symbol  : class Shirt
location: class shirt.ShirtTest
        Shirt privShirt = new Shirt();
        ^
ShirtTest.java:7: cannot find symbol
symbol  : class Shirt
location: class shirt.ShirtTest
        Shirt privShirt = new Shirt();
                              ^
2 errorsMy Shirt.java is as follows(which compiles just fine):
     1  package shirt;
     2
     3  public class Shirt {
     4
     5      private char colorCode = 'U';
     6
     7      public char getColorCode() {
     8          return colorCode;
     9      }
    10
    11      public void setColorCode (char newCode) {
    12          colorCode = newCode;
    13      }
    14
    15  }And my ShirtTest.java is as follows:
     1  package shirt;
     2
     3  public class ShirtTest {
     4
     5      public static void main (String args[]) {
     6
     7      Shirt privShirt = new Shirt();
     8      char colorCode;
     9
    10      privShirt.setColorCode('R');
    11      colorCode = privShirt.getColorCode();
    12
    13      System.out.println("Color Code: " + colorCode);
    14      System.out.println(" ");
    15
    16      privShirt.setColorCode('Z');
    17      colorCode = privShirt.getColorCode();
    18
    19      System.out.println("Color Code: " + colorCode);
    20
    21      }
    22
    23  }This is basically from the Fundamentals of the Java ^TM^ Programming Language SL-110-SE6 Student Guide(pages 9-12 & 9-13). We are working on Encapsulation if that makes any difference. Maybe it's just me but this book is not very new programmer/user friendly. At least in my opinion. I find it very frustrating that I can't even type in examples from the book and get them to work.
I have tried the javac -cp . ShirtTest.java suggested here but get the same error. I have removed all *.class* files and still no luck.
OS:
uname -a
SunOS 5.10
JAVA:
java -version
java version "1.5.0_26"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_26-b03)
Java HotSpot(TM) Server VM (build 1.5.0_26-b03, mixed mode)
Anyway, any help would be appreciated.

Similar Messages

  • How can I compile and run other java classes from within an application?

    Hello there everyone! I really hope that someone can help me. I am writing a program that must be able to compile and run other java classes that are in different files, much like development environments like Kawa or Forte allow you to do.
    There has to be a way of doing this ( I hope!! ), but i can't seem to find it!!
    I have tried using this command to compile:
    Runtime.getRuntime().exec ("c:\\programs\\javac className.java");
    ...and this one to run:
    Runtime.getRuntime().exec ("c:\\programs\\java className");
    ...but neither works!!! I can compile and run classes that are in the same file as my application, but I can't get it to work at all for files in different directories or files.
    PLEASE, PLEASE, PLEASE help me - i've run out of ideas, and i need this to be working in 3 days!!!
    Thank you very much for any help anyone can give me, I really appreciate it!! Thanks again!!
    Adrian ( ...in distress!! )

    public class JavaCompiler{
       public static void main(String[] args)throws Exception{ //sorry bout the laziness
          if(args == null || args.length != 1){
             System.out.println("Usage: java JavaCompiler MyClass.java");
             System.exit(0);
          String className = args[0];
          Runtime rt = Runtime.getRuntime();
          Process p = rt.exec("javac " + className); //consider setting cpath for this
          p.waitFor();
          //now try to run after it is done.
          p = rt.exec("java " + className.substring(0, (className.length() - ".java".length()));
          p.waitFor();
          //do some other stuff
    }This should get you going. You may consider looking into the System.getProperty() method in order to determine the type of OS it is running on in order to findo out what command to run. I know that the sun tool listed above is nice, but by my understanding the sun tools provided are not guaranteed to stay the same. I'm no expert on this matter, but that is one of the reasons there is no API documentation for those tools. Also, I don't believe those tools come packaged with the JRE. (Of course if you are making an IDE it will be expected that the user has an sdk installed. Good luck with figuring this thing out.

  • [svn] 1521: Fix compilation error in MBeanObjectNameResolver.java.

    Revision: 1521
    Author: [email protected]
    Date: 2008-05-02 05:19:25 -0700 (Fri, 02 May 2008)
    Log Message:
    Fix compilation error in MBeanObjectNameResolver.java.
    Modified Paths:
    blazeds/trunk/qa/apps/qa-regress/WEB-INF/src/qa/management/MBeanObjectNameResolver.java

    Revision: 1521
    Author: [email protected]
    Date: 2008-05-02 05:19:25 -0700 (Fri, 02 May 2008)
    Log Message:
    Fix compilation error in MBeanObjectNameResolver.java.
    Modified Paths:
    blazeds/trunk/qa/apps/qa-regress/WEB-INF/src/qa/management/MBeanObjectNameResolver.java

  • Basic Java Class with prints records out of the DEPT table

    Can some one show a basic java class which will query the DEPT table, and print them out?

    Nagarjuna,
    the Oracle DBMS JDBC Developer's Guide is full of code examples.
    http://download.oracle.com/docs/cd/B19306_01/java.102/b14355/toc.htm
    --olaf                                                                                                                                                                                                                                                                                                                       

  • PI 7.1 Enhancement pack 8: still error when referencing java class in xslt

    Hi
    I am getting an error in PI 7.1 EP 8 Repository when I try to use an xslt in which I make a reference to a java class. The error is:
    Transformer Configuration Exception occurred when loading XSLT XCBL_invoice_stylesheet.xsl; details: Could not compile stylesheet
    I use this xslt:
    <xsl:template match="/" xmlns:util="dk.dongenergy.pi.mapping.Utilities_datetime">
              <html>
    <B><xsl:text>Received: </xsl:text><xsl:value-of select="util:getCurrentDateTimeFormatted()"/>
    I have imported the java archive successfully and it is working in XI 3.0 and it is working if I comment out the reference to the java class in the xslt.
    the java class looks like this:
    package dk.dongenergy.pi.mapping;
    import java.text.SimpleDateFormat;
    import java.util.Date;
    public class Utilities_datetime {
    *     public static String getCurrentDateTimeFormatted() {*
    *          Date now = new Date();*
    *          SimpleDateFormat formatter = new SimpleDateFormat("dd MMM yyyy HH:mm:ss");*
    *         return formatter.format(now);*
    We have applied enhancement pack 8 on PI 7.1 as suggewsted in this note, but that has not done the trick:
    http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes/sdn_oss_bc_xi/~form/handler%7b5f4150503d3030323030363832353030303030303031393732265f4556454e543d444953504c4159265f4e4e554d3d31333235363833%7d
    Any suggestions?
    BR
    Mikael

    Hi Raj
    That gives me this error log:
    <br/>
    <br/>
    javax.ejb.EJBException: nested exception is: java.lang.RuntimeException: java.lang.UnsupportedClassVersionError: Bad version number in .class file java.lang.RuntimeException: java.lang.UnsupportedClassVersionError: Bad version number in .class file at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceedFinal(RequestInvocationContext.java:100) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:166) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatesTransition.invoke(Interceptors_StatesTransition.java:19) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Resource.invoke(Interceptors_Resource.java:71) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.doWorkWithAttribute(Interceptors_Transaction.java:38) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.invoke(Interceptors_Transaction.java:22) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:189) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatelessInstanceGetter.invoke(Interceptors_StatelessInstanceGetter.java:16) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_SecurityCheck.invoke(Interceptors_SecurityCheck.java:21) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_ExceptionTracer.invoke(Interceptors_ExceptionTracer.java:16) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.DefaultInvocationChainsManager.startChain(DefaultInvocationChainsManager.java:133) at com.sap.engine.services.ejb3.runtime.impl.DefaultEJBProxyInvocationHandler.invoke(DefaultEJBProxyInvocationHandler.java:164) at $Proxy1104.execute(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.sap.engine.services.rmi_p4.P4DynamicSkeleton.dispatch(P4DynamicSkeleton.java:234) at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:355) at com.sap.engine.services.rmi_p4.server.ServerDispatchImpl.run(ServerDispatchImpl.java:69) at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:67) at com.sap.engine.services.rmi_p4.P4Message.execute(P4Message.java:41) at com.sap.engine.services.cross.fca.FCAConnectorImpl.executeRequest(FCAConnectorImpl.java:977) at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:57) at com.sap.engine.services.cross.fca.MessageReader.run(MessageReader.java:55) at com.sap.engine.core.thread.execution.Executable.run(Executable.java:109) at com.sap.engine.core.thread.execution.CentralExecutor$SingleThread.run(CentralExecutor.java:314) Caused by: java.lang.UnsupportedClassVersionError: Bad version number in .class file at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:664) at java.lang.ClassLoader.defineClass(ClassLoader.java:509) at com.sap.aii.ib.server.mapping.execution.MappingLoader.findClass(MappingLoader.java:184) at java.lang.ClassLoader.loadClass(ClassLoader.java:350) at java.lang.ClassLoader.loadClass(ClassLoader.java:295) at com.sap.engine.lib.xsl.xpath.JLBLibrary.<init>(JLBLibrary.java:33) at com.sap.engine.lib.xsl.xpath.LibraryManager.getFunction(LibraryManager.java:63) at com.sap.engine.lib.xsl.xpath.ETFunction.evaluate(ETFunction.java:99) at com.sap.engine.lib.xsl.xpath.XPathProcessor.innerProcess(XPathProcessor.java:56) at com.sap.engine.lib.xsl.xpath.XPathProcessor.process(XPathProcessor.java:43) at com.sap.engine.lib.xsl.xpath.XPathProcessor.process(XPathProcessor.java:51) at com.sap.engine.lib.xsl.xslt.XSLValueOf.process(XSLValueOf.java:77) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296) at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:249) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296) at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:249) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296) at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:249) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296) at com.sap.engine.lib.xsl.xslt.XSLTemplate.process(XSLTemplate.java:273) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:470) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:438) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:395) at com.sap.engine.lib.jaxp.TransformerImpl.transformWithStylesheet(TransformerImpl.java:397) at com.sap.engine.lib.jaxp.TransformerImpl.transform(TransformerImpl.java:239) at com.sap.aii.ib.server.mapping.execution.AbstractMappingTransformer.transform(AbstractMappingTransformer.java:174) at com.sap.aii.ib.server.mapping.execution.XSLTMapping.executeStep(XSLTMapping.java:79) at com.sap.aii.ib.server.mapping.execution.Mapping.execute(Mapping.java:60) at com.sap.aii.ib.server.mapping.execution.MappingHandler.map(MappingHandler.java:87) at com.sap.aii.ib.server.mapping.execution.MappingHandler.map(MappingHandler.java:54) at com.sap.aii.ibrep.server.mapping.rt.MappingHandlerAdapter.run(MappingHandlerAdapter.java:139) at com.sap.aii.ibrep.server.mapping.exec.ExecuteIfMapCommand.execute(ExecuteIfMapCommand.java:33) at com.sap.aii.ib.server.mapping.exec.CommandManager.execute(CommandManager.java:43) at com.sap.aii.ibrep.server.mapping.ServerMapService.execute(ServerMapService.java:40) at com.sap.aii.ibrep.server.mapping.MapServiceBean.execute(MapServiceBean.java:40) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceedFinal(RequestInvocationContext.java:46) ... 32 more javax.ejb.EJBException: nested exception is: java.lang.RuntimeException: java.lang.UnsupportedClassVersionError: Bad version number in .class file at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceedFinal(RequestInvocationContext.java:100) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:166) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatesTransition.invoke(Interceptors_StatesTransition.java:19) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Resource.invoke(Interceptors_Resource.java:71) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.doWorkWithAttribute(Interceptors_Transaction.java:38) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.invoke(Interceptors_Transaction.java:22) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:189) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatelessInstanceGetter.invoke(Interceptors_StatelessInstanceGetter.java:16) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_SecurityCheck.invoke(Interceptors_SecurityCheck.java:21) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_ExceptionTracer.invoke(Interceptors_ExceptionTracer.java:16) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.DefaultInvocationChainsManager.startChain(DefaultInvocationChainsManager.java:133) at com.sap.engine.services.ejb3.runtime.impl.DefaultEJBProxyInvocationHandler.invoke(DefaultEJBProxyInvocationHandler.java:164) at $Proxy1104.execute(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.sap.engine.services.rmi_p4.P4DynamicSkeleton.dispatch(P4DynamicSkeleton.java:234) at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:355) at com.sap.engine.services.rmi_p4.server.ServerDispatchImpl.run(ServerDispatchImpl.java:69) at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:67) at com.sap.engine.services.rmi_p4.P4Message.execute(P4Message.java:41) at com.sap.engine.services.cross.fca.FCAConnectorImpl.executeRequest(FCAConnectorImpl.java:977) at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:57) at com.sap.engine.services.cross.fca.MessageReader.run(MessageReader.java:55) at com.sap.engine.core.thread.execution.Executable.run(Executable.java:109) at com.sap.engine.core.thread.execution.CentralExecutor$SingleThread.run(CentralExecutor.java:314) Caused by: java.lang.RuntimeException: java.lang.UnsupportedClassVersionError: Bad version number in .class file ... 33 more Caused by: java.lang.UnsupportedClassVersionError: Bad version number in .class file at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:664) at java.lang.ClassLoader.defineClass(ClassLoader.java:509) at com.sap.aii.ib.server.mapping.execution.MappingLoader.findClass(MappingLoader.java:184) at java.lang.ClassLoader.loadClass(ClassLoader.java:350) at java.lang.ClassLoader.loadClass(ClassLoader.java:295) at com.sap.engine.lib.xsl.xpath.JLBLibrary.<init>(JLBLibrary.java:33) at com.sap.engine.lib.xsl.xpath.LibraryManager.getFunction(LibraryManager.java:63) at com.sap.engine.lib.xsl.xpath.ETFunction.evaluate(ETFunction.java:99) at com.sap.engine.lib.xsl.xpath.XPathProcessor.innerProcess(XPathProcessor.java:56) at com.sap.engine.lib.xsl.xpath.XPathProcessor.process(XPathProcessor.java:43) at com.sap.engine.lib.xsl.xpath.XPathProcessor.process(XPathProcessor.java:51) at com.sap.engine.lib.xsl.xslt.XSLValueOf.process(XSLValueOf.java:77) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296) at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:249) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296) at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:249) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296) at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:249) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296) at com.sap.engine.lib.xsl.xslt.XSLTemplate.process(XSLTemplate.java:273) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:470) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:438) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:395) at com.sap.engine.lib.jaxp.TransformerImpl.transformWithStylesheet(TransformerImpl.java:397) at com.sap.engine.lib.jaxp.TransformerImpl.transform(TransformerImpl.java:239) at com.sap.aii.ib.server.mapping.execution.AbstractMappingTransformer.transform(AbstractMappingTransformer.java:174) at com.sap.aii.ib.server.mapping.execution.XSLTMapping.executeStep(XSLTMapping.java:79) at com.sap.aii.ib.server.mapping.execution.Mapping.execute(Mapping.java:60) at com.sap.aii.ib.server.mapping.execution.MappingHandler.map(MappingHandler.java:87) at com.sap.aii.ib.server.mapping.execution.MappingHandler.map(MappingHandler.java:54) at com.sap.aii.ibrep.server.mapping.rt.MappingHandlerAdapter.run(MappingHandlerAdapter.java:139) at com.sap.aii.ibrep.server.mapping.exec.ExecuteIfMapCommand.execute(ExecuteIfMapCommand.java:33) at com.sap.aii.ib.server.mapping.exec.CommandManager.execute(CommandManager.java:43) at com.sap.aii.ibrep.server.mapping.ServerMapService.execute(ServerMapService.java:40) at com.sap.aii.ibrep.server.mapping.MapServiceBean.execute(MapServiceBean.java:40) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceedFinal(RequestInvocationContext.java:46) ... 32 more
    Edited by: mikael lund on Oct 26, 2009 10:51 AM

  • An XJC compilation error - Could not load class (..) for type cvsversion

    I've got a strange compilation error using NetBeans 4.0 (I'd guess the version does not matter here) and Ant 1.6.2. When the following task is executed,
    <target name="compile_ofx_schema">
    <antcall target="clean-ofx"/>
    <delete dir="${ofx-jaxb-src.dir}"/>
    <mkdir dir="${ofx-jaxb-src.dir}" />
    <xjc schema="${schema.dir}/ofx102.xsd" package="com.xxx.ofx102" target="${ofx-jaxb-src.dir}">
    <arg value="-nv" />
    <arg value="-extension" />
    </xjc>
    </target>
    I get the error from NetBeans console,
    Class org.xml.sax.SAXException loaded from parent loader (parentFirst)
    Class java.io.IOException loaded from parent loader (parentFirst)
    D:\appserver\build.xml:797: unable to parse the schema. Error messages should have been provided
    at com.sun.tools.xjc.XJCTask._doXJC(XJCTask.java:334)
    at com.sun.tools.xjc.XJCTask.doXJC(XJCTask.java:283)
    at com.sun.tools.xjc.XJCTask.execute(XJCTask.java:227)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
    at org.apache.tools.ant.Task.perform(Task.java:364)
    at org.apache.tools.ant.Target.execute(Target.java:341)
    at org.apache.tools.ant.Target.performTasks(Target.java:369)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1062)
    at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:217)
    at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:236)
    at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:125)
    BUILD FAILED (total time: 4 seconds)
    Could not load class (org.apache.tools.ant.tasksdefs.cvslib.CvsVersion) for type cvsversion
    Could not load class (org.apache.tools.ant.tasksdefs.cvslib.CvsVersion) for type cvsversion
    And when I run the Ant task from the command line, I don't get the error at all.
    Any help is greatly appreciated.

    That was a great finding from you. Thank you.
    I followed your alternative approach and updated the ant.jar file. The "Could not load class..." error went away but the stack trace still remains. Now I am clueless again since I have ant on the debug mode and can't find any more useful info.
    Class com.sun.tools.xjc.reader.internalizer.LocatorTable loaded from ant loader (parentFirst)
    Class java.util.HashSet loaded from parent loader (parentFirst)
    Class javax.xml.parsers.DocumentBuilderFactory loaded from parent loader (parentFirst)
    Couldn't load Resource org/netbeans/core/xml/DOMFactoryImpl.class
    Couldn't load ResourceStream for META-INF/services/javax.xml.parsers.DocumentBuilderFactory
    Class org.apache.crimson.jaxp.DocumentBuilderFactoryImpl loaded from parent loader (parentFirst)
    Class javax.xml.parsers.SAXParserFactory loaded from parent loader (parentFirst)
    Couldn't load Resource org/netbeans/core/xml/SAXFactoryImpl.class
    Couldn't load ResourceStream for META-INF/services/javax.xml.parsers.SAXParserFactory
    Class org.apache.crimson.jaxp.SAXParserFactoryImpl loaded from parent loader (parentFirst)
    Class javax.xml.parsers.DocumentBuilder loaded from parent loader (parentFirst)
    Class java.util.Map loaded from parent loader (parentFirst)
    Class javax.xml.parsers.SAXParser loaded from parent loader (parentFirst)
    Finding class com.sun.tools.xjc.reader.xmlschema.parser.XMLSchemaInternalizationLogic$ReferenceFinder
    Loaded from D:\bbw\build\Common_3.6\Packaged\appserver\lib\jaxb\jaxb-xjc.jar com/sun/tools/xjc/reader/xmlschema/parser/XMLSchemaInternalizationLogic$ReferenceFinder.class
    Finding class com.sun.tools.xjc.reader.internalizer.AbstractReferenceFinderImpl
    Loaded from D:\bbw\build\Common_3.6\Packaged\appserver\lib\jaxb\jaxb-xjc.jar com/sun/tools/xjc/reader/internalizer/AbstractReferenceFinderImpl.class
    Class org.xml.sax.helpers.XMLFilterImpl loaded from parent loader (parentFirst)
    Class com.sun.tools.xjc.reader.internalizer.AbstractReferenceFinderImpl loaded from ant loader (parentFirst)
    Class com.sun.tools.xjc.reader.xmlschema.parser.XMLSchemaInternalizationLogic$ReferenceFinder loaded from ant loader (parentFirst)
    Class org.xml.sax.XMLFilter loaded from parent loader (parentFirst)
    Finding class com.sun.tools.xjc.reader.internalizer.VersionChecker
    Loaded from D:\bbw\build\Common_3.6\Packaged\appserver\lib\jaxb\jaxb-xjc.jar com/sun/tools/xjc/reader/internalizer/VersionChecker.class
    Class com.sun.tools.xjc.reader.internalizer.VersionChecker loaded from ant loader (parentFirst)
    Finding class com.sun.tools.xjc.reader.internalizer.DOMBuilder
    Loaded from D:\bbw\build\Common_3.6\Packaged\appserver\lib\jaxb\jaxb-xjc.jar com/sun/tools/xjc/reader/internalizer/DOMBuilder.class
    Finding class com.sun.xml.bind.marshaller.SAX2DOMEx
    Loaded from D:\bbw\build\Common_3.6\Packaged\appserver\lib\jaxb\jaxb-impl.jar com/sun/xml/bind/marshaller/SAX2DOMEx.class
    Class org.xml.sax.ContentHandler loaded from parent loader (parentFirst)
    Class com.sun.xml.bind.marshaller.SAX2DOMEx loaded from ant loader (parentFirst)
    Class com.sun.tools.xjc.reader.internalizer.DOMBuilder loaded from ant loader (parentFirst)
    Class java.util.Stack loaded from parent loader (parentFirst)
    Class org.w3c.dom.Document loaded from parent loader (parentFirst)
    Class org.xml.sax.XMLReader loaded from parent loader (parentFirst)
    Class org.w3c.dom.Node loaded from parent loader (parentFirst)
    Class org.w3c.dom.Element loaded from parent loader (parentFirst)
    Class javax.xml.parsers.ParserConfigurationException loaded from parent loader (parentFirst)
    Class org.xml.sax.SAXException loaded from parent loader (parentFirst)
    Class java.io.IOException loaded from parent loader (parentFirst)
    D:\bbw\build\Common_3.6\Packaged\appserver\build.xml:799: unable to parse the schema. Error messages should have been provided
    at com.sun.tools.xjc.XJCTask._doXJC(XJCTask.java:334)
    at com.sun.tools.xjc.XJCTask.doXJC(XJCTask.java:283)
    at com.sun.tools.xjc.XJCTask.execute(XJCTask.java:227)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
    at org.apache.tools.ant.Task.perform(Task.java:364)
    at org.apache.tools.ant.Target.execute(Target.java:341)
    at org.apache.tools.ant.Target.performTasks(Target.java:369)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1062)
    at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:217)
    at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:236)
    at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:125)
    BUILD FAILED (total time: 1 second)
    Any suggestions? BTW, I did not upgrade NetBeans to v5.5 due that my code is still JDK1.4 based.

  • Error loading a java class to oracle db

    hi,
    my oracle server: 8i Enterprise Edition Release 8.1.7.0.0
    i want to load a simple java class into my oracle server.
    java source:
    public class Ping
         java.lang.String server;
         public static void main(java.lang.String[] args)
              System.out.println(new Ping().runCmd(args[0]));
         public static java.lang.String runCmd(String cmd)
    boolean result=false;
    int timeout=5000;
    try {            
    java.net.InetAddress byName=java.net.InetAddress.getByName(cmd);
                   result=byName.isReachable(timeout);
    catch(java.io.IOException e)
    e.printStackTrace();
         java.lang.String retVal=java.lang.Boolean.toString(result);
              return retVal;
    after compiling the java file. i'm using loadjava at dos prompt.
    loadjava -user uname/pwd@db -resolve Ping.class
    this command results in
    ORA-29545: badly formed class:
    loadjava: 1 errors
    alternatively i had used a command
    loadjava -user uname/pwd@db -noverify -resolve Ping.class
    this command results in
    Error while turning off verifier
    ORA-29532: Java call terminated by uncaught Java exception: java.security.Ac
    cessControlException: the Permission (oracle.aurora.security.JServerPermission V
    erifier ) has not been granted by dbms_java.grant_permission to SchemaProtection
    Domain(SMSPGS|PolicyTableProxy(SMSPGS))
    ORA-29545: badly formed class:
    loadjava: 2 errors
    but user is having sufficient rights (javasyspriv)
    what is wrong above, please help me.
    regards,
    s.mohamed asif

    hi,
    thanks for your response
    Ping.class just checks whether the specified node is reachable or not.
    result=byName.isReachable(timeout);
    the jdk loaded in oracle DB is older one and the method above java.net.InetAddress.isReachable(java.lang.int) is available since
    jdk 1.5
    source:
    public class Ping
    java.lang.String server;
    public static void main(java.lang.String[] args)
    System.out.println(new Ping().runCmd(args[0]));
    public static java.lang.String runCmd(String cmd)
    boolean result=false;
    int timeout=5000;
    try {
    java.net.InetAddress byName=java.net.InetAddress.getByName(cmd);
    result=byName.isReachable(timeout);
    catch(java.io.IOException e)
    e.printStackTrace();
    java.lang.String retVal=java.lang.Boolean.toString(result);
    return retVal;
    }how to load the new jdk set into existing oracle db server and replace the existing jdk.
    what can be done to achieve this ?
    regards,
    s.mohamed asif

  • Oracle Java Environment Error - Not enough java classes defined ?

    I'm using 11gR1, and recently ran into a problem with Java Stored Procedures.
    It was working fine last week, and then this week at runtime I started getting an error:
    Error in Oracle java environment: ops1 - java.lang.Exception: Not enough java classes defined in the database.  Java Stored Procedures are not installed properly.
    I checked both the SYS schema and my user schema's Java classes. Neither had any invalid classes. For my user schema, the number of java classes seems right. For the SYS schema, I haven't figured out how to get past the 2000 rows fetch limit, so it will max out at 2000 - none of which are invalid.
    I cleared out my user schema and re-loaded its classes, and they all compiled/validated fine.
    A google search found no help...
    TIA
    Update (results of class count query):
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> select count (*) from dba_objects where object_type like '%JAVA%';
    COUNT(*)
    28895
    Edited by: GDub on Aug 18, 2010 2:37 PM

    I'm using 11gR1, and recently ran into a problem with Java Stored Procedures.
    It was working fine last week, and then this week at runtime I started getting an error:
    Error in Oracle java environment: ops1 - java.lang.Exception: Not enough java classes defined in the database.  Java Stored Procedures are not installed properly.
    I checked both the SYS schema and my user schema's Java classes. Neither had any invalid classes. For my user schema, the number of java classes seems right. For the SYS schema, I haven't figured out how to get past the 2000 rows fetch limit, so it will max out at 2000 - none of which are invalid.
    I cleared out my user schema and re-loaded its classes, and they all compiled/validated fine.
    A google search found no help...
    TIA
    Update (results of class count query):
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> select count (*) from dba_objects where object_type like '%JAVA%';
    COUNT(*)
    28895
    Edited by: GDub on Aug 18, 2010 2:37 PM

  • Error while importing java class into oracle forms 10g

    Hi
    I have generated a web service client using jdeveloper 10g. It consists of complex type methods. I am trying to import the class files using java importer in oracle form 10g. I am able import all of them successfully except one. That one is the main method. Please see the error and suggest me how to overcome this error.
    Exception occurred: java.lang.NoClassDefFoundError: oracle/jdeveloper/webservices/runtime/WrappedDocLiteralStub
    Thanks in advance

    Do you see oracle/jdeveloper listed in "Import Java Classes" when you try to import?
    If not, make sure you add C:\DevSuiteHome_1\jdev\lib\jdev.jar to FORMS_BUILDER_CLASSPATH in registry
    Also excetion indicates: oracle/jdeveloper/webservices/runtime/WrappedDocLiteralStub
    If you typing it - type: oracle.jdeveloper.webservices.runtime.WrappedDocLiteralStub

  • No Class Found Error on invoking java class from PL/SQL

    Hi There,
    I have followed instructions on how to create a java proc in the DB to invoke it from PL/SQL.
    I get a 'java.lang.NoClassDefFoundError' error because it cannot access 'org.apache.axis.description.TypeDesc' in this case. The instuctions say to add the supporting jars which contain the additional classes to the project's Additional Classpath's which I have done.
    I deploy the java classes and create the java stored proc using JDev.
    Can someone please tell me how to go about resolving this?
    I can see 'org.apache.axis.description.TypeDesc' in the DB via JDev's Databse connection in the Java Classes tree?
    Thanks,
    Anthony

    Hi There,
    I have followed instructions on how to create a java proc in the DB to invoke it from PL/SQL.
    I get a 'java.lang.NoClassDefFoundError' error because it cannot access 'org.apache.axis.description.TypeDesc' in this case. The instuctions say to add the supporting jars which contain the additional classes to the project's Additional Classpath's which I have done.
    I deploy the java classes and create the java stored proc using JDev.
    Can someone please tell me how to go about resolving this?
    I can see 'org.apache.axis.description.TypeDesc' in the DB via JDev's Databse connection in the Java Classes tree?
    Thanks,
    Anthony

  • Error in accessing Java Class?

    I got an error when accessing JavaClass,
    The Java Class is following,
    packages mypack;
    public class myParentClass{
    public myParentClass{
    public String doAct(String act){
    return act;
    public static act class {
    public static final String ADD="ADD";
    public static final String DELETE="DELETE";
    And I am using JavaBean as the following,
    <%@ page import="mypack.*"%>
    <jsp:useBean id="mybean" scope="page" class="myParentClass"/>
    <%
    String act=mybean.doAct(mybean.act.ADD);
    %>
    The error I got is "No variable act defined in class myParentClass"
    I don't know why! How can I solve it?
    Thanks in advance!

    hi, you lose a semicolon ";" .
    you should add ";" at the end of the definition of "act" as:
    public class myParentClass{
    public myParentClass{
    public String doAct(String act){
    return act;
    public static act class {
    public static final String ADD="ADD";
    public static final String DELETE="DELETE";
    }; // this is the error .

  • Error when using java class in php

    dear all
    when i am using my java class in php page
    i am getting below error
    Fatal error: Uncaught [[o:Exception]:"java.lang.Exception: Invoke failed: [[o:e24PaymentPipe]]->performPaymentInitialization. Cause: java.lang.NullPointerException Responsible VM: 1.6.0_01@http://java.sun.com/" at: #-9 e24PaymentPipe.performPaymentInitialization(e24PaymentPipe.java:341) #-8 sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source) #-7 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) #0 [internal function]: Java->__call('performPaymentI...', Array) #1 /home/comhtdocs/hdfcpay/HostedPaymentBuy.php(31): Java->performPaymentInitialization() #2 {main}] thrown in /home/comhtdocs/hdfcpay/HostedPaymentBuy.php on line 31
    Edited by: arun240 on Jul 25, 2008 8:47 AM

    arun240 wrote:
    dear all
    when i am using my java class in php page
    i am getting below error
    Fatal error: Uncaught [[o:Exception]:"java.lang.Exception: Invoke failed: [[o:e24PaymentPipe]]->performPaymentInitialization. Cause: java.lang.NullPointerException Responsible VM: 1.6.0_01@http://java.sun.com/" at: #-9 e24PaymentPipe.performPaymentInitialization(e24PaymentPipe.java:341) #-8 sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source) #-7 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) #0 [internal function]: Java->__call('performPaymentI...', Array) #1 /home/comhtdocs/hdfcpay/HostedPaymentBuy.php(31): Java->performPaymentInitialization() #2 {main}] thrown in /home/comhtdocs/hdfcpay/HostedPaymentBuy.php on line 31
    Edited by: arun240 on Jul 25, 2008 8:47 AMWell, it seems there's an object (perhaps a PaymentPipe?) pointing to null which you're trying to invoke a method (performPaymentInitialization()?) on. Needles to say: you can do that.
    SomeObject so = null;
    // ... some more code ...
    so.someMethod(); // No can do! A NPE will be thrown!

  • Error when generating java classes from object types

    Hi,
    I'm using JDeveloper version 10.1.3.0.2
    I created an object type in the database, the definition is:
    TYPE domain_cls IS OBJECT (
    domain_idx           NUMBER(3)
    ) NOT INSTANTIABLE NOT FINAL
    I tried to create a java class for this object using JDeveloper, by using generate java menu item.
    I got the following error:
    oracle.jpub.JPubException: Warning: Cannot determine what kind of type is OBJMOI. DOMAIN_CLS. The following error occurred: ORA-06550: line 1, column 13:
    PLS-00103: Encountered the symbol "SYS" when expecting one of the following:
    := . ( @ % ;
    The symbol ":=" was substituted for "SYS" to continue.
    at oracle.jpub.sqlrefl.SqlReflector.addSqlType(SqlReflector.java:519)
    at oracle.jpub.sqlrefl.SqlReflector.addSqlUserType(SqlReflector.java:707)
    at oracle.jpub.publish.Publisher.addTypeOrPackage(Publisher.java:209)
    at oracle.jpub.publish.IntypeParser.TypeDeclaration(IntypeParser.java:238)
    at oracle.jpub.publish.IntypeParser.CompilationUnit(IntypeParser.java:75)
    at oracle.jpub.Doit.main(Doit.java:257)
    at oracle.jpub.Doit.main(Doit.java:102)
    at oracle.jdevimpl.cm.dt.jpub.JPubModel.publish(JPubModel.java:1047)
    at oracle.jdevimpl.wizard.jpub.JPubPanel.publish(JPubPanel.java:516)
    at oracle.jdevimpl.cm.dt.jpub.JPubAddin._doJPub(JPubAddin.java:174)
    at oracle.jdevimpl.cm.dt.jpub.JPubAddin.handleEvent(JPubAddin.java:81)
    at oracle.ide.IdeAction.performAction(IdeAction.java:661)
    at oracle.ide.IdeAction$2.run(IdeAction.java:889)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
    any body can hlep in that please

    I would recommend using JAXB instead of the Oracle class generator. This will give a standards based object-to-XML platform.
    Oracle provides two JAXB implementations: one in the TopLink product, and the other in the XDK.
    For an example of using TopLink JAXB see:
    http://www.oracle.com/technology/products/ias/toplink/technical/tips/jaxb/index.htm
    TopLink also provides the ability to map existing Java objects to an existing XML Schema, for an example of this see:
    http://www.oracle.com/technology/products/ias/toplink/technical/tips/ox/index.htm
    -Blaise

  • Error when generating Java Classes from XSD

    I'm getting the following error when using oragc to generate Java classes from a schema:
    Error: Schema Class Generator failed to generate classes. oracle.xml.parser.schema.XSDException: Invalid facet 'pattern' in element 'simpleType'
    Any thoughts?
    Here's the part where it is getting the error:
    +111 <!-- Timestamp Type - Timezone portion is required and fractional seconds are prohibited -->
    +112 <xsd:simpleType name="TimestampType">
    +113 <xsd:annotation>
    +114 <xsd:documentation>Base type for a date and time stamp</xsd:documentation>
    +115 </xsd:annotation>
    +116 <xsd:restriction base="xsd:dateTime">
    +117 <xsd:pattern value="[1-9][0-9]{3}\-.+T[^\.]+(Z|[\+\-].+)" />
    +118 </xsd:restriction>
    +119 </xsd:simpleType>

    I would recommend using JAXB instead of the Oracle class generator. This will give a standards based object-to-XML platform.
    Oracle provides two JAXB implementations: one in the TopLink product, and the other in the XDK.
    For an example of using TopLink JAXB see:
    http://www.oracle.com/technology/products/ias/toplink/technical/tips/jaxb/index.htm
    TopLink also provides the ability to map existing Java objects to an existing XML Schema, for an example of this see:
    http://www.oracle.com/technology/products/ias/toplink/technical/tips/ox/index.htm
    -Blaise

  • Scheduled job throws Class Not Found error when executing Java class

    Hi,
    I have written a java class to carry out a file upload to an external site and put the class on our server.
    I also wrote a script to call this java class, passing inthe relevant parameters.
    If i call the script using the ./ syntax from SSH it runs file logged in as Root and Oracle.
    I the setup a scheduled job to call this script but the job fails with the error...
    STANDARD_ERROR="Exception in thread "main" java.lang.NoClassDefFoundError: HttpsFileUpload Caused by: java.lang.ClassNotFoundException: HttpsFileUpload at java.net.URLClassLoader$1.run(URLClassLoader.java:"I cannot understand why it is raising the error if it runs from SSH.
    O/S = Red Hat Enterprise Linux ES, oracle version = 10.2.0.1.0
    Any help or guidance would be appreciated
    Thank you in advance
    Graham.
    Edited by: gpc on Feb 4, 2009 12:46 PM

    Hi,
    See this link for some tips if you haven't yet :
    Guide to External Jobs on 10g with dbms_scheduler e.g. scripts,batch files
    I can think of two things. Your script may not be able to run as the nobody user (by default external jobs run as the nobody user). Or your script might require that some environment variable be set (by default environment variables are not set in external jobs).
    Maybe you need to set the CLASSPATH variable in your script before calling java ?
    Hope this helps,
    Ravi.

Maybe you are looking for

  • Allow a different input source for each document

    I just received my new MBP and am really happy about it. I'm a switcher so apologies in advance if this question is silly... I use both Swedish and English keyboard maps. I can switch between them using a shortcut which is fine. However, in the Inter

  • I need know API to get password

    Hi, I have a procedure to login public users to portal users like PORTAL30.wwptl_login.login_url('user','PASSWORD','','url',''); but in this procedure I needed put the password hard-coded and when I need to change the user password I will have to cha

  • Flex 10 and VGA Projector

    I have just bought a Flex 10 being assured that I can use it to drive a projector through a Belkin HDMI to VGA Projector Adapter.  It works OK with a VGA computer monitor connected via extended desktop, however it just refuses to work when connected

  • SpotLight Search Results Preference Pain Missing 4 Categories

    Hello; My Spotlight Preference Pain Window only show 10 of the 14 categories. The... Applications System Preferences Documents Folders Mail Contacts Evens & To Do Items Images PDF Documents and Webpage listings are all there, but the Music Movies Fon

  • How to reset safari 8.0

    The reset option is missing in safari 8.0. How do I reset safari 8.0?