Having problems linking two java classes getting a "deprecated API" error??

Hi,
I am tryin to link one page to another in my program, however i get the followin msg:-
Project\alphaSound.java uses or overrides a deprecated API.
Note: Recompile with -deprecation for details.
Process completed.
this only happens when i add the bold piece of code to the class; even though the italic piece of code does take you to a new page?:-
public class alphaSound extends JPanel implements ActionListener
{static JFrame f = new JFrame("AlphaSound");
public alphaSound() {
public void actionPerformed(ActionEvent event) {
             Object source = event.getSource();
else if(source == vowel)
{ Vowelm vm = new Vowelm();
vm.setSize(Toolkit.getDefaultToolkit().getScreenSize());
vm.show();
f.dispose();
else if(source == back)
{ MainPage main = new MainPage();
main.setSize(400,300);
main.show();
f.dispose();}
public static void main(String s[]) {
        WindowListener l = new WindowAdapter() {
            public void windowClosing(WindowEvent e) {System.exit(0);}
        //JFrame f = new JFrame("AlphaSound");
        f.addWindowListener(l);
        f.getContentPane().add(new alphaSound());
        f.setSize(Toolkit.getDefaultToolkit().getScreenSize()); 
        f.show();
}here is the class its tryin to call
public class Vowelm extends JPanel implements ActionListener
{static JFrame v = new JFrame("VowelSound");
   public Vowelm() {
                                               ..etc...
public static void main(String s[]) {
        WindowListener l = new WindowAdapter() {
            public void windowClosing(WindowEvent e) {System.exit(0);}
        //JFrame f = new JFrame("VowelSound");
        v.addWindowListener(l);
        v.getContentPane().add(new VowelmSound());
        v.setSize(Toolkit.getDefaultToolkit().getScreenSize()); 
        v.show();
}Im pretty sure ther is some conflict between the two classes due to the way they are called and designed?
Hope you can help!
Kind Regards
Raj

You may want to check your show() calls and see if
they can be replaced with setVisible(). Forexample,
in your Vowelm code, you have a static JFrame v.
At
the end of your main function, you use v.show().As
of JDK1.1, this has been deprecated in favour of
setVisible(boolean).hey show() in JFrame is from Window and in windowits
not deprecated ..
show is not decrecated thats for sure ... i dontknow
y you said that ...
you can look in docs as well..
True - but this in turn overrides show() from
java.awt.Component, which has been deprecated. My
guess is that's where the problem comes from.
Thanks for the Dukes!
FlicAnd then again - perhaps not. After looking into this a bit more, I take back my last comment about the Component override. However, as I said in my original reply, compiling with -deprecation should tell you which show() call is flagging the error. There is definitely one somewhere that the JVM doesn't like - without seeing your complete code, it's hard to say exactly where. Based on what you've posted, my guess is that it is within the Vowelm class.
Next time, I'll try to avoid 'shooting from the hip'.
Again, thanks for the Dukes,
Flic

Similar Messages

  • Having problem running CC Package Manager - getting a ridiculous nonsense error saying "Oops, something has gone wrong, try again"!

    Is any body able to help?
    Clive

    Hi Clive,
    Clean up cached user login information.
    Close the Creative Cloud Desktop application.
    Navigate to the OOBE folder.
    Windows: [System drive]:\Users\[user name]\AppData\Local\Adobe\OOBE
    Mac OS: /Users/[user name]/Library/Application Support/Adobe/OOBE
    Delete the OPM.db file.
    Launch the Creative Cloud Desktop application.

  • I am having problems because two phone numbers are on the Apple ID, how do I choose one for imessage?

    I am having problems because two phone numbers are on the Apple ID, how do I choose one for imessage?

    Hello,
    In my opinion, this is the best procedure to use to update your BB OS:
    http://supportforums.blackberry.com/t5/BlackBerry-Device-Software/How-To-Reload-Your-Operating-Syste...
    However, the official download site:
    http://us.blackberry.com/support/downloads/download_sites.jsp
    shows your installed OS to be the current version from your carrier. Therefore, how your friends got a newer OS is a question to ask them and/or your carrier.
    You are, of course, free to use (via the above procedure) any carriers OS package...if another has the newer OS you want, you can use it. If you choose to do so, then simply insert, between steps 1 and 2 in the above procedure, the deletion, on your PC, of a file named VENDOR.XML
    Good luck.
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Execution problem a stored java class

    Hi,
    I loaded a java class ("ConvertisseurXMLPDF") in an oracle 8.1.7 database and in a specific schema "SCHEMA1".
    I loaded it with the loadjava command included the -synonym and the -grant attributes to create the public synonym on this class and the grant execute to a role "ROLE1".
    Problem :
    I connect with a user "USER1" which is associated to the role "ROLE1" (so, he should have the execution privilege on the class) and
    When I execute the procedure which launches the execution of the java class, I have the following error message :
    java.lang.illegalAccessException
    at java.lang.Class.newInstance0(Class.java)
    at java.lang.Class.newInstance(Class.java)
    at ConvertisseurXMLPDF.createParser(ConvertisseurXMLPDF.java:162)
    at ConvertisseurXMLPDF.converssion(ConvertisseurXMLPDF.java:162)
    It seems, it does not even achieve to instantiate the class!
    What could be the reason of this problem?
    Thanks in advance
    bye
    [email protected]
    null

    Make sure you have the following privileges:
    grant javasyspriv to schema1;
    grant javauserpriv to role1;
    Jack

  • I am having problems to run logic pro 9, there is an error display that says I need to set bonjour and that this app serial number has been used by another red user,  could anybody guide me?

    I am having problems to run logic pro 9, there is an error display that says I need to set bonjour and that this app serial number has been used by another red user,  could anybody guide me? actually, my computer can't start  since three days ago, could it be the same problem?

    Logic is the APPlication (program, app) that you are having the problem with.
    Logic Pro can take advantage of other computers on your local (home or work) network to help it do "heavy lifting" data chores by using Bonjour and a feature called Nodes.   It seems that Logic is attempting to find and connect to another machine on your network.
    Do you have Logic installed on another computer there?  That may be the source of the confilict.
    You might want to post this question in the Logic Pro Community.
    Be sure to indicate the version of Logic Pro that you are using.  I'm sure the folks there can help you out.

  • TS3694 I am having problem with my iphone 3g update, its showing 1015 error. someone please help me out. Thanks

    I am having problem with my iphone 3g update, its showing 1015 error. someone please help me out. Thanks

    nomibutt wrote:
    ... its showing 1015 error.
    Unauthorized modification of iOS
    http://support.apple.com/kb/HT3743
    ERROR 1015...
    This Error Code is indicative of the Device being jailbroken / Hacked...
    Sorry... But...
    The discussion of Jailbroken Devices is against the Terms of Use of this Forum.
    You will need to look elsewhere.

  • Two problems with two different classes.

    im having two problems: i get nothing with the printConferences() method inside ReferenceBook class, the arraylist size is equal to zero. and my printSchoolsAndCopies() and schoolsAndCopiesToArray() methods which are inside TextBook class, give exceptions:
    Exception in thread "main" java.lang.ArrayStoreException at java.lang.System.arraycopy(Native Method) at java.util.ArrayList.toArray(ArrayList.java:304) at project3.TextBook.schoolsAndCopiesToArray(TextBook.java:64) at project3.TextBook.printSchoolsAndCopies(TextBook.java:74) at project3.BookTester.main(BookTester.java:27) Java Result: 1 BUILD SUCCESSFUL (total time: 0 seconds)
    all you need to read is TextBook and ReferenceBook class, but i added the tester and BookCatalog, which is an arraylist of books.
    here are my TextBook and ReferenceBook classes and the tester, there are two abstract classes Book and TechnicalBook, but i wont post them unless anybody needs them, i presume not.
    * TextBook.java
    * Created on April 19, 2007, 8:02 PM
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    package project3;
    import java.util.*;
    * @author Kevin
    public class TextBook extends TechnicalBook{
        private ArrayList <String> schools;
        private ArrayList <Integer> numberCopiesForSchool;
        private String [][] schoolsAndCopies;
        public static final String TEXTBOOK = "Textbook";
        /** Creates a new instance of TextBook */
        public TextBook(String author, String title, int numberPages, int copiesSold,
                double price) {
            super(author, title, numberPages, copiesSold, price);
            schools = new ArrayList();
            numberCopiesForSchool = new ArrayList();
        public int getNumberCopiesForSchool(String school){
            Integer temp = null;
            for(int i = 0; i < schools.size();i++){
                if(schools.get(i).equals(school))
                   temp = numberCopiesForSchool.get(i);
            return temp;
        public void addSchool(String school){
            Integer one = new Integer(1);
            schools.add(school);
            // number of copies for the school is initially 1
            numberCopiesForSchool.add(one);  
        public int getNumberSchools(){
            int count = 0;
            for(int i = 0; i < schools.size(); i++){
                if(schools.get(i) != null)
                    count++;
            return count;
        public void addCopiesForSchool(String school, int copies) {
              for (int i = 0; i < schools.size(); i++) {
                        if (schools.get(i).equals(school))
                   numberCopiesForSchool.set(i, numberCopiesForSchool.get(i)
                                + (Integer) copies);
        private void schoolsAndCopiesToArray(ArrayList <String> a, ArrayList <Integer> b){
            String [] c = null;
            String [] d = null;
            c = (String[]) a.toArray(new String[a.size()]);
            d = (String[]) b.toArray(new String[b.size()]);
            String [] [] schoolsAndCopies = null;
            for(int i = 0; i < c.length;i++){
                for(int j = 0; j < d.length;j++){
                    schoolsAndCopies[i] = c;
                    schoolsAndCopies[j] = d;
        public void printSchoolsAndCopies(String title){
            schoolsAndCopiesToArray(schools, numberCopiesForSchool);
            System.out.println("---------------");
            System.out.println("Schools and copies sold to each school for " + this.title+ ".");
            System.out.println("Schools:\tCopies:");
            for(int i = 0; i < schoolsAndCopies.length;i++)
                for(int j = 0; j < schoolsAndCopies.length;j++)
    System.out.println(schoolsAndCopies [i] + "\t" +
    schoolsAndCopies[j]);
    public String getClassName(){
    return TEXTBOOK;
    // overrides TechnicalBook toString
    public String toString(){
    return "Author = " + author + ". Title = " + title + ". Number of Pages = " +
    numberPages + ". Copies Sold = " + copiesSold + ". Schools using " + title +
    ". Price = " + this.getPrice() + " = " + this.getNumberSchools() + ". ";
    * ReferenceBook.java
    * Created on April 19, 2007, 8:02 PM
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    package project3;
    import java.util.*;
    * @author Kevin
    public class ReferenceBook extends TechnicalBook{
    private ArrayList <String> conferences;
    public static final String REFERENCE_BOOK = "Reference Book";
    //private int numberConferences;
    /** Creates a new instance of ReferenceBook */
    public ReferenceBook(String author, String title, int numberPages, int copiesSold,
    double price) {
    super(author, title, numberPages, copiesSold, price);
    conferences = new ArrayList();
    public String getConference(int a){
    for(int i = 0; i < conferences.size();i++)
    if(i == a)
    return conferences.get(i);
    return null;
    public void addConference(String conference){
    for(int i = 0; i < conferences.size();i++){
    conferences.add(conference);
    break;
    public void printConferences(){
    System.out.println("-------------");
    System.out.println("Conferences made for " + this.title + ".");
    for(int i = 0; i < conferences.size(); i++){
    System.out.println("["+(i + 1) +"]: "+ conferences.get(i));
    System.out.println(conferences.size());
    public String getClassName(){
    return REFERENCE_BOOK;
    public String toString(){
    return super.toString();
    * BookTester.java
    * Created on April 19, 2007, 8:02 PM
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    package project3;
    * @author Kevin
    public class BookTester{
    /** Creates a new instance of BookTester */
    public static void main(String [] args){
    BookCatalog catalog = new BookCatalog("Library");
    TextBook java = new TextBook("John", "Java", 5, 20, 5.00);
    TextBook beans = new TextBook("Mike", "JavaBeans", 6, 21, 5.00);
    ReferenceBook ref = new ReferenceBook("Jones", "Standard Class Library", 6, 23, 5.00);
    ref.addConference("Meeting");
    ref.printConferences();
    beans.addSchool("UTSA");
    beans.printSchoolsAndCopies("c++");
    catalog.addBook(java);
    catalog.addBook(beans);
    catalog.printCatalog();
    my BookCatalog class is fine, and everything prints out with out using the listed methods that give trouble.
    * BookCatalog.java
    * Created on April 20, 2007, 4:42 PM
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    package project3;
    import java.util.*;
    * @author Kevin
    public class BookCatalog {
        private String name;
        private ArrayList <Book> bookList;
        /** Creates a new instance of BookCatalog */
        public BookCatalog(String name) {
            this.name = name;
            bookList = new ArrayList <Book>();
        public String getCatalogName(){
            return name;
        public void addBook(Book b){
            bookList.add(b);
        public void printCatalog(){
            for(int i = 0; i < bookList.size(); i ++){
                System.out.println("[" + i + "]: " + bookList.get(i).getClassName() +
                       ": " + bookList.get(i).toString());
    }thanks in advance

    everything runs now, but it doesnt sort them. it prints them in the original order: here is the revised BookCatalog and Tester, also when making sortByTitle static it gives non static variable errors so i have no idea. Thanks for helping me fix the errors, i have no idea why it doesnt sort.
    * BookCatalog.java
    * Created on April 20, 2007, 4:42 PM
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    package project3;
    import java.util.*;
    * @author Kevin
    public class BookCatalog {
        private String name;
        private ArrayList <Book> bookList;
        //private Book [] bookList2;
        /** Creates a new instance of BookCatalog */
        public BookCatalog(String name) {
            this.name = name;
            bookList = new ArrayList <Book>();
        public String getCatalogName(){
            return name;
        public void addBook(Book b){
            bookList.add(b);
            public void sortByTitle(ArrayList<Book> list){
          if (bookList.size() > 1)
            for (int index = 1; index < bookList.size(); index++)
               insertItemByTitle(bookList, index);
         private void insertItemByTitle(ArrayList <Book> bookList, int index) {
                Book key = bookList.get(index);
                int position = index;
                while (position > 0 && key.getTitle().compareTo(bookList.get(index).getTitle()) < 0)   {
                    bookList.set(position, bookList.get(position-1));// = bookList.set(position-1, key);
                   position--;
                bookList.set(position, key);
        public void printCatalog(){
            sortByTitle(bookList);
            Book [] bookList2 = (Book[])bookList.toArray(new Book[bookList.size()]);
            for(int i = 0; i < bookList2.length; i ++){
                System.out.println("[" + (i+1) + "]: " + bookList2.getClassName() +
    ": " + bookList2[i].toString());
    * BookTester.java
    * Created on April 19, 2007, 8:02 PM
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    package project3;
    * @author Kevin
    public class BookTester{
    /** Creates a new instance of BookTester */
    public static void main(String [] args){
    BookCatalog catalog = new BookCatalog("Library");
    TextBook java = new TextBook("John", "Java", 5, 20, 5.00);
    TextBook beans = new TextBook("Mike", "JavaBeans", 6, 21, 5.00);
    ReferenceBook ref = new ReferenceBook("Jones", "Standard Class Library", 6, 23, 5.00);
    ref.addConference("Meeting");
    ref.printConferences();
    beans.addSchool("UTSA");
    //beans.printSchoolsAndCopies("c++");
    catalog.addBook(ref);
    catalog.addBook(java);
    catalog.addBook(beans);
    catalog.printCatalog();

  • Problems Creating a Java Class using a webservice with certificate

    hi,
    i'm developing a java class that call's a webservice that needs a certificate, i'm not used to work with java, last time was 10 years ago, so i'm having some troubles because of the certificate.
    I already add the certificate using java control panel > Security > Certificates. When testing i get the following error: IOException (java.io.IOException: subject key, Unknown key spec)
    I think I need to define the certificate in my class, but i'm having a lots of trouble with the samples that i found over the internet, nothing works and i'm running out of time.
    This is my Class
    create or replace and compile java source named "FishInfoAt" as
    import java.net.*;
    import java.io.*;
    import java.security.*;
    public class FishInfoAt
         public FishInfoAt()
         public static String send(String urlfishinfoat, String mensagem, String mensagem1, String mensagem2, String mensagem3)
              // Init
              String response = "";
              String msgtotal = mensagem+mensagem1+mensagem2+mensagem3;
              String a = "";
              HttpURLConnection conn = null;
              try{
                   URL url = new URL(urlfishinfoat);
                   conn = (HttpURLConnection) url.openConnection();
                   conn.setRequestMethod("POST");
                   conn.setRequestProperty("Content-type", "text/xml; charset=utf-8");
                   conn.setRequestProperty("SOAPAction", "https://servicos.portaldasfinancas.gov.pt:401/sgdtws/documentosTransporte/");
                   conn.setRequestProperty("Content-Length","" + msgtotal.length());
                   conn.setDoOutput(true);
                   conn.setDoInput(true);
                   conn.connect();
                   OutputStream out = conn.getOutputStream();
                   out.write(msgtotal.getBytes());
                   out.flush();
                   InputStream in = conn.getInputStream();
                   int value;
                   while( (value = in.read()) != -1)
                        response+=(char)value;
              catch(Exception e)
    response = ("*** ERROR - IOException (" + e.getMessage() + a + ")");
    return response;
    /

    Hi Deepak,
    Could you please let us know upto which line your code is going safe. Try printing the value in the structure before you send that to the method GetUGEntity().
    I am not too sure that would be a problem. But I have faced a problem like this, wherein I tried to access a structure for which I have not allocated memory and hence got exception because of that.
    Since your JNI code seems to be error free, I got doubt on your C part. Sorry.
    Dhamo.

  • Problem in finding java class file

    I am writting an application using servlets , JSP and a simple java classfile. The simple java class file is for connection pool and the name of connection pool class is DBConnectionManager . I am using JavaWebserver2.0 and I have placed this class file in .\JavaWebserver2.0\classes
    I am placing my servlets in .\JavaWebserver2.0\servlets folder. Since I am using wfm package so my servlets are placed in .\JavaWebserver2.0\servlets\wfm .
    The problem is with compiling the servlet placed in wfm folder . I get the following error:-
    TestServlet.java:11:cannot resolve symbol
    symbol: class DBConnectionManager
    location: class wfm.TestServlet
    However when I try to compile this class in servlets folder and remove the package statement from the source file, it compiles and works very fine. I am having lot of confusion as the class DBConnectionManager is in classpath but even then compiler gives error. The same class when placed in servlets folder and package statement is removed works very fine.
    Kindly help.

    Hi,
    Is the DBConnectionManager class declared public?
    Does the TestServlet import the package that contains the DBConnectionManager?
    This is all I can come up with, with the current information.
    Cheers,
    --Arnout                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to link two .java files together?

    hello everybody,
    is it possible to link two or more .java files together? I mean is if I have 3 .java files. (a.java, b.java, c.java) then I have 3 .class files too. How do I use the method in other .java files. For example :
    public a extends Applet {
    // call b.class
    b();
    public b extends Applet implements ActionListener {
    void title1() {
    How to call the b.class? How to call the title1() method?
    Is it related to JAR or package??
    Thanks for helping me. v(^_^)v

    O.K, you do not link ".java" files together.
    You compile them into class files and they can create new instances of each other and and access their variables and work together.
    I recommend "Sam's Teach Yourself Java in 21 Days".
    It will start you out with the basics.
    --Ian                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    

  • JSF 2.0: Interaction between several Java classes (get value)

    Hi Everybody!
    Unfortunately, I find both in the web and in books not really advice. And slowly I have the feeling that something is either really lazy or I'm just incapable! :-)
    Following scenario:
    Suppose I have a JSF page (.xhtml-file) that has several input fields (<h:inputText... />). For example, a field for the lastname (with the corresponding Java class: Customer.java) and a field for the ordered product (with the corresponding Java class: Shoppingcart.java). In addition, the page has a Save button to store the entered data into the database (with the corresponding Java class: Jdbc.java).
    Code of JSF page:
    <table>
      <tr>
        <td><h:inputText id="lastname" value="#{customer.lastname}" /></td>
      </tr>
      <tr>
        <td><h:inputText id="product" value="#{shoppingcart.product}" /></td>
      </tr>
      <tr>
        <td><h:commandButton action="#{jdbc.insertDataIntoDB}" value="Save" /></td>
      </tr>
    </table>Code of Customer.java class:
    @ManagedBean (name = "customer")
    @SessionScoped
    public class Customer
       private String lastname;
       public String getLastname()
          return lastname;
       public void setLastname(String lastname)
         this.lastname = lastname;
    }Code of Shoppingcart.java class:
    @ManagedBean (name = "shoppingcart")
    @SessionScoped
    public class Shoppingcart
       private String product;
       public String getProduct()
          return product;
       public void setProduct(String product)
         this.product = product;
    }Code of Jdbc.java class:
    @ManagedBean (name = "jdbc")
    @SessionScoped
    public class Jdbc
       public String insertDataIntoDB()
          Connection conn = null;
          Statement  stmt = null;
          try
             Class.forName("com.mysql.jdbc.Driver");
             conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/db_xyz", "username", "pw");
             stmt = conn.createStatement();
             stmt.executeUpdate("INSERT INTO db_xyz.tbl_orders (Lastname, Product) VALUES (" + lastname + "," + product + ");");
    }Please ignore the last line (stmt.executeUpdate) of my code in the jdbc class. This does not work.
    And right here is just my problem!
    How do I get in my Jdbc class the current values of the entered lastname and product?
    I'll be very grateful if you could help me in this regard.
    Many greetings and thanks in advance.
    Edited by: Fools on Sep 13, 2010 5:48 AM

    One approach is to have a backing bean for each JSF. Say you have shoppingPage.jsf, you could also have a managed bean called ShoppingPage. If this bean holds references to the other beans then it is easy to reference everything via the first bean.
    class ShoppingPage {
         private DataBase db;
         private ShoppingCart sc;
         //getters and setters, etc
    }The JSF can refer to the ShoppingCart via the ShoppingCart i.e. #{ shoppingPage.sc.doSomeThing() }
    If both db and sc are involved then #{ shoppingPage.save() } where the save function is in the ShoppingCart object and can see both of the other objects.
    Otherwise it get a bit complicated because there may be several users on your website so you need to identify the objects relating to a particular user. Take a look at http://balusc.blogspot.com/2006/06/communication-in-jsf.html

  • Problem Calling a Java class from PLSQL function

    We are calling a Java class through oracle function as
    FUNCTION CalculateAMW (contributorid IN Number,
    fromdate IN Date,OHorAnncoverage in Number,
    OHAnncoverage in Number,
    AppStatus in Number,
    Status in Number)
    RETURN Number
    AS LANGUAGE JAVA
    NAME 'AMWCalculations.calculateAMW
    (long,java.sql.Timestamp,long,long,long,long) return double';
    on execution of this function the sql prompt for the 1st time it is giving the output
    but
    if reexecute it is throwing and error ORA - 932 : Inconsistent
    datatypes.
    Recompiling the java class then it works for the 1st time and the next
    time
    we execute it throws error as explained above.
    What could be the problem.
    Thanks
    Nanda Kishore

    any idea???Yes, you are in the wrong forum, this is a Java forum, you have an ASP question, so i suggest you visit an ASP forum/site

  • Problem When Import Java Class -compilation error

    Hi all
    I made a java class that has methods to return Screen width and Height .
    package tarek;
    import java.awt.Dimension;
    import java.awt.Toolkit;
    public class Screen
    Dimension dim ;
    public Screen()
    dim = Toolkit.getDefaultToolkit().getScreenSize();
    public double getWidth()
    double w = dim.getWidth();
    return w;
    public double getHeight()
    double h=dim.getHeight();
    return h;
    I made the jar file " screen.jar" and make it ready to use in form builder
    I opened form builder and make import java class (From program>import java class>choose the class anc click import)
    The class now imported successfully and the PL/SQL package body is:
    PACKAGE Screen /* tarek.Screen */ IS
    -- DO NOT EDIT THIS FILE - it is machine generated!
    -- Constructor for signature ()V
    FUNCTION new RETURN ORA_JAVA.JOBJECT;
    -- Method: getHeight ()D
    FUNCTION getHeight(
    obj ORA_JAVA.JOBJECT) RETURN NUMBER;
    -- Method: getWidth ()D
    FUNCTION getWidth(
    obj ORA_JAVA.JOBJECT) RETURN NUMBER;
    END;
    Now I made a button on the form and i WRITE THIS CODE TO INVOKE THE CLASS on when_button_pressed
    DECLARE
         vScreen_Class ORA_JAVA.JOBJECT;     
    BEGIN
         vScreen_Class := SCREEN.NEW;
    END;
    My problem is I have compilation error
    error 306 AT LINE 5 , COLUMN 25
    wrong number or types of argument in call to "NEW"
    I do not know what is the reason of this compilation error?
    Is it because the method in java return "double datatype" while in oracle return "number datatype"
    Please help
    Edited by: [email protected] on Dec 28, 2009 10:24 AM

    Sarah, I ca not move my thread to JDeveloper because it is not java issue. The problem is with my PL/SQL code and the way I make Import Java class to forms Builder. The Java code is OK.
    Andreas Thank you so much for replying. In fact I made a full compile "Ctrl+Alt+K". but still error
    The following is the package Body
    PACKAGE BODY Screen IS
    -- DO NOT EDIT THIS FILE - it is machine generated!
    args JNI.ARGLIST;
    -- Constructor for signature ()V
    FUNCTION new RETURN ORA_JAVA.JOBJECT IS
    BEGIN
    args := NULL;
    RETURN (JNI.NEW_OBJECT('tarek/Screen', '()V', args));
    END;
    -- Method: getHeight ()D
    FUNCTION getHeight(
    obj ORA_JAVA.JOBJECT) RETURN NUMBER IS
    BEGIN
    args := NULL;
    RETURN JNI.CALL_DOUBLE_METHOD(FALSE, obj, 'tarek/Screen', 'getHeight', '()D', args);
    END;
    -- Method: getWidth ()D
    FUNCTION getWidth(
    obj ORA_JAVA.JOBJECT) RETURN NUMBER IS
    BEGIN
    args := NULL;
    RETURN JNI.CALL_DOUBLE_METHOD(FALSE, obj, 'tarek/Screen', 'getWidth', '()D', args);
    END;
    BEGIN
    NULL;
    END;
    ---------------------------------------------------------------------------------

  • Problem during call java class (model layer) from jsp page (view layer)

    I created new Fusion web application so I have now to parts in the application navigator (model, viewcontroller)
    I want to write java class in the Model part as following:
    package persistence;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    public class DBManager {
    Connection connection = null;
    public DBManager() {
    super();
    public void init() {
    try {
    // Load the JDBC driver
    String driverName = "oracle.jdbc.driver.OracleDriver";
    Class.forName(driverName);
    // Create a connection to the database
    String serverName = Constant.DB_SERVER_NAME;
    String portNumber = Constant.DB_PORT_NUMBER;
    String sid = Constant.DB_SID;
    String url =
    "jdbc:oracle:thin:@" + serverName + ":" + portNumber + ":" +
    sid;
    String username = Constant.DB_USER_NAME;
    String password = Constant.DB_PASSWORD;
    connection = DriverManager.getConnection(url, username, password);
    System.out.println("*");
    System.out.println(connection.getCatalog());
    } catch (ClassNotFoundException e) {
    System.out.println("Could not find the database driver");
    } catch (SQLException e) {
    System.out.println("Could not connect to the database");
    e.printStackTrace();
    and wrote JSP page in the view controller part as following :
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <%@page import="persistance.*"%>
    <% persistance.DBManager manager = new DBManager(); %>
    <%@ page contentType="text/html;charset=windows-1252"%>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/>
    <title>Browse</title>
    </head>
    <body>
    <table>
    </table>
    </body>
    </html>
    but this I have the following error in the jsp page :type persistance.DBManager not found
    my job is to build simple ADF application using JSF and java without any ADF faces or JPA or any another technology
    thanks

    Duplicate message.
    type persistance.DBManager not found
    Add a Dependency on the Model project in the View project. In Project Properties select the Dependencies node to add dependencies.
    Edited by: dvohra16 on Jun 19, 2011 8:37 AM

  • "Java Class not found in classpath" Error in DESIGNER

    Hello All,
    I'm trying to connect in Designer using a JDBC connection to MS SQL Server 2008.  As per the instructions, I updated my jdbc.sbo file with the path to the existing two JAR files.  However, I still get the following error when I try and connect in Designer:  "Java Class not found in classpath : C:\Program Files\Business Objects\BusinessObjects Enterprise 12.0\win32_x86\dataAccess\connectionServer\jdbc\Drivers\sqlsrv".  Of course, this error includes the drive path with the location to my JAR files.  Any help in resolving this nagging issue is very GREATLY appreciated.  Also, if anyone needs it I can post a copy of the jdbc.sbo file to this thread.
    Thank you,
    Pankaj

    Stratos,
    Your suggestion didn't help.  I tried to connect after restarting my machine and I still get the error.  And, I've also tried adding a connection to MS SQL Server 2005 using this JDBC driver, and that didn't help either.  Any other suggestions?  Would it help to see my "jdbc.sbo" file?  Thanks again for your and everyone else's help, and I look forward to your reply.
    Regards,
    Pankaj

Maybe you are looking for

  • SChannel Fails Authentication on Windows Server 2008 R2 Using TLS1

    I am trying to use SChannel to secure a socket connection. I modified the example at https://msdn.microsoft.com/en-us/library/windows/desktop/aa380537(v=vs.85).aspx, converting it from Negotiate to SChannel.  Following the specs for the SSPI APIs I w

  • Data model binding with a "for in" loop

    I've got a data model representing form items. An example data model element and form item looks like this: <data_model> <item_1>{item1.text}</item_1> </data_model> <mx:DateField id="item1" text="{data_model.item1}"/> I get data back from a database

  • Problem in login Enterprise manager

    Hi, I installed oracle 11 g sucessfully on my virtual box Redhat Linux 6.0. when i am starting my Enterprise manager i am getting the below error: emctl start dbconsole OC4J Configration issue. /home/oracle1/app/oracle1/product/11.2.0/db_home2/oc4j/j

  • Centering images on fluid site

    Rebuilding a very antiquated site to meet the upcoming Google deadline, I'm having problems centering images. I defined a class of "center" but it's not working; http://www.aptcoweb.com/dev/aptcoFluid/office/label.htm Sometimes I want to center a sin

  • Can't open elements 8

    I bought a new MacBook Pro in September and used TimeMachine to transfer everything over. I just went to use Photoshop Elements 8 for the first time and it gave me a licensing agreement error, 150:30. So I searched that on here and the fixer you had