SQLJ compile failure in derived class

I have successfully comiled and run the "SimpleExample" defined
in the Help Topics "Developing Applications Using SQLJ" page.
However, if I make a simple modification to make the class
derived from another class (DoNothing class shown below is the
simplest case I've tried) I get compilation errors:
Error (52) Illegal INTO ... bind variables list: illegal
expression..
Error (0) SQLJ translation aborted.
Error (0) sqlj.framework.TranslationException. Error occured in
SQLJ translation.
Modified SimpleExample looks like:
public class SimpleExample extends DoNothing {
......as before
where DoNothing is defined as:
package RDBInterface; // My SimpleExample is in same package
public class DoNothing {
public DoNothing() {
Any ideas about this?
null

Andy,
I got the answer to that in another thread,
cheers Jon
Re: SQLJ-Problem with JDeveloper 2.0
From: Chris Stead (guest)
Email: [email protected]
Date: Tue Feb 02 13:07 CST 1999
Markus Rosenkranz (guest) wrote:
: Hi,
: I tried to rebuild an SQLJ-file with the new JDev. 2.0.
Whenever
: there is an iterator definition in a derived class compilation
: failed. By removing the extends clause in the class definition
: the compilation error could be avoided. It seems that the
: iterator definition is ignored. With JDev. 1.1 everthing
worked
: fine. How can this problem be solved.
: TIA Markus
Hi Markus,
Your question seems similar to the one that was just resolved.
Here are the specifics:
I'm using the production SQLJ and getting a frustrating error
of:
-- "Left hand side of assignment does not have a Java type."
I've reduced my testcase down to the absolute
minimum, but maybe I'm missing something obvious...
package oracle.xml.website;
import java.sql.SQLException;
import javax.servlet.http.*;
#sql iterator empiter ( String empname );
public class WebXSL extends HttpServlet {
public void foo() throws SQLException {
empiter myEmps = null;
#sql myEmps = {SELECT ename empname from EMP order by sal
desc };
Hi,
Could you please check whether the class HttpServlet is
available
in your CLASSPATH? The type resolver could be failing to find
this class in the process of looking for the definition of
'empiter', which is the type of your iterator variable myEmps.
The error message is somewhat obscure, we will be working on
improving it..
The SQLJ translator does a full type resolution of Java
variables
and expressions used in #sql statements, following JLS rules of
scoping and precedence for class and interface hierarchies. It
looks for classes in the CLASSPATH, as well as in the .sqlj and
.java source files specified on the sqlj command-line. So, if
you have .sqlj and .java files that are mutually dependent, you
could do:
sqlj Foo.sqlj Bar.java
Please let us know if your problem persists.. and see also bug
801780 for a related discussion.
- Julie
Julie,
Your suggestion helped! Thanks.
With 20/20 hindsight now, it would have been much more
helpful if the SQLJ translator reported an error message like:
-> Left hand side of assignment is not a Java type.
-> Unable to resolve class "HttpServlet". Check CLASSPATH
That would have keyed me into the problem many hours ago :-)
You suggestion lead me to test sqlj-ing my testcase
both outside and inside the JDeveloper environment.
Outside the environment, if I make sure J:\lib\jsdk.jar is
in my classpath, then all is well.
Inside the environment, I had included the named
library for "JavaWebServer" in my project libraries
and its classpath info was properly set to J:\lib\jsdk.jar,
but it appears that somehow JDev is not properly passing
this project-level classpath info to the SQLJ translator.
I was able to solve my problem (a hack!) by adding
J:\lib\jsdk.jar
to the:
IDEClasspath=
setting in the J:\bin\jdeveloper.ini file which I shouldn't
have to do. I filed Bug 813116 for the JDev team.
null

Similar Messages

  • Warning :: Derived class hides the base class virtual function

    We are porting from CC5.3 to CC5.8 compiler with Sun Studio one compiler. After plenty of hurdles we are in the final stage of removing the warning messages... Amoung the plenty the following one is very common and in different files. Why am I getting this error in 5.8 and not in 5.3 compiler....
    Warning: derived_Object::markRead Hides the virtual function base_Object::markRead(ut_SourceCodeLocation&) const in a virtual base
    From this it is easily understandable that the base class mark read was hidden by derived class markRead... when we drive and override the derived class function.... It is all over the place....
    Thank you,
    Saravanan Kannan
    //public: using xx_Object :: markRead;
    virtual void markRead() const;

    The Sun C++ FAQ discusses the warning message:
    http://developers.sun.com/prodtech/cc/documentation/ss11/mr/READMEs/c++_faq.html#Coding1
    Notice that warnings are not necessarily errors. But I applaud your desire to fix the code so that it generates no warnings. I wish more of our customers could be persuaded to do the same. :-)
    C++ 5.3 issues this warning, by the way. Example:
    struct B { virtual int foo(int); };
    struct D : B { virtual int foo(double); }; // line 2
    D d;
    line 2: Warning: D::foo hides the virtual function B::foo(int).
    If for your particular code you do not see a warning with C++ 5.3, it would be due to a bug in C++ 5.3 that was later fixed.

  • My derived class suddenly doesn't recognize the parent class

    I had my assignment coded, debugged, working and ready to go. So I bring my flash drive upstairs to play around with it on my other computer. When I compile the base class it compiles fine, but now when I try to compile the derived class, and the test class with the main method, I'm coming up with errors.
    They have something to do with the base class not being recognized, because I can't instantiate any objects of the class now, and i get an error when attempting to compile the derived class to the effect of "cannot find symbol; symbol: class BaseClass". i get this error throughout the derived class, from the initial declaration of the class (public class DerivedClass extends BaseClass), to any references made toward methods of the parent class.
    My base class compiles with no problem, but it's like nothing else is able to "use" it. I'm not sure if it has something to do with the PC im using now, and I can't confirm this at the moment because the PC I used to write the code is down (waiting on an upgrade).
    ehhh.....help.
    Message was edited by:
    asphaltninja
    null

    It's not the fault of the computer hardware.
    It's not the fault of the operating system.
    It's not the fault of the JDK.
    So don't go rebooting or reinstalling anything. The problem is that you didn't set up things on the new computer in the same way they were set up on the old computer.
    In particular the compiling problem is that the compiled version of BaseClass isn't in the classpath when you try to compile DerivedClass. I can't tell why from your description.

  • How to load function from derived class from dll

    Dear all,
    how to access extra function from derived class.
    for Example
    //==========================MyIShape.h
    class CMyIShape
    public:
    CMyIShape(){};
    virtual ~CMyIShape(){};
    virtual void Fn_DrawMe(){};
    // =========== this is ShapRectangle.dll
    //==========================ShapRectangle .h
    #include "MyIShape.h"
    class DLL_API ShapRectangle :public CMyIShape
    public:
    ShapRectangle(){};
    virtual ~ShapRectangle(){};
    virtual void Fn_DrawMe(){/*something here */};
    virtual void Fn_ChangeMe(){/*something here */};
    __declspec (dllexport) CMyIShape* CreateShape()
    // call the constructor of the actual implementation
    CMyIShape * m_Obj = new ShapRectangle();
    // return the created function
    return m_Obj;
    // =========== this is ShapCircle .dll
    //==========================ShapCircle .h
    #include "MyIShape.h"
    class DLL_API ShapCircle :public CMyIShape
    public:
    ShapCircle(){};
    virtual ~ShapCircle(){};
    virtual void Fn_DrawMe(){/*something here */};
    virtual void Fn_GetRadious(){/*something here */};
    __declspec (dllexport) CMyIShape* CreateShape()
    // call the constructor of the actual implementation
    CMyIShape * m_Obj = new ShapCircle();
    // return the created function
    return m_Obj;
    in exe there is no include header of of ShapCircle and ShapRectangle 
    and from the exe i use LoadLibrary and GetProcAddress .
    typedef CMyIShape* (*CREATE_OBJECT) ();
    CMyIShape*xCls ;
    //===================== from ShapeCircle.Dll
    pReg=  (CREATE_OBJECT)GetProcAddress (hInst ,"CreateShape");
    xCls = pReg();
    now xCls give all access of base class. but how to get pointer of funciton Fn_GetRadious() or how to get access.
    thanks in advance.

    could you please tell me in detail. why so. or any reference for it. i love to read.
    i don't know this is bad way.. but how? i would like to know.
    I indicated in the second sentence. Classes can be implemented differently by different compilers. For example, the alignment of member variables may differ. Also there is the pitfall that a class may be allocated within the DLL but deallocated in the client
    code. But the allocation/deallocation algorithms may differ across different compilers, and certainly between DEBUG and RELEASE mode. This means that you must ensure that if the DLL is compiled in Visual Studio 2010 / Debug mode, that the client code is also
    compiled in Visual Studio 2010 / Debug mode. Otherwise your program will be subject to mysterious crashes.
    is there any other way to archive same goal?
    Of course. DLL functionality should be exposed as a set of functions that accept and return POD data types. "POD" means "plain-ole-data" such as long, wchar_t*, bool, etc. Don't pass pointers to classes. 
    Obviously classes can be implemented within the DLL but they should be kept completely contained within the DLL. You might, for example, expose a function to allocate a class internally to the DLL and another function that can be called by the client code
    to free the class. And of course you can define other functions that can be used by the client code to indirectly call the class's methods.
    and why i need to give header file of ShapCircle and shapRectangle class, even i am not using in exe too. i though it is enough to give only MyIShape.h so with this any one can make new object.
    Indeed you don't have to, if you only want to call the public properties and methods that are defined within MyIShape.h.

  • Base class/Derived class

    Hi all,
    I have
    class Base {
    int a;
    class Derived{
    int b;
    now if i do
    Base X = new Base();
    Derived D = new Derived();
    It Doesn't allow me to do D=X
    But it does allow me to do X=D.
    whats the reason behind it. And what actually happens when i do X=D , does the copy constructor gets called ?
    Thanx

    Manthana wrote:
    Hi, u said
    the value of X becomes the reference to the instance of Derived that you created when you called "new Derived()".
    So now i can access attributes of derived class from the reference X right X.b
    But i cant do X.b
    Why?Please spell out words like "you". It makes things easier to read. :)
    With Derived extending Base, you could say:
    X = D;
    X.a = 5;Because the compiler and runtime see X as a reference to a Base object, you can only access variables/methods defined in Base. Since X is declared as being a reference to Base, you always know that 'a' is defined. 'b' wouldn't be defined for X if you said:
    X = new Base();
    X.b = 52;So, in order to access the b, you'd have to access it with something declared as a reference to Derived, such as 'D':
    D.b = 10;You could say:
    X = D; // Line 1
    Derived d2 = (Derived)X;
    d2.b = 10;But, then you'll get a ClassCastException if X is only referring to a Base object [e.g., if Line 1 was "X = new Base();"], not to a Derived object.

  • Why cannnot derived class pointer point to a base class object?

    Hi,
    Pleaseeee... explain me why cannot the derived class pointer point to a base class object.
    I know that Base class pointer can point to a derived class object.
    Thanks & Regards,
    Vig....

    Example:
    class Base
    { public: void foo(); } * pBase;
    class Derived : public Base
    { public: void bar(); } * pDerived;
    Now, what would happen if you assign pDerived = new Base() and then call pDerived->bar()?By forbidding such an assignment, compiler prevents you from writing error-prone code.

  • Casting base class object to derived class object

    interface myinterface
         void fun1();
    class Base implements myinterface
         public void fun1()
    class Derived extends Base
    public class File1
         public myinterface fun()
              return (myinterface) new Base();
         public static void main(String args[])
              File1 obj = new File1();
              Derived dobj = (Derived)obj.fun();
    Giving the exception ClassCastException......
    Can't we convert from base class object to derived class.
    Can any one help me please...
    Thnaks in Advance
    Bharath kumar.

    When posting code, please use tags
    The object returned by File1.fun() is of type Base. You cannot cast an object to something it isn't - in this case, Base isn't Dervied. If you added some member variables to Derived, and the compiler allowed your cast from Base to Derived to succeed, where would these member variables come from?
    Also, you don't need the cast to myinterface in File1.fun()
    Also, normal Java coding conventions recommend naming classes and interfaces (in this case, myinterface) with leading capital letters, and camel-case caps throughout (e.g. MyInterface)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Managing constants in base / derived classes

    Hi there,
    The problem:
    I'm facing what is certainly a simple problem but fail to come up with an acceptable solution. What I'd like to do is managing constants in a base class and derived class... which for some reasons are not parts of the same package. Also, these constants may have different values in the derived base.
    Down to earth description:
    Class base uses a set of constants A=1, B=2, C=3.
    Class derived should be provided with similarly named constants but they may have different values A=10, B=20, C=30. I could declared these constants in the classes themselves but somehow I think this is ugly.
    A "solution" that does not work:
    Assume for a moment that I'm just a very naive programmer (which actually I am... but anyway...). I would them come up with something like:
    package base;
    import base.Constants;
    public class Base {
        public Base() {
        public void myfunction() {
           System.out.println("My constant: " + Constants.A);
    }and
    package derived;
    import derived.Constants;
    public class Derived extends Base {
        public Derived() {
    }Now of course this is stupid since Derived.myfunction() prints the value of the constants given by Base.myfunction()The question is: is there a static construction that would allow me to have the desired behaviour? What I mean is that I don't want to provide a "Constants" object nor an hashtable dynamically loaded or whatever.
    Bonus question:
    I'm not a pro in OOP (seriously guys... C rocks! Oops, wrong forum :-) but it seems to be a case of "code inheritance" vs "behaviour inheritance" (I just made those expressions up!). What I mean is: if what is inherited is the actual "code" of the methods (as if a huge copy paste took place) then the naive solution would work. But in the real world, a "behaviour inheritance" is at work in the sense that what is inherited is the "behaviour" (or, more bluntly, simply the code as compiled in the base class). Hmm... Am I making any sense here? Is that distinction theorized in some way? I tried to search a bit by myself but did not know where to start.
    Thanks,

    I mucked around with this exact problem a while back.
    The (simplified) scenario is AbstractCourse is extended by CookingCourse, WritingCourse, and BusinessCourse. Every course has a basePrice and a materialsCost... both of which vary from course to course... The same price calculation applies to all types of course, just the amounts will vary.
    totalPrice = basePrice + materialsCost The traditional non-oo solution is simple enough... you would just create a "table" of all six contstants, and a function with a switch statement...
    but How to do this "The OO Way"?
    What I came up with is:
    class BaseCourse {
      abstract double getBasePrice();
      abstract double getMaterialsCost();
      public double getPrice() {
        return getBasePrice() + getMaterialsCost();
    public class CookingCourse {
      private static final double BASE_PRICE = 300.00;
      private static final double MATERIALS_COST = 112.60;
      public double getBasePrice() { return CookingCourse.BASE_PRICE }
      public double getMaterialsCost() { return CookingCourse.MATERIALS_COST }
    public class WritingCourse {
      private static final double BASE_PRICE = 200.00;
      private static final double MATERIALS_COST = 50.00;
      public double getBasePrice() { return WritingCourse.BASE_PRICE }
      public double getMaterialsCost() { return WritingCourse.MATERIALS_COST }
    public class BusinessCourse {
      private static final double BASE_PRICE = 600.00;
      private static final double MATERIALS_COST = 18.12;
      public double getBasePrice() { return BusinessCourse.BASE_PRICE }
      public double getMaterialsCost() { return BusinessCourse.MATERIALS_COST }
    }The base class specifies that each subclass must be able to tell it's base price, and it's materials cost... then we implement the calculation on those values just once, in the base class.
    For all I know there are much more succinct, flexible, efficient, and basically much more smarter ways of doing this... this is just a way that worked for me... and it's simple enough so even I can follow it.
    Java can be a very very very very verbose language :-( ... But hey it still shits on C ;-)
    Cheers. Keith.
    Edited by: corlettk on 23/05/2008 11:17 - typos

  • Constructor of derived-class has to call constructor  of super-class?

    In java, constructor of derived-class has to call constructor of super-class? there is no way to omit this step?

    Correct. If you do not explicitly call the constructor, a call to the no-arg c'tor, super(), is automatically inserted.
    It would be a mess to have it any other way. You'd be creating objects that are not completely initialized. They'd be in an invalid state.
    Constructor rules:
    1) Every class has at least one ctor.
    1.1) If you do not define an explicit constructor for your class, the compiler provides a implicit constructor that takes no args and simply calls super().
    1.2) If you do define one or more explicit constructors, regardless of whether they take args, then the compiler no longer provides the implicit no-arg ctor. In this case, you must explicitly define a public MyClass() {...} if you want one.
    1.3) Constructors are not inherited.
    2) The first statement in the body of any ctor is either a call to a superclass ctor super(...) or a call to another ctor of this class this(...) 2.1) If you do not explicitly put a call to super(...) or this(...) as the first statement in a ctor that you define, then the compiler implicitly inserts a call to super's no-arg ctor super() as the first call. The implicitly called ctor is always super's no-arg ctor, regardless of whether the currently running ctor takes args.
    2.2) There is always exactly one call to either super(...) or this(...) in each constructor, and it is always the first call. You can't put in more than one, and if you put one in, the compiler's implicitly provided one is removed.

  • Stub compile failure when entity has two 1:1 relationships

    I think I've found a bug in the Sun J2EE SDK (surprised? no, but looking for workaround...)
    The stub code that is generated during deployment of my .ear file creates two "__reverse_item_uid" fields for my ItemBean entity.
    This started when I added a second 1:1 relationship to my ItemBean. I have a PurchaseItem-Item relationship and have now added a SalesOrderItem-Item relationship. They are both 1:1 and unidirectional. See relevent section from ejb-jar.xml
    <ejb-relation>
    <ejb-relationship-role>
    <ejb-relationship-role-name>PurchaseItem-Item</ejb-relationship-role-name>
    <multiplicity>One</multiplicity>
    <relationship-role-source>
    <ejb-name>PurchaseItem</ejb-name>
    </relationship-role-source>
    <cmr-field>
    <cmr-field-name>item</cmr-field-name>
    </cmr-field>
    </ejb-relationship-role>
    <ejb-relationship-role>
    <ejb-relationship-role-name>Item-PurchaseItem</ejb-relationship-role-name>
    <multiplicity>One</multiplicity>
    <relationship-role-source>
    <ejb-name>Item</ejb-name>
    </relationship-role-source>
    </ejb-relationship-role>
    </ejb-relation>
    <ejb-relation>
    <ejb-relationship-role>
    <ejb-relationship-role-name>SalesOrderItem-Item</ejb-relationship-role-name>
    <multiplicity>One</multiplicity>
    <relationship-role-source>
    <ejb-name>SalesOrderItem</ejb-name>
    </relationship-role-source>
    <cmr-field>
    <cmr-field-name>item</cmr-field-name>
    </cmr-field>
    </ejb-relationship-role>
    <ejb-relationship-role>
    <ejb-relationship-role-name>Item-SalesOrderItem</ejb-relationship-role-name>
    <multiplicity>One</multiplicity>
    <relationship-role-source>
    <ejb-name>Item</ejb-name>
    </relationship-role-source>
    </ejb-relationship-role>
    </ejb-relation>
    When I add my .jar to my application using the GUI of the deploytool, set everything up (jndi, generate sql, ...) run verifier is OK, and then deploy, the deploy will fail due to stub compilation failure.
    If I then open up the sun-j2ee-ri.xml that is generated and found in my c:\j2sdkee1.3.1\repository\myname\applications\myapp1234.jar notice the use of two "__reverse_item_uid" fields in the following sample:
    <ejb>
    <ejb-name>Item</ejb-name>
    <jndi-name>Item</jndi-name>
    <gen-classes />
    <ejb20-cmp>
    <sql-statement>
    <operation>storeRow</operation>
    <sql>UPDATE "ItemBeanTable" SET "__reverse_item_uid" = ? , "__reverse_item_uid" = ? , "itemType" = ? , "location" = ? , "name" = ? , "peachID" = ? , "price1" = ? , "price2" = ? , "price3" = ? , "unitmeasure" = ? , "version" = ? WHERE "uid" = ? </sql>
    </sql-statement>
    GRRRRR!!!!! What do I do to avoid this? Can't the Sun Ref Impl generate this and the stub code smarter so that it does something like use the <ejb-relationship-role-name> as the fieldname?
    Any help would be greatly appreciated :)
    -Gretel

    I figured it out... here's the answer in case anyone is wondering...
    Use different field names for 'item' in both PurchaseItem and SalesOrderItem. In other words, here is the correct segment of ejb-jar.xml
    <ejb-relation>
    <ejb-relationship-role>
    <ejb-relationship-role-name>SalesOrderItem-Item</ejb-relationship-role-name>
    <multiplicity>One</multiplicity>
    <relationship-role-source>
    <ejb-name>SalesOrderItem</ejb-name>
    </relationship-role-source>
    <cmr-field>
    <cmr-field-name>itemHack</cmr-field-name>
    </cmr-field>
    </ejb-relationship-role>
    <ejb-relationship-role>
    <ejb-relationship-role-name>Item-SalesOrderItem</ejb-relationship-role-name>
    <multiplicity>One</multiplicity>
    <relationship-role-source>
    <ejb-name>Item</ejb-name>
    </relationship-role-source>
    </ejb-relationship-role>
    </ejb-relation>
    Simply by changing the <cmr-field-name>itemHack</cmr-field-name> from 'item' to 'itemHack' :)
    Sometimes in the land of EJB development, it's the "easy" things that can waste a lot of time.

  • Construct Derived Class in Static Block

    We've been having intermittent thread deadlock problems after migrating a stable system to Linux.
    One locked section we noticed occurred about 1 in 5 times, right at startup. The code looked fishy from the beginning, but I thought others could confirm whether it could be the cause of our problems.
    The code block constructs a derived class from a static block in the parent. Is it a recipe for failure? If so, why only intermittently and why not in Windows?

    The code block constructs a derived class from a
    static block in the parent.I don't understand that sentence. You have a block of code. It calls a constructor? It calls a constructor for a class that's derived from ... a static block? What do you mean?
    Is it a recipe for
    failure? If so, why only intermittently and why not
    in Windows?Intermittent failure is the nature of thread problems. Windows and Linux can have very different underlying implementations of threads.
    Show us some of the code and the failure mode.

  • Failure extracting WAR classes when starting weblogic server

    I installed weblogic6.1 app server on Solaris box. It works fine at first. Then
    I moved the unix box to anther place which means it has different IP. Then I have
    following exception when I try to start the weblogic server:(I haven't deployed
    any thing in the server yet, so it's just a newly installed weblogic server)
    Starting WebLogic Server ....
    <Mar 8, 2002 10:40:26 AM PST> <Notice> <Management> <Loading configuration file
    ./config/mydomain/config.xml ...>
    <Mar 8, 2002 10:40:35 AM PST> <Notice> <WebLogicServer> <Starting WebLogic Admin
    Server "privoserver" for domain "privodomain">
    <Mar 8, 2002 10:40:45 AM PST> <Error> <HTTP> <[WebAppServletContext(604746,wl_management_internal2,/wl_management_internal2)]
    failure extracting WAR classes
    java.io.IOException: Permission denied
    at java.io.UnixFileSystem.createFileExclusively(Native Method)
    at java.io.File.checkAndCreate(File.java:1162)
    at java.io.File.createTempFile(File.java:1247)
    at weblogic.servlet.internal.WebAppHelper.extractClassFiles(WebAppHelper.java:71)
    Thanks in advance for your reply!
    Linden

    Hi
    This is a Unix problem, you may check if you have all the permissions.
    I suspect that some of the files which may be owned by someone other than user-value and therefore preventing the writting to the
    files.
    Can you check the files owership under /usr/local/bea/wlserver6.1/config/mydomain/applications/.wlnotdelete to see if any of the
    files or subdirectories are owned by someone else, such as 'root' or even under different group?"
    Hope this help
    JFG
    Linden Lu wrote:
    I installed weblogic6.1 app server on Solaris box. It works fine at first. Then
    I moved the unix box to anther place which means it has different IP. Then I have
    following exception when I try to start the weblogic server:(I haven't deployed
    any thing in the server yet, so it's just a newly installed weblogic server)
    Starting WebLogic Server ....
    <Mar 8, 2002 10:40:26 AM PST> <Notice> <Management> <Loading configuration file
    /config/mydomain/config.xml ...>
    <Mar 8, 2002 10:40:35 AM PST> <Notice> <WebLogicServer> <Starting WebLogic Admin
    Server "privoserver" for domain "privodomain">
    <Mar 8, 2002 10:40:45 AM PST> <Error> <HTTP> <[WebAppServletContext(604746,wl_management_internal2,/wl_management_internal2)]
    failure extracting WAR classes
    java.io.IOException: Permission denied
    at java.io.UnixFileSystem.createFileExclusively(Native Method)
    at java.io.File.checkAndCreate(File.java:1162)
    at java.io.File.createTempFile(File.java:1247)
    at weblogic.servlet.internal.WebAppHelper.extractClassFiles(WebAppHelper.java:71)
    Thanks in advance for your reply!
    Linden

  • Problems using different tables for base class and derived class

    I have a class named SuperProject and another class Project derived from
    it. If I let SchemaTool generate the tables without specifying a "table"
    extension, I get a single TABLE with all the columns from both classes and
    everything works fine. But if I specify a "table" for the derived class,
    SchemaTool generates the derived class with just one column (corresponds
    to the attribute in derived class). Also it causes problems in using the
    Project class in collection attributes.
    JDO file:
    <jdo>
    <package name="jdo">
    <class name="Project" identity-type="application"
    persistence-capable-superclass="SuperProject">
    <extension vendor-name="kodo" key="table" value="PROJECT"/>
    </class>
    <class name="SuperProject" identity-type="application"
    objectid-class="ProjectId">
    <field name="id" primary-key="true"/>
    </class>
    </package>
    </jdo>
    java classes:
    public class Project extends SuperProject
    String projectSpecific
    public class SuperProject
    BigDecimal id;
    String name;
    tables generated by SchemaTool:
    TABLE SUPERPROJECTSX (IDX, JDOCLASSX, JDOLOCKX, NAMEX);
    TABLE PROJECT(PROJECTSPECIFICX)
    Thanks,
    Justine Thomas

    Justine,
    This will be resolved in 2.3.4, to be released later this evening.
    -Patrick
    In article <aofo2q$mih$[email protected]>, Justine Thomas wrote:
    I have a class named SuperProject and another class Project derived from
    it. If I let SchemaTool generate the tables without specifying a "table"
    extension, I get a single TABLE with all the columns from both classes and
    everything works fine. But if I specify a "table" for the derived class,
    SchemaTool generates the derived class with just one column (corresponds
    to the attribute in derived class). Also it causes problems in using the
    Project class in collection attributes.
    JDO file:
    <jdo>
    <package name="jdo">
    <class name="Project" identity-type="application"
    persistence-capable-superclass="SuperProject">
    <extension vendor-name="kodo" key="table" value="PROJECT"/>
    </class>
    <class name="SuperProject" identity-type="application"
    objectid-class="ProjectId">
    <field name="id" primary-key="true"/>
    </class>
    </package>
    </jdo>
    java classes:
    public class Project extends SuperProject
    String projectSpecific
    public class SuperProject
    BigDecimal id;
    String name;
    tables generated by SchemaTool:
    TABLE SUPERPROJECTSX (IDX, JDOCLASSX, JDOLOCKX, NAMEX);
    TABLE PROJECT(PROJECTSPECIFICX)
    Thanks,
    Justine Thomas
    Patrick Linskey [email protected]
    SolarMetric Inc. http://www.solarmetric.com

  • How to call derived class to base class

    Hello everybody,
    I create a GUi application in java swing. Now i want to navigate between the screen but the timing between the screen is very slow bcoz i imported the class from package to another package. Now i want to extends one package to another package to reduce the navigation time but it saying error bcoz i cant able to call my derived class to base class. if anyone know the answer for this please answer this immediately.
    If any other method is there to optimise the navigation time please tell me
    by
    (kamal)

    Sorry, I've got major difficulties understanding your query:
    I create a GUi application in java
    ication in java swing. ok
    Now i want to navigate between
    the screenwhat? switch screens? display a different dialog?
    but the timing between the screen is very
    slowtiming? do you mean the time it takes to display a different dialog?
    bcoz i imported the class from package to
    another package.how did you come to the conclusion that that is the reason for the slowness? Did you do any profiling or is this just guess-work?

  • Set fields of derived class in base class constructor via reflection?

    Does the Java Language Specification explicitly allow setting of fields of a derived class from within the base class' constructor via reflection? The following test case runs green, but I would really like to know if this Java code is compatible among different VM implementations.
    Many thanks for your feedback!
    Norman
    public class DerivedClassReflectionWorksInBaseClassConstructorTest extends TestCase {
    abstract static class A {
        A() {
            try {
                getClass().getDeclaredField("x").setInt(this, 42);
            } catch (Exception e) {
                throw new RuntimeException(e);
    static class B extends A {
        int x;
        B() {
        B(int x) {
            this.x = x;
    public void testThatItWorks() {
        assertEquals(42, new B().x);
        assertEquals(99, new B(99).x);
    }

    why not just put a method in the superclass that the subclasses can call to initialize the subclass member variable?In derived classes (which are plug-ins), clients can use a field annotation which provides some parameter metadata such as validators and the default value. The framework must set the default value of fields, before the class' initializer or constructors are called. If the framework would do this after derived class' initializer or constructors are called, they would be overwritten:
    Framework:
    public abstract class Operator {
        public abstract void initialize();
    }Plug-In:
    public class SomeOperator extends Operator {
        @Parameter(defaultValue="42", interval="[0,100)")
        double threshold;
        @Parameter(defaultValue="C", valueSet="A,B,C")
        String mode;
        public void setThreshold(double threshold) {this.threshold = threshold;}
        public void setMode(String mode) {this.mode = mode;}
        // called by the framework after default values have been set
        public void initialize() {
    }On the other hand, the default values and other metadata are also used to create GUIs and XML I/O for the derived operator class, without having it instantiated. So we cannot use the initial instance field values for that, because we don't have an instance.

Maybe you are looking for