Problem declaring new Class instance

I would appreciate your help, I am new to programming & decided to learn Java.
The two programs I have tried to write myself have not compiled for the same error:
Javac tells me that it cannot resolve the " = new " syntax, it sees NEW as a variable.
Here is the code for the latest:
public class DBQuery1 {
     String username, password;
     boolean getOut = false;
public class PassDB extends javax.swing.JFrame implements ActionListener {
     JTextField uname = new JTextField(10);
     JPasswordField pword = new JPasswordField(10);
     // codePhrase.setEchoChar('*');
     public PassDB() {
          super("duBe's database logon");
          setSize(260, 160);
          setDefaultCloseOperation(EXIT_ON_CLOSE);
          JPanel pane = new JPanel();
          JLabel unameLabel = new JLabel ("Username: ");
          JLabel pwordLabel = new JLabel ("Password: ");
          JButton submit = new JButton("OK");
          submit.addActionListener(this);
          pane.add(unameLabel);
          pane.add(uname);
          pane.add(pwordLabel);
          pane.add(pword);
          pane.add(submit);
          setContentPane(pane);
          setVisible(true);
          if (getOut == true)
               PassDB.close();
     public void actionPerformed(ActionEvent evt) {
          PassDB clicked = (PassDB)evt.getSource();
          username = uname.getText();
          password = pword.getText();
          getOut = true;
     public static void main(String[] arguments) {
          PassDB UPass = new PassDB();
it goes on, but the problem seems to be with the declaration of " UPass ".
There are other problems with this code that I cannot fix at the moment, but I'll ask those questions when I get this problem fixed.
Any help will be much appreciated, I know it is something silly I have done, but I can't find the problem myself.
duBe

The two programs I have tried to write myself have not
compiled for the same error:
Javac tells me that it cannot resolve the " = new "
syntax, it sees NEW as a variable.It would be interesting to see the error message you are getting - what you have described sounds rather odd - I would expect an error along the lines of "unqualified enclosing instance" or "this can not be referenced from a static context".
You have declared PassDB as an inner class (it is nested inside another class and is not declared static). As somebody else has already said, if you are new to Java, you might be better not doing that for now.
To instantiate an inner class, you need an instance of the deepest nested lexically enclosing class. I'm not going to go into detail about that in the New To Java Technology forum, but if you don't already know or understand that, then perhaps inner classes are too much to be tackling right now.
The syntax for instantiating PassDB is x.new PassDB(), where x is an instance of DBQuery1. Thus new DBQuery1().new PassDB() should compile (though it might not be want you really want). Another option open to you is to use static nested classes - just declare the PassDB class static, and treat it as you would any other class (though now you won't be able to access the non-static fields of DBQuery1 directly)

Similar Messages

  • Creating a new class instance in the target VM exception

    Hello,
    The following error appeared when i was trying to instantiate a new object by "new", After the error was thrown , everything just hanged ....
    [email protected](java.lang.String)+-1 in thread Thread-0
    I tried creating a new instance of any class i wrote it gave me the same behaviour. But when i create a new instance of any of the JRE's (BufferedReader for example) classes it runs normally.
    The error seems to be thrown only in dynamic loading because i tried inheriting from a class i wrote and invoking super() it executed normally. Also the problem is not from setting the class path because i am correctly passing the class path to the target virtual machine.
    So what is the problem ? Any help is greatly appreciated.
    Regard,
    Ahmed Ashmawy

    The hanging part is solved , it was a mistake when handling exception events. But anyways i would appreciate it if i knew why the error is being thrown. It just continues normally as if nothing happened

  • New class instance contains another instance's data

    I am using two constructors to instantiate this class but sometimes when I create the second instance the data from the first instance is in the new instance which corrupts the first instance when I change the data in the second.
    How is it possible for a second new instance of a single class to have the same data/references? It should be a completely new instance with no references to another objects memory space.

    It isn't possible. It's a bug in your code or in your
    interpretation of the result. :) Probably in your interpretation of the result, based on your use of phrases like "memory space". The things in an object's "memory space" are primitives and object references, and it is perfectly possible for two different objects to contain references to the same object.

  • Problem referencing a newly created class instance - I don't understand why

    Hi,
    I am completely new to actionscript although I do come from a OOP background. I have been asked to trial Flash and Actionscript 3 in particular - so I do come with a few preconceptions on how I expect actionscript to behave.
    I have a problem I donot understand. I have created a new class and to test it I use a simple test harness in the form of a .fla file.
    The issue I have is when I create a new instance of the class and assign it to a variable, subsequent background changes to that instance of the class are not 'picked-up' when referenced through the variable. I would expect that given instance of class could be assigned to many different variables and any updates using one variable would  accessible using any of the other variables.
    My test class, XMLDataLoader, is coded as follows:
    package  {   
        public class XMLDataLoader {
            import flash.events.*;
            import flash.net.*;
            import flash.utils.*
            private var _xmlData:XML;
            private var _xmlLoaded:Boolean;
            public function XMLDataLoader(pFileName:String){
                init(pFileName);
            public function getXMLData():XML {
                return this._xmlData;
            public function XMLLoaded():Boolean {
                return this._xmlLoaded;
            private function init(pFileName:String):void
                // Create the URLLoader instance to be able to load data
                  var loader:URLLoader = new URLLoader( );
                var urlRequest:URLRequest = new URLRequest(pFileName);
                this._xmlLoaded = false;
                // Define the event handlers to listen for success and failure
                   loader.addEventListener ( Event.COMPLETE, handleComplete );
                loader.load(urlRequest);
                function handleComplete ( e:Event ):void
                    trace ( "The data has successfully loaded" );
                    this.xmlData = new XML(e.currentTarget.data);
                    this._xmlLoaded = true;
    The class simply reads a text file and assigns its contents to the class variable _xmlData. The class variable _xmlLoaded identifies when the load is complete.
    The test harness is a simple flash app consisting if a single timeline with 1 frame, 1 symbol on the stage and the following actionscript code:
    import flash.events.TimerEvent;
    var t:XMLDataLoader = new XMLDataLoader("Test Article.xml");
    var xmlData:XML;
    var waits:uint = 0;
    wait(1);
    function wait(ct:uint):void
        var TimerInstance:Timer = new Timer(500, 1);
        TimerInstance.addEventListener(TimerEvent.TIMER, TimerHandler);
        TimerInstance.start();
        function TimerHandler(event:TimerEvent):void
           if(t.XMLLoaded()){
                xmlData = t.getXMLData();  
                trace(xmlData.toXMLString);
            } else {
                trace(ct + " - Waiting....");
                if (ct <= 10) {
                    wait(++ct);
    The script defines a variable and assigns it a new instance of the XMLDataLoader. Originally, I immediately followed this with a trace statement but  insuffient time had elapsed to allow the load to complete, so I had to introduce a wait function to force a delay. This wait function is recursive. It checks to see if the load is complete. If it is, a trace statement will outoput the xml. If not the function will call itself again (upto 10 times)
    The resultant output is as follows:
    The data has successfully loaded
    1 - Waiting....
    2 - Waiting....
    3 - Waiting....
    4 - Waiting....
    5 - Waiting....
    6 - Waiting....
    7 - Waiting....
    8 - Waiting....
    9 - Waiting....
    10 - Waiting....
    According to this output, the XML has been loaded before the end of the first timer cycle but this is not detected in the test harness. I have stepped through the code in debug mode and I have confirmed that the XML was loaded, and the class variables where correctly set, including _xmlLoaded = true. However, in the test harness the instance both class variables  are null. I don't believe this should be the case but obviously I must be wrong - can anyone explain where my logic is flawed. I did think scoping might be the problem but having tried a couple of modifications, I concluded that it wasn't.
    Thanks in advance.

    never nest named functions.  unnest TimerHandler and retest.
    (and, you should be using listener to determine when loading is complete.)

  • Webutil-Problem (not the usual "PRE-FORM", "WHEN-NEW-FORM-INSTANCE" etc.)

    Hello,
    We have an application with lots of modules, where we use webutil to create text files on the client for data exports. The export is called in a WHEN-BUTTON-PRESSED Trigger and usually works fine, but we have the following problem:
    If two modules, where webutil is used, are opened at the same time and one module is closed, webutil does not function anymore in the other module. If we then try to create a text file after closing on module, we get the following error-message:
    Oracle.forms.webutil.file.FileFunctions bean not found.
    WEBUTIL.FILE.FILE_SELECTION_DIALOG_INT will not work.
    It’s not only the FileFunctions bean, all other webutil functions do not work also anymore in the remaining module.
    This is not the usual “PRE-FORM”, “WHEN-NEW-FORM-INSTANCE” etc. Webutil-Problem.
    As I said before, webutil works, but when we close one module with webutil used, it does not work in another open module anymore.
    Any Idea, why this happens and how to solve the problem???
    Kind regards
    Udo

    Hello,
    Yes, both modules work in the the same session and session is not disconnected, when one of the modules is closed.
    Webutill.pll is attached on both forms and all forms in our application using webutil usually work fine with the exception mentioned above.
    It's a bit difficult to explain, what happens in our application, but I try:
    Our application consists of modules that call other modules with call_form or go_form , when the module is open, all in the same session. "Global" Parameters are passed with SHARE_LIBRARY_DATA. Usually the calling forms stays open.
    In the following constellation webutil does not work anymore at a certain point :
    - Open module A (with webutil attached) and webutil works
    - Then module A calls module B (with webutil attached) and webutil works in module B
    - GO_FORM (module A) and webutil still works (while module B is still open)
    - CALL_FORM (module C) (in our case webutil is not attached to this module, but I think that is not the problem) module C closes module B (while module A stays open)
    - After making a choice in module C, module C closes itself with EXIT_FORM.
    - Go back to the open module A, make a new query with the choice made in module C and webutil does not work anymore in module A
    Regards
    Udo

  • Developing new Swing Components - Visibility problems with UI classes

    I was wondering if anyone out there had run into the following problems when developing new Swing components. If so it might be worth banding together and putting pressure on Sun to fix them. However, if no one else develops new Swing components then I guess I'm just a lone voice...
    I have been writing a new dockable toolpanel Swing component and when it came to implementing the UI manager I was unable to access many of the standard features in basic and metal LAFs because they had been made package protected. This forced me to reimplement quite a bit of existing code which took time as well as being bad practice.
    While in some cases I can understand this from a security POV I am pretty sure that in this case it is the result of lazy programming practice. Appart from basic architectural reasons for this I have noticed a trend where newer code seems to suffer from this more than the original code. The practice of using package protection reminds me of C++ style coding, or just that of an inexperienced developer who does not understand the need to code for extensibility.
    An additional problem arises because the Security manager stops you cheating the system by putting new classes into the javax.swing.plaf... package structure. Thus the only way to solve this nicely is a proper fix.
    This would entail going through all the UI PLAF classes and rationalizing the visibility to either public or protected as appropriate. Really there should be minimal use of package protection unless it is vital for security concerns.
    Some Examples (there are many more):
    javax.swing.plaf.basic.LazyActionMap
    javax.swing.plaf.basic.BasicBorders.RolloverMarginBorder
    javax.swing.plaf.basic.BasicBorders.SplitPaneDividerBorder (why are just these two classes package protected when all the others are public?)
    javax.swing.plaf.metal.MetalUtils
    javax.swing.plaf.metal.MetalBumps
    Anyway, I am happy to give advice to other poor saps who wind up fighting the UI manager but it would be better if we could get Sun to sort out this mess (after all they created it).
    Cheers, Lewis

    It may be more a case of creating new Swing components and trying to provide support for all the standard LnFs.
    This is very awkward although you can sometimes achieve what you want by borrowing resources from UIManager (a border here, an icon there etc.).
    Essentially the problem is that Swing is designed to have new components added to it but the standard LnFs aren't quite so accommodating!

  • WARNING: Problem validating implementation class. Exception declaration mis

    I have created sample class using JDevStudio10.1.3
    Added method getX() throws Ex (Ex implements Exception)
    Select class and generated J2EE 1.4 RPC webservices
    Got the warning :
    Generating WSDL and mapping file
    WARNING: Problem validating implementation class. Exception declaration mismatch between Implementation: mypackage.Class3 and Interface: mypackage.MyWebService3. Impl class Method: X declares exceptions not declared by the interface (mypackage.Exp)
    Now When I generated client proxy from the wsdl generated, Ex class is not getting generated.
    Can some one help me please.
    Thanks in advance

    If you are using Ex in the implemetation class, make sure that you also include the same in the interface (or SEI).
    If the implementation looks something like:
    public void doSomething() throws Ex {
    System.out.println("Is there something to do, now ?");
    then the SEI should be:
    public void doSomething() throws Ex, RemoteException;
    If your have ommited Ex, then you will have the warning you are seing, and there wont be any artifact generated for Ex in the WSDL.
    Because the Ex exception was not mapped to any WSDL artifact, there is no way you will see the Ex exception generated on the client side (or proxy).
    I have been able to reproduce your error message, so you should be all good.
    WARNING: Problem validating implementation class. Exception declaration mismatch between Implementation: bugyyy.MyServiceImpl and Interface: bugyyy.MyWebService. Impl class Method: doSomething declares exceptions not declared by the interface (bugyyy.Ex)
    Hope this helps,
    Eric

  • Classification System CA-CL: Problems / Dumps while using a new class type

    Hi All,
    You'd really make my day by helping me out w. hints or even a solution. Would reward points for your efforts...
    The problem: in order to develop a class hierachy of product groups (in industry system, Rel. 6.40) I created a new class type (let's call it ZWG).
    While doing so R/3 requsted me to provide info on the objects to assign to this class type as well as the transaction for displaying these objects. For Product Groups (material classes) this is object-table T023 and transaction WG24.
    Furthermore the sys demands the implementation of a function module. This module's task is to check the existence of a given object as well as the locking and later unlocking in the process of classifying objects. Following SAP's naming convention I implemented and activated FM OBJECT_CHECK_T023.
    After that I created a new class (FIRST_CLASS) of class-type ZWG.
    I managed to assign exactly one (1) prod-grp to this class but afterwards I only receive dumps while using transactions CL20N, CL24N  to assign objects.
    The Message from ST22 says:
    Assignment error: Overwriting a protected field.
    Error in ABAP application program.                                                                               
    The current ABAP program "SAPLCLCV" had to be terminated because one of the 
    statements could not be executed.                                                                               
    This is probably due to an error in the ABAP program.                       
    Do I have to debug throughout thís enormous amount of coding now? :-(((
    Hope someone get's my "message in a bottle"
    Best Regards
    Udo

    Yatin please see attached for warning.I am trying to create Z class using 001

  • Problem with a new ITS instance

    Hi All
    I just install a new ITS instance in a windows box that already had one ITS running, The first ITS is running on port 80 and it work perfectly but the new instance i just install running on port 83 instead of showing me the ITS logon page it ask me if i want to download the pzm3! file when calling http://<server>:83/scripts/wgate/pzm3!
    IACOR is configured, ITS published, etc...
    Im using ITS 6.20, IIS and windows 2003...
    Any ideas???
    Points will be rewarded
    Thanks!
    Juan

    The problem is solved now, on the properties of the Virtual Directory Scrpts & executables has to be enabled.
    Regards
    Juan

  • Adding a new class with Creator (really simple problem i think..)

    I added a new class to my project with creator...
    class name is "CambiaNote" and there's a method called Cambia
    tabellaselezionabile is my project(package)
    I tried to run everything but It gave me an error:
    Exception Details:  org.apache.jasper.JasperException
      Error getting property 'cambia' from bean of type tabellaselezionabile.Page1I don't know, but the word cambia don't exists at all in my code... or it is not case sensitive..?
    please help, thanks

    typo: correct Paint() to paint()

  • Reusing a variable from a new object instance

    I'm developing a stock list array for an assignment I'm currently working on. I've got most of it done, and it seems to be working for the most part, but I'm having trouble getting an array to accept individual variable entries created by new object instances in TestQ3.java.
    I think problem is because the variable itemCode in CraftItem.java is being overwritten by the creation of a new object instance in the TestQ3.java file. I've tested it and believe this to be true.
    I can add a String of my own choosing by using testArray.addCraftItemToStock(itemCode); line but I want to get the program to reuse the itemCode values that have already been created by the four new object instances in TestQ3.java. For example, I want to be able to add more instances of them to the testArray.
    As I'm still relatively new to Java programming, I'm wondering how to do this. I've tried several solutions but I'm not getting anywhere. I'd appreciate it if anyone has any ideas?
    Here's my code:
    TestQ3.java
    public class TestQ3 {
      public static void main(String args[]) {
        // creating a new StockItem array
        CraftStock testArray = new CraftStock(CraftStock.initialStockCapacity);
        // creating new object instance for Glue
        Glue gluePVA = new Glue("PVA Glue",250,"789012",2.50);
        // adds gluePVA item code to the testArray list
        // testArray.addCraftItemToStock(gluePVA.getItemCode());
        // creating new object instance for Card
        Card colouredCard = new Card ("Coloured Card","A3","654321",1.25);
        // adds coloured card item code to the testArray list
        // testArray.addCraftItemToStock(colouredCard.getItemCode());
        // creating new object instance for Glue
        Glue superGlue = new Glue ("Super Glue",25,"210987",1.50);
        // adds superGlue item code to the testArray list
        // testArray.addCraftItemToStock(superGlue.getItemCode());
        // creating new object instance for Card
        Card whiteCard = new Card ("White Card","A4","123456",0.50);
        // adds superGlue item code to the testArray list
        // testArray.addCraftItemToStock(whiteCard.getItemCode());
        // display complete stocklist
        testArray.displayCraftStockList();
        // this adds the itemCode from gluePVA to the array but
        // it comes out as the last itemCode entry 123456 rather than 789012
        // when I run the code. The problem may lie with variable itemCode
        testArray.addCraftItemToStock(gluePVA.getItemCode());
        // display complete stocklist
        testArray.displayCraftStockList();
    CraftItem.java
    public class CraftItem {
      // instance variables
      public static String itemCode;
      private double price;
      //private int stockCount;
      // constructor
      public CraftItem(String itemCodeValue, double itemPriceValue){
        itemCode = itemCodeValue;
        price = itemPriceValue;
        //CraftStock.addCraftItemToStock(itemCode);
        //stockCount++;
      // getter for itemCode
      public String getItemCode() {
        return itemCode;
      // getter for price
      public double getPrice() {
        return price;
      // setter for itemCode
      public void setItemCode(String itemCodeValue) {
        itemCode = itemCodeValue;
      // setter for price
      public void setPrice(double itemPriceValue) {
        price = itemPriceValue;
      // toString() value
      public String toString() {
        return "Item code is " + itemCode + " and costs " + price + " pounds.";
    Glue.java
    public class Glue extends CraftItem{
      // Instance variables
      private String glueType;
      private double glueVolume;
      // Constructor
      public Glue(String glueType, double glueVolume,
       String itemCodeValue, double itemPriceValue) {
            super(itemCodeValue, itemPriceValue);
            glueType = glueType;
            glueVolume = glueVolume;
      // getter
      public String getGlueType() {
        return glueType;
      // getter
      public double getGlueVolume() {
        return glueVolume;
      // setter
      public void setGlueType(String glueTypeValue) {
        glueType = glueTypeValue;
      public void setGlueVolume(double glueVolumeValue) {
        glueVolume = glueVolumeValue;
      // toString
      public String toString() {
        return glueType + ", " + glueVolume + "ml, item code is "
         + super.getItemCode() + " and costs " + super.getPrice() + " pounds.";
    Card.java
    public class Card extends CraftItem{
      // instance variables
      private String cardType;
      private String cardSize;
      // Constructor
      // added super(itemCodeValue, itemPriceValue) to call on CraftItem
      public Card(String cardTypeValue, String cardSizeValue,
       String itemCodeValue, double itemPriceValue) {
            super(itemCodeValue, itemPriceValue);
            cardType = cardTypeValue;
            cardSize = cardSizeValue;
      // getter
      public String getCardType() {
        return cardType;
      // getter
      public String getCardSize() {
        return cardSize;
      // setter
      public void setCardType(String cardTypeValue) {
        cardType = cardTypeValue;
      // setter
      public void setCardSize(String cardSizeValue) {
        cardSize = cardSizeValue;
      // toString
      // using super. to call on methods from superclass CraftItem
      public String toString() {
        return cardType + ", size " + cardSize + ", item code is "
         + super.getItemCode() + " and costs " + super.getPrice() + " pounds.";
    CraftStock.java
    public class CraftStock {
        public static int currentStockLevel;
        public static String[] craftStock;
        public static int initialStockCapacity = 10;
        public CraftStock(int initialStockCapacity) {
            currentStockLevel = 0;
            craftStock = new String[initialStockCapacity];
        public int currentStockLevel() {
            return currentStockLevel;
        public static void addCraftItemToStock(String itemCodeValue) {
            if(currentStockLevel == 10){
              System.out.println("Stock list full: cannot add new item code." +
                "\nPlease remove an item if you want to add a new one.");
            else{
            craftStock[currentStockLevel] = itemCodeValue;
            currentStockLevel++;
            System.out.println("Item added");
        public void removeCraftItemFromStock(String itemCode){
          findStockItem(itemCode);
          int i = -1;
            do {
                i++;
            } while (!craftStock.equals(itemCode));
    for (int j = i; j < currentStockLevel - 1; j++) {
    craftStock[j] = craftStock[j + 1];
    currentStockLevel--;
    System.out.println("Item removed");
    private int findStockItem(String itemCode){
    int index = 0;
    for(int i = 0; i < currentStockLevel; i++){
    if(craftStock[i].equals(itemCode)){
    index = i;
    break;
    else{
    index = -1;
    return index;
    public void displayCraftStockList() {
    if(currentStockLevel == 0){
    System.out.println("There are no items in the stock list");
    else{
    for(int i = 0; i < currentStockLevel; i++){
    System.out.println("Item at " + (i + 1) + " is " + craftStock[i]);
    Message was edited by:
    Nikarius

    An instance variable relates to an object. If you require a variable to be available across multiple objects of the same class then I suggest you declare a class variable using the static keyword in your declaration.
    HTH

  • How can i add custom attributes to a new Class Object using the API ?

    Hello everyone,
    Here is my problem. I just created a subclass of Document using the API (not XML), by creating a ClassObjectDefinition and a ClassObject. Here is the code :
    // doc is an instance of Document
    ClassObject co = doc.getClassObject();
    ClassObjectDefinition cod = new ClassObjectDefinition(ifsSession);
    cod.setSuperclass(co);
    cod.setSuperclassName(co.getName());
    cod.setName("MYDocument");
    ClassObject c = (ClassObject)ifsSession.createSchemaObject(cod);
    Everything seems to be OK since i can see the new class when i use ifsmgr. But my question is : how can i add custom attributes to this new class ? Here is what i tried :
    AttributeDefinition value = new AttributeDefinition(ifsSession);
    value.setAttribute("FOO", AttributeValue.newAttributeValue("bar"));
    c.addAttribute(value);
    But i got the following error message :
    oracle.ifs.common.IfsException: IFS-30002: Unable to create new LibraryObject
    java.sql.SQLException: ORA-01400: impossible d'insirer NULL dans ("IFSSYS"."ODM_ATTRIBUTE"."DATATYPE")
    oracle.ifs.server.S_LibraryObjectData oracle.ifs.beans.LibrarySession.DMNewSchemaObject(oracle.ifs.server.S_LibraryObjectDefinition)
    oracle.ifs.beans.SchemaObject oracle.ifs.beans.LibrarySession.NewSchemaObject(oracle.ifs.beans.SchemaObjectDefinition)
    oracle.ifs.beans.SchemaObject oracle.ifs.beans.LibrarySession.createSchemaObject(oracle.ifs.beans.SchemaObjectDefinition)
    void fr.sword.ifs.GestionDocument.IFSDocument.createDocument(java.lang.String)
    void fr.sword.ifs.GestionDocument.IFSDocument.main(java.lang.String[])
    So, what am i doing wrong ?
    More generally, are we restricted in the types of the attributes ? (for example, would it be possible to add an attribute that would be an inputStream ? Or an object that i have already created ?).
    Any help would be appreciated. Thanks in advance.
    Guillaume
    PS : i'm using Oracle iFS 1.1.9 on NT4 SP6 and Oracle 8.1.7
    null

    Hi Guillaume,
    you're welcome. Don't know exactly, but assume that ATTRIBUTEDATATYPE_UNKNOWN
    is used to check for erronous cases only
    and it shouldn't be used otherwise.
    Creating your own objects could be simply done via
    ClassObject ifsClassObject;
    DocumentDefinition ifsDocDef = new DocumentDefinition(ifsSession);
    // get class object for my very own document
    ifsClassObject = ClassObject.getClassObjectFromLabel(ifsSession, "MYDOCUMENT");
    // set the class for the document i'd like to create
    ifsDocDef.setClassObject(ifsClassObject);
    // set attributes and content for the document...
    ifsDocDef.setAttribute("MYFOO_ATTRIBUTE",....);
    ifsDocDef.setContent("This is the content of my document");
    // create the document...
    PublicObject doc = ifsSession.createPublicObject(ifsDocDef);
    null

  • JBO-25017:Error occurred while creating a new entity instance (URGENT)

    Hello, can anybody help me?
    We have a project that uses BC4J business components and UIX-based web tier. The entity object that causes this problem is based on Oracle table with 'ID' key field, the value is generated by means of 'before_ins' trigger that inserts appropriate sequence's next value.
    In the java EntityImpl-based class we redefine protected 'create' method of the base class:
    protected void create(AttributeList attributeList)
    super.create(attributeList);
    SequenceImpl idSeq = new SequenceImpl("SEQ_CATPARAMETERS", getDBTransaction());
    setId( idSeq.getSequenceNumber() );
    The fault is in the third line - setId(...) causes the exception.
    The only description of JBO-25017 I found is
    http://www.ffpmp.ru/doc/rt/oracle/jbo/CSMessageBundle.html#EXC_ENTITY_ROW_CREATE, this one don't throw any light on the problem.
    Oracle server version - 9.2.0.1
    Oracle JDeveloper version - 9.0.3.10.35,
    BC4J version - 9.0.3.10.7
    Any ideas?

    Roman,
    It looks like you're trying to assign the Id in two places.
    EITHER:
    Override the create method to assign an Id when a new entity instance is created....
    OR:
    Define a database trigger to insert the Id (and set the "refresh after insert" attribute to true).
    [Maybe the error is thrown because you're attempting to set a field which is set to refresh?]
    Does that make any sense?
    Mike

  • WebUtil doesn't work when called from WHEN-NEW-FORM-INSTANCE trigger

    I need WEBUTIL_CLIENTINFO functions to know some information from the client, like IP, JavaVersion, Hostname, OS user, etc. This functions I call through WHEN-NEW-FORM-INSTANCE TRIGGER and this doesn't nor work. I obtain the next message and error:
    oracle/forms/webutil/clientinfo/GetClientInfo.class not found. WEBUTIL_CLIENTINFO.GET_IP_ADDRESS.
    But when I call this WebUtil functions through WHEN-WINDOW-ACTIVATED trigger or through a button it works. Why?. I need call WebUtils in the WHEN-NEW-FORM-INSTANCE trigger!
    Any help will be of great value.

    Basically make a timer...
    Do you have the wu_test_106.fmb file that comes with the webutil install?
    If you look in the wnfi trigger you will see this...
    declare
         fake_timer TIMER;
    begin
         -- Purpose of the fake timer is the we cannot call webutil in this trigger since the
         -- beans have not yet been instantiated.  If we put the code in a when-timer-expired-trigger
         -- it means that this timer will not start running until Forms has focus (and so the webutil
         -- beans will be instantiated and so call canbe made.
         fake_timer:= CREATE_TIMER('webutil',100,NO_REPEAT);
         --create_blob_table;
         null;
    end;And in the form level when-timer-expired you will see this...
         :global.user_home := webutil_clientinfo.get_system_property('user.home');
         :OLE.FILENAME := :global.user_home||'\temp.doc';
         SET_ITEM_PROPERTY('builtins.text_io_item',PROMPT_TEXT,'Write to '||:global.user_home||'\helloworld.txt');
         SET_ITEM_PROPERTY('files.userdothome',PROMPT_TEXT,:global.user_home);

  • How to create new OC4J instance in AS 10.1.3 with BC4J- and ADF-Libraries

    Hi
    I have done all the steps mentioned in this thread:
    How to create new OC4J instance in AS 10.1.3
    However, the new created OC4J instance obviously misses some libraries. If I deploy my Application to this OC4J I get an internal error: Class not found: oracle.jbo.JboException.
    The same Application runs well in the "home" Instance.
    What is the trick, to create a new OC4J instance, which more or less behaves the same way as the "home" instances (and especially has all the same libraries)?
    Thanks for your help
    Frank Brandstetter

    I encountered this last month. I definitely agree that it is a glaring omission to not have "Create Like" functionality when instantiating new containers. Here's my notes on the manual steps required after using createinstance to create the fresh container. Not too bad. I've been deploying ADF applications to the new container with no problems after this.
    ==============
    The default (home) OC4J container is pre-configured for ADF 10.1.3 applications; however, when $ORACLE_HOME/bin/createinstance is used to create additional containers, these containers are not configured automatically to host ADF 10.1.3 applications.
    I followed these manual steps:
    1. $ORACLE_HOME/j2ee/home/config/server.xml defines three shared libraries that "install" the needed JARs for Oracle ADF applications in your application server instance (container). Note that "install" does not necessarily mean available to applications (see Step 2). Copy the three shared library element definitions to the <application-server> element of your new container (in server.xml).
    <shared-library name="oracle.expression-evaluator" version="10.1.3" library-compatible="true">
         <code-source path="/usr2/oracle/as10130/jlib/commons-el.jar"/>
         <code-source path="/usr2/oracle/as10130/jlib/oracle-el.jar"/>
         <code-source path="/usr2/oracle/as10130/jlib/jsp-el-api.jar"/>
    </shared-library>
    <shared-library name="adf.oracle.domain" version="10.1.3" library-compatible="true">
         <code-source path="/usr2/oracle/as10130/BC4J/lib"/>
         <code-source path="/usr2/oracle/as10130/jlib/commons-cli-1.0.jar"/>
         <code-source path="/usr2/oracle/as10130/mds/lib/concurrent.jar"/>
         <code-source path="/usr2/oracle/as10130/mds/lib/mdsrt.jar"/>
         <code-source path="/usr2/oracle/as10130/jlib/share.jar"/>
         <code-source path="/usr2/oracle/as10130/jlib/regexp.jar"/>
         <code-source path="/usr2/oracle/as10130/jlib/xmlef.jar"/>
         <code-source path="/usr2/oracle/as10130/BC4J/jlib/adfmtl.jar"/>
         <code-source path="/usr2/oracle/as10130/BC4J/jlib/adfui.jar"/>
         <code-source path="/usr2/oracle/as10130/BC4J/jlib/adf-connections.jar"/>
         <code-source path="/usr2/oracle/as10130/BC4J/jlib/dc-adapters.jar"/>
         <code-source path="/usr2/oracle/as10130/ord/jlib/ordim.jar"/>
         <code-source path="/usr2/oracle/as10130/ord/jlib/ordhttp.jar"/>
         <code-source path="/usr2/oracle/as10130/jlib/ojmisc.jar"/>
         <code-source path="/usr2/oracle/as10130/jlib/jdev-cm.jar"/>
         <code-source path="/usr2/oracle/as10130/lib/xsqlserializers.jar"/>
         <import-shared-library name="oracle.xml"/>
         <import-shared-library name="oracle.jdbc"/>
         <import-shared-library name="oracle.cache"/>
         <import-shared-library name="oracle.dms"/>
         <import-shared-library name="oracle.sqlj"/>
         <import-shared-library name="oracle.toplink"/>
         <import-shared-library name="oracle.ws.core"/>
         <import-shared-library name="oracle.ws.client"/>
         <import-shared-library name="oracle.xml.security"/>
         <import-shared-library name="oracle.ws.security"/>
         <import-shared-library name="oracle.ws.reliability"/>
         <import-shared-library name="oracle.jwsdl"/>
         <import-shared-library name="oracle.http.client"/>
         <import-shared-library name="oracle.expression-evaluator"/>
    </shared-library>
    <shared-library name="adf.generic.domain" version="10.1.3" library-compatible="true">
         <code-source path="/usr2/oracle/as10130/BC4J/jlib/bc4jdomgnrc.jar"/>
         <code-source path="/usr2/oracle/as10130/BC4J/lib"/>
         <code-source path="/usr2/oracle/as10130/jlib/commons-cli-1.0.jar"/>
         <code-source path="/usr2/oracle/as10130/mds/lib/concurrent.jar"/>
         <code-source path="/usr2/oracle/as10130/mds/lib/mdsrt.jar"/>
         <code-source path="/usr2/oracle/as10130/jlib/share.jar"/>
         <code-source path="/usr2/oracle/as10130/jlib/regexp.jar"/>
         <code-source path="/usr2/oracle/as10130/jlib/xmlef.jar"/>
         <code-source path="/usr2/oracle/as10130/BC4J/jlib/adfmtl.jar"/>
         <code-source path="/usr2/oracle/as10130/BC4J/jlib/adfui.jar"/>
         <code-source path="/usr2/oracle/as10130/BC4J/jlib/adf-connections.jar"/>
         <code-source path="/usr2/oracle/as10130/BC4J/jlib/dc-adapters.jar"/>
         <code-source path="/usr2/oracle/as10130/ord/jlib/ordim.jar"/>
         <code-source path="/usr2/oracle/as10130/ord/jlib/ordhttp.jar"/>
         <code-source path="/usr2/oracle/as10130/jlib/ojmisc.jar"/>
         <code-source path="/usr2/oracle/as10130/jlib/jdev-cm.jar"/>
         <code-source path="/usr2/oracle/as10130/lib/xsqlserializers.jar"/>
         <import-shared-library name="oracle.xml"/>
         <import-shared-library name="oracle.jdbc"/>
         <import-shared-library name="oracle.cache"/>
         <import-shared-library name="oracle.dms"/>
         <import-shared-library name="oracle.sqlj"/>
         <import-shared-library name="oracle.toplink"/>
         <import-shared-library name="oracle.ws.core"/>
         <import-shared-library name="oracle.ws.client"/>
         <import-shared-library name="oracle.xml.security"/>
         <import-shared-library name="oracle.ws.security"/>
         <import-shared-library name="oracle.ws.reliability"/>
         <import-shared-library name="oracle.jwsdl"/>
         <import-shared-library name="oracle.http.client"/>
         <import-shared-library name="oracle.expression-evaluator"/>
    </shared-library>
    2. To make the necessary ADF and JSF support libraries available to your deployed ADF application, the default application (that your ADF application and the majority of applications should inherit from) should explicitly import the shared library in the <orion-application> element of $ORACLE_HOME/j2ee/<your container>/config/application.xml.
    <imported-shared-libraries>
         <import-shared-library name="adf.oracle.domain"/>
    </imported-shared-libraries>
    Note: the adf.oracle.domain shared library imports several other shared libraries including oracle.expression-evaluator.

Maybe you are looking for