Class.forName throws ClassNotFoundException

I encountered a similar problem as the display thread: http://supportforums.blackberry.com/t5/Java-Development/CodeModuleManager-and-Class-forName/m-p/6338...

However, the solution for the first display does not solve my problem, or maybe I'm not clearly understand. I decided to open a new thread and want to help with.

My workspace contains three projects: main project which is BB application, module 1 is a library and acts as an interface between the main project and module 2. module 2 is a library as well and depends on module 1. I want to create an instance of module 2, if a third-party driver is installed on the device; otherwise, just use module 1.

After you install applications on the real BB and with thirdpartydriver installed, if I call Class.forname ("class of module 1"), it works for me, however, if I call Class.forname ("module class 2"), it still throws ClassNotFoundException.

The application works very well on Simulator

The three projects are properly built and signed.

Thanks in advance for any help coming.

Solution found:

Adding a control RIM API dummy in all libraries depended to force RRT code signing enabled for all libraries solved my problem.

Thanks for all the answers.

Tags: BlackBerry Developers

Similar Questions

  • CodeModuleManager and Class.forName

    I have a specific question.

    My application download both modules and install them.  Both modules are libraries.

    Module 1: Library without any dependencies.

    Module 2: Library that depends on another Module 1 and Module already installed.

    I have install the module 1 and then install the module 2.

    At this point if I call Class.forName ("class of module 1"), everything works.

    If I call Class.forName ("module class 2"), he throws ClassNotFoundException.

    Any ideas?

    The modules are correct return codes when installed CMM and make their appearance in the list of modules.  They are both duly signed.

    Note, installation from CMM requires a restart and the same problem occurs after restarting the device.

    It seems so be that module 1 using code RTT required.  After fixing that Module 2 is loaded...

  • Error Trying to use java.lang.Class.forName ("oracle.jdbc.OracleDriver") ';

    I use SDDM 4.0.1.836.  I get the error message "wrapped java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver (Query Test n ° 3).

    importPackage(java.sql);
    java.lang.Class.forName ("oracle.jdbc.OracleDriver");
    conn = java.sql.DriverManager.getConnection ("jdbc:oracle:thin:@localhost:1521:DESN", "READONLY_USER", "READONLY");
    stmt = conn.createStatement();
    rset = stmt.executeQuery("SELECT * FROM DUAL");
    rset.close();
    stmt.close();
    conn.close();
    
    

    There is an archived topic,unable to connect to oracle (not found driver) transformation script , but this issue has not been resolved.

    It seems that the thread has been forgotten.

    You need to add following the datanodeler64.conf and/or datamodeler.conf

    AddJavaLibFile... /... /JDBC/lib/ojdbc6.jar

    Philippe

  • I need help with the use of Class.forName and getResourceAsStream

    I am trying to write code that will play an audio file. All references I found the point of code as follows...

                              Class dir = Class.forName("lib.testother");
                                InputStream input = dir.getResourceAsStream("/explosion.aac");
                                Player player =
                                    javax.microedition.media.Manager.createPlayer(input, "audio/aac");
                                player.realize();
                                VolumeControl vol = getVolumeControl(player);
                                if (vol != null)
                                {
                                    int volume = vol.getLevel();
                                    vol.setLevel(volume);
                                }
                                player.prefetch();
                                player.start();
    

    I use Blackberry JDE. Now, I'm supposed to put the audio file of the project?

    Second, how then use the class.forName function? I put the audio file as a member of the project and then tried the above code and I get that it can not find lib.testother (which is the path of the code).

    If I use getClass() instead of dir above, getResourceAsStream returns null.

    Are there examples of the use of these or how to include the audio in your project... from end-to-end. The code snippet above is all I could find and it isn't enough.

    THX

    D

    Check this thread:

    http://supportforums.BlackBerry.com/Rim/Board/message?board.ID=java_dev&message.ID=11616&query.ID=18...

  • CodeModuleManager.createNewModule and Class.forName

    I install a module on interest. I use funtion of CodeModuleManager.createNewModule and CodeModuleManager.saveNewModule. It s completed successfully.

    Then I try to get a class that sits inside the new module. but I can't class. If I have resetblackberry, then I can get this class. but, just after the creation and registration of module, I can not class. I have to reset the device.

    is it possible that get new class without resetting the unit?

    Note: I call CodeModuleManager.isResetRequired (funstion), and for me it s not no need to reset.

    and I am using BB 9700

    Welcome to the club.

    The only 'solution' that I know is to make the module a startup auto/library/application.  What will happen, is that the app will be linked correctly before you start and Class.forName will start work.   After you have installed via CMM, Autostart library starts automatically (calling the libMain method) and will be linked/fixed.  Only I must give ~ 1 second after the installation to do his thing.

    Once you get that 'fixed', you might in other "features" that revolve around download cod and their installation by programming.    Some have difficulties, some don't.

    Go to the question of Class.forName, he just might start to work for you, if the library is fairly simple.

  • Class.forName in jdbc

    Hello

    I know that this has been discussed a few times before but I'm still not clear on this.

    Why do we Class.forName while the implementation of jdbc.

    In which case it is for the class loading, why have we not need for another class. How reactivates JVM knows how to find the class and load it when we pray for the other classes.

    (I understand that calling Class.forName calls the static method in this document, which records the pilot as a driver available in the DriverManager class, but my question is why do we need to load jdbc class and not for others).

    Any response will be a great help.

    -Andy

    TheAvalanche wrote:
    Using Class.forName (or the service-loader) allows the use of drivers that did not exist when the program was written

    If they existed or not, the point key here (and I completely missed during the validation of my answer) is that you can see what driver use prior to execution, which means that your application can be run against DBs from different vendors without any code changes.

  • Exception in thread "main" java.lang.RuntimeException: java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver


    Dear Sir


    I have this problem to connect the JAVA oracle database. I use Eclipse March, here is my code:

    package db;

    import java.sql.Connection;

    to import java.sql.DriverManager;

    import java.sql.SQLException;

    public class {ConnectionFactory

    public static {connection getConnection()

    try {}

    Class.forName ("oracle.jdbc.OracleDriver");

    return DriverManager.getConnection ("jdbc:oracle:thin:@myhost:1521:orcl", "scott", "Tiger");

    } catch (ClassNotFoundException |) SQLException e) {}

    throw new RuntimeException (e);

    }

    }

    Public Shared Sub main (String [] args) {}

    Connection connection = ConnectionFactory.getConnection ();

    System.out.println ("Conexao criada com sucesso.");

    try {}

    Connection.Close;

    } catch (SQLException e) {}

    e.printStackTrace ();

    }

    }

    }

    Belown the error:

    Exception in thread "main" java.lang.RuntimeException: java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver

    DB. ConnectionFactory.getConnection (ConnectionFactory.java:14)

    DB. ConnectionFactory.main (ConnectionFactory.java:19)

    Caused by: java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver

    at java.net.URLClassLoader.findClass (unknown Source)

    at java.lang.ClassLoader.loadClass (unknown Source)

    to Sun.misc.Launcher$appclassloader$ AppClassLoader.loadClass (unknown Source)

    at java.lang.ClassLoader.loadClass (unknown Source)

    at java.lang.Class.forName0 (Native Method)

    at java.lang.Class.forName (unknown Source)

    DB. ConnectionFactory.getConnection (ConnectionFactory.java:11)

    ... 1 more

    Someone help me, please?

    Thank you

    Jurandyr F. Alves

    A ClassNotFound exception means just what it says: it can't find this class.

    Make sure that the ojdbc7.jar file is in your classpath.

  • Error on Java class calling in the Oracle database

    I have a java class indicated below:

    /*

    * To change this license header, choose license headers in the project properties.

    * To change this template file, choose Tools | Templates

    * and open the template in the editor.

    */

    package oracletree1;

    import java.sql.Connection;

    to import java.sql.DriverManager;

    import java.sql.ResultSet;

    import java.sql.SQLException;

    import java.sql.Statement;

    /**

    *

    * @author oracle

    */

    public class TREEUPDATER {}

    int levels;

    int NodeId;

    int ParentId;

    String FatherID;

    int ChildBed_new;

    int ChildBes_new;

    int ChildMande_new;

    int ChildBed_old;

    int ChildBes_old;

    int ChildMande_old;

    int ParentBed;

    int ParentBes;

    int ParentMande;

    Script string;

    String ValueState;

    String TreeState;

    Public TREEUPDATER() throws SQLException {}

    }

    public void update (levels int, int NodeIds, int childBed_old, int childBes_old, int childMande_old) throws SQLException {}

    This. ChildBed_old = childBed_old;

    This. ChildBes_old = childBes_old;

    This. ChildMande_old = childMande_old;

    This. Levels = levels;

    This. NodeId = NodeIds;

    String [] array;

    try {}

    Class.forName ("oracle.jdbc.driver.OracleDriver");

    } catch (ClassNotFoundException e) {}

    System.out.println ("where is your Oracle JDBC Driver?');

    return;

    }

    System.out.println ("Oracle JDBC Driver registered!");

    Fitting out = null;

    try {}

    connection = DriverManager.getConnection)

    "jdbc:oracle:thin:@192.168.1.12:1521:orcl", "tree1"

    'oracle');

    } catch (SQLException e) {}

    System.out.println ("connection failed! Check the console output");

    return;

    }

    If (connection! = null) {}

    Statement stmt = connection.createStatement ();

    Instruction stmt2 = connection.createStatement ();

    stmt.executeUpdate ("insert into test.java_test (id) values (21)" ");

    ResultSet rs = stmt.executeQuery ("SELECT * from value" + "where nodeid =" + NodeId);

    ResultSet rs2 = stmt.executeQuery ("select * from tree where id =" + NodeId);

    While (RS. Next {}

    This. FatherID = rs2.getNString("FatherID");

    This. ChildBed_new = rs2.getInt ("bed");

    This. ChildBes_new = rs2.getInt ("bes");

    This. ChildMande_new = rs2.getInt ("control");

    table = new String [100000];

    Table = FatherID.split ("_");

    for (int i = 0; i < array.length; i ++) {}

    ResultSet rs3 = stmt2.executeQuery ("SELECT * from tree" + "where id =" + array [i]);

    This. ParentId = rs3.getInt ("id");

    This. ParentBed = rs3.getInt ("bed");

    This. ParentBes = rs3.getInt ("bes");

    This. ParentMande = rs3.getInt ("control");

    connection.setAutoCommit (false);

    ParentBed = ChildBed_new - ChildBed_old;

    ParentBes = ChildBes_new - ChildBes_old;

    This. TreeState = rs2.getNString ("state");

    If (TreeState.equalsIgnoreCase ("BED")) {}

    This. ParentMande = ParentBed - ParentBes;

    } else {}

    This. ParentMande = ParentBes - ParentBed;

    }

    This. Script = ("update the bed = bed set value +" + ParentBed + "and bes = bes +" + ParentBes + "and control = control +"+ ParentMande ")

    + ' where id = "+ ParentId);»

    stmt2. ExecuteUpdate ("" + Script);

    }

    }

    }

    }

    }

    I have a main class, which show below:

    /*

    * To change this license header, choose license headers in the project properties.

    * To change this template file, choose Tools | Templates

    * and open the template in the editor.

    */

    package oracletree1;

    import java.sql.SQLException;

    /**

    *

    * @author oracle

    */

    public class OracleTree1 {}

    /**

    @param args command-line arguments

    */

    Public Shared Sub main (String [] args) throws SQLException {}

    TODO logical application of the code here

    TREEUPDATER t = new TREEUPDATER();

    }

    }

    I was responsible for these classes in oracle database 11 g 2 and I want to use a trigger to execute the updating() method. If I created a procedure like this:

    CREATE OR REPLACE PROCEDURE REPORT4

    (

    LEVELS IN NUMBERS

    NODEID NUMBER

    CHILDBED_OLD NUMBER

    CHILDBES_OLD NUMBER

    CHILDMANDE_OLD NUMBER

    ) AS

    Name of the java LANGUAGE "TREEUPDATER.updating (1,2,3,4,5);

    But when I want to compile and run this procedure, I get this error:

    Error: PL/SQL: analysis of completed Compilation unit

    Error (9,16): PLS-00311: the declaration of 'TREEUPDATER.updating' (1,2,3,4,5) is incomplete or incorrect

    Can any one solve this?

    Thank you

    The correct syntax for PORCEDURE4 is:

    No it's not. I already gave the correct syntax, which apparently ignored you.

    I don't know how can pass these parameters to this method.

    My question is clear?

    It is clear that you are interested in reading the documentation. All the answers are there.

    You're mixing two things:

    (1) creating the procedure (once), and I already told you how to do it

    (2) the procedure call

    For 1)-do you only once :

    CREATE OR REPLACE PROCEDURE REPORT4)

    LEVELS IN NUMBERS

    NODEID NUMBER

    CHILDBED_OLD NUMBER

    CHILDBES_OLD NUMBER

    CHILDMANDE_OLD NUMBER

    )

    AS

    JAVA LANGUAGE

    NAME of ' oracletree1. TREEUPDATER.updating (int, int, int, int, int)';

    For 2)-procedure call:

    ...

    BEGIN

    ... of the code

    -you call proc with your real settings:

    procedure4 (v_levels, v_nodeid, v_childbed_old, v_childbes_old, v_childmande_old);

    ... rest of your code

    END;

    Pay attention to remarks from other institutions.

  • Cannot run a class

    have downloaded the sqljdbc4.jar to the MS site and has placed my directory. Here, I also have my java file as shown below.

    I exported the variable CLASSPATH export CLASSPATH =. : / usr/java/lib

    I have compiled the java file as

    javac - classpath. testmssql < < he created a class file and not errorrs.

    But if I run it now I get error

    bash - $3.2 java testmssql

    Exception in thread "main" java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver

    in java.net.URLClassLoader$ 1.run(URLClassLoader.java:200)

    3.2 - bash$ testmssql.java more

    import java.sql. *;

    class testmssql

    {

    Public Shared Sub main (string args []) throws Exception

    {

    Class.forName ("com.microsoft.sqlserver.jdbc.SQLServerDriver");

    Connection con = DriverManager.getConnection ("jdbc:sqlserver://localhost:1433; (databaseName = TPDB","sa","xxxxxxx");

    Statement st = con.createStatement ();

    ResultSet rs = st.executeQuery ("Select count (*) from tsr_account_status"); replace the name of your table

    While (RS. Next())

    {

    String s1 = rs.getString (1);

    String s2 = rs.getString (2);

    System.out.println("userid:"+S1+"password:"+S2);

    }

    con. Close;

    }

    }

    I have tried all means of operation but no luck. :

    as you can see the driver jar file is in the right place.


    as you can see the driver jar file is in the right place.


    as you can see the driver jar file is in the right place.

    (oemdb) / home1/oracle > pwd

    Oracle/home1 /.

    (oemdb) / home1/oracle > ls - ltr *.jar

    -rw - r - r - 1 oracle dba 563117 Aug 19 15:57 sqljdbc.jar

    -rw - r - r - 1 oracle dba 584207 Aug 19 15:57 sqljdbc4.jar

    (oemdb) / home1/oracle > java - classpath/home1/oracle testmssql

    Exception in thread "main" java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver

    in java.net.URLClassLoader$ 1.run(URLClassLoader.java:200)

    at java.security.AccessController.doPrivileged (Native Method)

    (oemdb) / home1/oracle > java - classpath /home1/oracle/sqljdbc4.jar testmssql

    Exception in thread "main" java.lang.NoClassDefFoundError: testmssql


    (oemdb) / home1/oracle > java - classpath /home1/oracle/sqljdbc4.jar:. testmssql

    Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version in .class file number

    at java.lang.ClassLoader.defineClass1 (Native Method)

    at java.lang.ClassLoader.defineClass(ClassLoader.java:621)

    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)














    SamiA. wrote:

    MS site I had supported versions and it is said that JRE 1.5 is supported and iam using 1.5.

    so why iam not use the java version of right?

    Java and JDBC specification support

    Version of the JDBC driver JRE Versions Version of the JDBC API
    4.0 1.5, 1.61 3.0, 4.0
    3.0 1.5, 1.6 3.0, 4.0
    2.0 1.5, 1.6 3.0, 4.

    Well, this is not what says the site I found.

    http://TechNet.Microsoft.com/en-us/library/ms378422.aspx

    sqljdbc4.jar class library requires a Java Runtime Environment (JRE) version 6.0 or 7.0. Using sqljdbc4.jar on JRE 5.0 will throw an exception.

    You must use version 6 or 7.

  • How to operate system class loader in blackberry?

    How the system class loader in blackberry?

    I have a few questions

    * can I load a class with the name of spesific file. for example, I have a file "myclass.txt" at cod. and it's a class file. I can load it?

    ("can I load class as follows: Class.forName("/myclass.txt ");

    * I can load only of class which is the name ends. class. This is a must for file names ends with ".class"?

    * I use Class.forName to load classes. is there another way to load?

    * If a class has a function that is not in the device OS, I can not load. But in the BlackBerry OS does not run applications. However, the OS should throw exception when I try to load this class. is it not?

    The way that J2SE load classes/functions is "properly" so if you tried something like that or used ClassLoader it would be just 'see' setNonSpellCheckable if she was called.

    On BlackBerry, that it is responsible when loading of the entire class, so when loading SpellCheck the native (no developer access) ClassLoader reads everything and said ' wait, I have not this call here, even if it might not get called I don't want to take the risk. "

    Who is?

    A workaround would be something like making a separate file of COD with the device's specific function calls, and then to call, that way if it is not supported on this version of the API that it doesn't get coded into the device specific COD file.

  • Error at startup _ class "not found

    Hello. I have an application written in RIM API 4.7 and load on a device with API 4.6. I want to run the following code:

    VirtualKeyboard virtual = this.getVirtualKeyboard();
    virtual.setVisibility(VirtualKeyboard.HIDE_FORCE);
    

    However, when I run the application, it tells me that it cannot find the class. Is it possible that I can handle this exception? I tried this:

    try{
        Class virtualKeyboard = Class
        .forName("net.rim.device.api.ui.VirtualKeyboard");
        VirtualKeyboard virtual = this.getVirtualKeyboard();
        virtual.setVisibility(VirtualKeyboard.HIDE_FORCE);
    } catch (ClassNotFoundException e) {
    
    } catch (NullPointerException e){
    
    }
    

    This no longer works. Is there really no way safe code for older devices and new devices?

    Even with the preprocessor, if you want to run your code in 4.6, you must compile your code in the IDE with the help of 4.6 or lower.  The preprocessor allows you to use a code base, but does not contribute to the need to compile twice and compile it using an appropriate level.

  • JDE 4.6.0 ClassNotFoundException

    Hi all

    I'm developing a BB application using eclipse 3.4.1 and BB JDE 4.6.0

    I have two separate projects in the same workspace. I use the second project in the first project like this:

    String c = "Mypackage.home.Test"; first line

    Class cl = Class.forName (c); second line

    I run the project on the eclipse on the BB 9000 Simulator. I had a java.lang.ClassNotFoundException in line 2. It cannot read a class in the second project.

    I tried many things and searched a lot, but could not remedy. What can you say about the TI

    Thank you and best regards.

    I have been missing the tick one of the libraries in the order and export tab of the project properties.

    Now, it works fine.

  • Need to call the PL/SQL Package in the group dynamics of approval class that implements IDynamicApprovalGroup

    Hi all

    This is regarding the approval of invoice AP I need in my project where the user selects the users/people approval when creating the invoice based on logic. There may be any number of users who could be part of the approval group.

    Approval users information is stored in a table with a single Bill.

    When the user initiates invoice approval, approval of the Bill should go to all the people/users selected in the invoice.

    I created the dynamic of approval group which is the result of a java class. This java class implements IDynamicApprovalGroup. (what is the oracle Developer Guide).

    I called PL/SQL to java class package to get all the details of users of custom for the current invoice table.

    I used the DriverManager.getConnection method by hard coding (JDBC URL, Username, Pwd) connection details that works perfectly fine.

    But I don't want to hard-code the connection details because it will change in bodies SIT/UAT/PROD.

    Please ask you to guide me if there is no solution for the information of connection without hard coding it.

    Following code used to get the connection details

    try {}

    Class.forName ("oracle.jdbc.driver.OracleDriver");

    System.out.println ("= class loaded");

    }

    catch (ClassNotFoundException ex) {}

    System.out.println ("= class loading error");

    ex.printStackTrace ();

    }

    Fitting out = null;

    CallableStatement cstmt = null;

    Try

    {

    connection = DriverManager.getConnection ("jdbc:oracle:thin:@xxhostname:1521/SID", "FUSION", "*");

    Connection = GetConnection ();

    System.out.println ("= connection =" + connection);

    prepare the call

    cstmt = connection.prepareCall ("{call XX_AP_INV_DYN_APPROVAL_PKG. {GET_GROUP_PARTICIPANTS (?,?)} ») ;

    cstmt.setString (1, '12345');   ID on invoice

    Exit of the register

    cstmt.registerOutParameter (2, java.sql.Types.VARCHAR);

    Call the stored procedure

    cstmt. Execute();

    System.out.println ("= procedure being executed");

    approvalGroupMembers = cstmt.getString (2).split("#");

    System.out.println ("= output:" + cstmt.getString (2));

    }

    catch (Exception ex) {}

    ex.printStackTrace ();

    }

    Finally

    {

    Try

    {

    If (cstmt! = null)

    close the callable statement

    {

    cstmt. Close();

    cstmt = null;

    }

    System.out.println ("= stmt closed");

    }

    catch (SQLException ex)

    {

    System.out.println ("= stmt close err");

    ex.printStackTrace ();

    }

    Try

    {

    If (connection! = null)

    close the connection

    {

    Connection.Close;

    connection = null;

    }

    System.out.println ("= closed conn");

    }

    catch (SQLException ex)

    {

    System.out.println ("= Close conn err");

    ex.printStackTrace ();

    }

    }

    Thank you

    Dipak.

    HI Dembélé - you should be able to call the provider database from the java class. Documentation is here. However, you need to specify the name of the data provider that is the same in all environments. Do you know what it is? If it's not I'll take a look and get back to you.

    __

    Peter Maurer

    Relationship with the developers of Applications in fusion

    https://blogs.Oracle.com/fadevrel/

  • Java class to connect to Oracle Database Express Edition11g and URL

    Can I use Oracle SQL Developer to do or use it as the value of the URL for the host name?

    I'm just starting to learn Java and with it, learn how to use the Oracle Database Express Edition11g and with it the Oracle SQL Developer...

    At this point, I have the Express Edition is installed and the SQL Developer installed and were able to establish a connection and to run a query and get a result.

    I use Eclipse for JAVA.  I have a work of class that performs a query on a database/table in MySQL.

    So now I'm eager to make the same use as the database Oracle Database Express Edition11g engine.

    And this means that two different versions of JAVA that I need to get the right to be able to do.

    The first is the value of the url variable.

    I now like

    String url = "jdbc:oracle:thin:@localhost";

    then

    Class.forName ("oracle.jdbc.OracleDriver");

    and then

    Connection connection = DriverManager.getConnection (url);

    The thing I'm puzzled on is in the URL where I 'localhost' was supposed to be the term generic and not so much as the text, you should use.

    I see in Web sites like 3 connection to Oracle Database XE

    and decrease example 3-2 by specifying the URL of database using the XE Client Setup

    There I see

    JDBC:driver_type: [username/password] @[//]host_name[: port] [XE]]

    And just what is and what is not is explained here.  So what I ended up with was

    String url = "jdbc:oracle:thin:@localhost";

    So if it was just a text to rest for a name I wonder just such a value or name might really where.

    I noticed that view that an app called "Oracle JDeveloper" has been used to create the values.   I don't have such a thing, or at least I don't think I do.

    Do I need?

    I have Oracle SQL DEVELOPER, where I used the following to connect to the database of the XE.

    My choice for Oracle's SQL Developer Help

    Name of connection: Connection1

    User name: Rod

    Password: myOracle11

    Host name: localhost

    Port: 1521, which is the default value

    SID: xe

    Above so I have to host name set to localhost

    Can I use Oracle SQL Developer to do or use it as the value of the URL for the host name?

    1. I do nothing

    2. While wouldn't you say it

    3. no results from the earlier assignment.

    I asked "'can I use Oracle SQL Developer to do or use it as the value of the URL for the host name?" "

    I showed the choice that I used in SQL Developer to connect to the schema.  And I was wondering, now that I had done this case those are the values that I could use in the Java class that I wrote.  The web site in the first post of this thread showed connection but he was using JDeveloper and SQL Developer.

    So I was wondering if the connection that I made using SQL Developer would do the same trick, and if I could use the values I did there.

    I'm happy to announce that YES, The values used to connect using SQL Developer work exactly like JDeveloper.

    So, given that in SQL Developer for Hostname I chose the value "localhost" "Rod" Username and password "myOracle11".

    I did the following JAVA CLASS that worked:

    package VC_2_9;

    Java for COBOL - copyright 1999 Doke & Hardgrave programmer

    import java.sql. *;

    public class DataBaseDemoOracle

    {

    Public Shared Sub main (string args [])

    {

    String CUST_LAST_NAME;

    / * String url = "jdbc:mysql://localhost/visualcafe";                     */

    String url = "JDBC: thin: @localhost';"

    / * String sqlQuery = "SELECT Name, SSNo, address, telephone OF THE customer;    */

    String sqlQuery = "SELECT CUST_LAST_NAME FROM DEMO_CUSTOMERS";

    //                                               |||||||||||||||

    Try

    {

    Class.forName ("oracle.jdbc.OracleDriver");

    Connection connection = DriverManager.getConnection (url, "Rod","myOracle11" ");

    Statement statement = aConnection.createStatement ();

    ResultSet rs = aStatement.executeQuery (sqlQuery);

    Boolean more = rs.next ();

    (more)

    {

    CUST_LAST_NAME = rs.getString (1);

    /* */

    System.out.println ("name:" + CUST_LAST_NAME);

    more = rs.next ();

    }

    RS. Close();

    aStatement.close ();

    aConnection.close ();

    }

    catch (ClassNotFoundException e)

    {System.out.println ("Exception caught" + e) ;}}

    catch (SQLException e)

    {If (e! = null)}

    {System.out.println ("SQLException taking" + e);}

    e = e.getNextException ();

    } / / end of while loop

    } / / end of capture

    } / / main end

    } / / end DataBaseDemoOracle.java

  • Class not found: com.bea.wlevs.adapters.jms.api.OutboundMessageConverter in the converter of JMS Outbound

    OEP 12.1.3

    By following the instructions in 4 adapters (12 c Release 1 (12.1.3)) , I created a bean of personal message for my outbound JMS adapter converter (I had to add the JAR file OEP_HOME\oep\modules com.bea.wlevs.adapters.jms_12.1.3.0_0.jar in my project to make the code compile). However, when deploying, I came across a class not found exception:

    < 2014 15 sep 19:17:19 CEST > < error > < org.springframework.osgi.extender.internal.activator.ContextLoaderListener > < BEA-000000 > < Application context update failed (OsgiBundleXmlApplicationContext (bundle = CreditCardTheftDetection.AirportCreditCardTransactionProcessing, config = osgibundle: / META-INF/spring/*.xml))

    java.lang.NoClassDefFoundError: saibot.airport.security.prevention.jms.SuspectedCreditCardEventConverter finds do not bundle [CreditCardTheftDetection.AirportCreditCardTransactionProcessing (CreditCardTheftDetection.AirportCreditCardTransactionProcessing)]

    at org.springframework.osgi.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:112)

    at org.springframework.osgi.util.BundleDelegatingClassLoader.loadClass(BundleDelegatingClassLoader.java:156)

    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)

    at java.lang.Class.forName0 (Native Method)

    at java.lang.Class.forName(Class.java:270)

    Caused by: java.lang.NoClassDefFoundError: com/bea/wlevs/adapters/jms/api/OutboundMessageConverter

    at java.lang.ClassLoader.defineClass1 (Native Method)

    at java.lang.ClassLoader.defineClass(ClassLoader.java:800)

    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass(DefaultClassLoader.java:188)

    Caused by: java.lang.ClassNotFoundException: com.bea.wlevs.adapters.jms.api.OutboundMessageConverter

    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:506)

    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)

    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)

    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)

    I tried to add the jar (com.bea.wlevs.adapters.jms_12.1.3.0_0.jar) to my POT of deployment. Who hasn't made a difference.


    Does anyone know why this OutboundMessageConverter class not found--and especially: what I can do to make it available in the run-time?


    Thank you.


    Lucas

    To allow a package to your application during execution OEP, you will need to add it to the application MANIFEST. MF file for the Import Package section (since the OEP server is based on OSGi). There is no need to provide a version number, you can simply enter the name of the package (for example)

    com.bea.wlevs.Adapters.JMS.API,

Maybe you are looking for