facebook

Local Debugging and the Application Context Root

  1. MyEclipse IDE
  2.  > 
  3. Installation, Configuration & Updates
Viewing 9 posts - 16 through 24 (of 24 total)
  • Author
    Posts
  • #249030 Reply

    mcroft
    Member

    Thank you, so far so good. My next obstacle is allowing Geronimo through MyEclipse to see my datasource. I have a datasource configured on my machine, and our application code reads a .properties file to get the userid and password, URL, and driver class. I am not sure where to configure this in MyEclipse. Again, in WSAD there was no specific configuration for this. A lot of material I have read talks of creating a deployment plan and building new folders for db2 in the <%Geronimo Home%>/repository directory, but this seems like overkill. I did all this configuration already when setting up the datasource on my machine. It is not throwing a class not found exception, it just cannot get a connection for some reason. It there a configuration I am missing?

    #249058 Reply

    Riyad Kalla
    Member

    If your app server needs a connection to this you should place the properties file in the class loader hierarchy where your code can find it, so this doesn’t involve MyEclipse.

    If you are however asking how to use the MyEclipse Database Tools to connect to your datasource, you need to connect it directly to your DB, since it doesn’t run in an app server space you cannot use a JNDI data source for the DB tools (like the DB Explorer)

    #249092 Reply

    mcroft
    Member

    The app is reading my properties file. I already have the datasource configured on my machine, so I dont want to connect to the database directly, nor could I due to network permissions. Here is an article I am researching, specifically the section on creating a global datasource connection. I am getting an error through my console when trying to follow these directions though…
    http://www-128.ibm.com/developerworks/opensource/library/os-ag-jdbc/

    I created my db2-plan.xml file and I am running the deploy.jar command, but I get this:

    C:\Program Files\Geronimo\geronimo-1.0>java -jar bin\deployer.jar db2-plan.xml r
    epository\tranql\rars\tranql-connector-1.0-SNAPSHOT.rar

    Error: No such command: ‘db2-plan.xml’

    Do I even need to be doing this? I have tried several things and I still cannot get a connection to the DB.

    #249102 Reply

    Riyad Kalla
    Member

    I really don’t think so. Just setup your DB, then start Geronimo, then go to localhost:8080 and login to the administration application, then go setup a global JNDI data source. Tomcat and Sun App Server (and others) are similar to this. You can setup an app-server wide data source using JNDI or setup one on a per-context basis for each web app that needs one.

    I’m a litttle confused because I don’t know what you are trying to do or what is new to you. Let me know what your eventual end goal is and how new this is to you (possibility that you may be learning all this stuff on the fly or are you an expert and are trying to do something complex?) and I’ll try and shoot some ideas your way.

    #249112 Reply

    mcroft
    Member

    The database is already set up and lives on the network. We do not connect to our DB2 databases directly. We use DB2 connect. There are datasources configured on our machines, host, port number, subsystem etc. Setting a global datasource reference is essentially what the command above is doing in-part. I simply need to allow Geronimo to use my already configured datasource so I can connect to our databases.

    When i use the Geronimo console and use the database pool wizard (i did not see a JNDI datasource link) and try to connect, i get this error:

    com.ibm.db2.jcc.c.SqlException: The version of the IBM Universal JDBC driver in use is not licensed for connectivity to z/OS databases. To connect to this DB2 server, please obtain a licensed copy of the IBM DB2 Universal Driver for JDBC and SQLJ. An appropriate license file db2jcc_license_*.jar for this target platform must be installed to the application classpath. Connectivity to z/OS databases is enabled by any of the following license files: { db2jcc_license_cisuz.jar }
    at com.ibm.db2.jcc.c.o.cb(o.java:2953)
    at com.ibm.db2.jcc.c.o.bb(o.java:2899)
    at com.ibm.db2.jcc.a.b.bb(b.java:508)
    at com.ibm.db2.jcc.a.b.<init>(b.java:289)
    at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:162)
    at org.apache.geronimo.console.databasemanager.wizard.DatabasePoolPortlet.attemptConnect(DatabasePoolPortlet.java:797)
    at org.apache.geronimo.console.databasemanager.wizard.DatabasePoolPortlet.processAction(DatabasePoolPortlet.java:321)
    at org.apache.pluto.core.PortletServlet.dispatch(PortletServlet.java:229)
    at org.apache.pluto.core.PortletServlet.doGet(PortletServlet.java:158)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
    at org.apache.pluto.core.PortletServlet

    #249116 Reply

    mcroft
    Member

    Our applications use COM.ibm.db2.jdbc.app.DB2Driver

    but it almost seems as though Geronimo requires com.ibm.db2.jcc.DB2Driver to connect to DB2?

    #249125 Reply

    Riyad Kalla
    Member

    We’ve really shot above and beyond what I know about Geronimo and DB2, can you ask this question on the Geronimo forums and see if those guys have done this before and can help?

    #249633 Reply

    mcroft
    Member

    I have configured my db2_plan.xml file and deployed to Geronimo. When starting geronimo, he finds the plan and loads my COM.ibm.db2.app.jdbc.DB2Driver class. When I then go to MyEclipse and try to start Geronimo from there, i get the following error:

    java.lang.UnsatisfiedLinkError: no db2jdbc in java.library.path

    Is there a setting I am missing in MyEclipse. It seems the plugin starts Geronimo differently than from Geronimo directly. Remember that i can successfully start the Geronimo server outside MyEclipse, but from within MyEclipse, I get the above mentioned error. Here is my deployment plan for reference:

    <connector configId=”user/database-pool-Geronimo_DB2_Test/1/car” xmlns=”http://geronimo.apache.org/xml/ns/j2ee/connector-1.0″&gt;
    <dep:dependency xmlns:dep=”http://geronimo.apache.org/xml/ns/deployment-1.0″&gt;
    <dep:uri>db2/db2java/8.1.7/jar</dep:uri>
    </dep:dependency>
    <dependency>
    <uri>db2/db2jcc/8.1.7/jar</uri>
    </dependency>
    <dependency>
    <uri>db2/db2jcc_license_cu/8.1.7/jar</uri>
    </dependency>
    <dependency>
    <uri>db2/db2jcc_license_cisuz/8.1.7/jar</uri>
    </dependency>
    <resourceadapter>
    <outbound-resourceadapter>
    <connection-definition>
    <connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface>
    <connectiondefinition-instance>
    <name>Geronimo_DB2_Test</name>
    <config-property-setting name=”Password”>ecom1</config-property-setting>
    <config-property-setting name=”CommitBeforeAutocommit”>false</config-property-setting>
    <config-property-setting name=”Driver”>COM.ibm.db2.jdbc.app.DB2Driver</config-property-setting>
    <config-property-setting name=”ExceptionSorterClass”>org.tranql.connector.AllExceptionsAreFatalSorter</config-property-setting>
    <config-property-setting name=”UserName”>ecom1</config-property-setting>
    <config-property-setting name=”ConnectionURL”>jdbc:db2://HODB2MISC01:50000/VINDB</config-property-setting>
    <connectionmanager>
    <local-transaction/>
    <single-pool>
    <match-one/>
    </single-pool>
    </connectionmanager>
    </connectiondefinition-instance>
    </connection-definition>
    </outbound-resourceadapter>
    </resourceadapter>
    </connector>

    #249641 Reply

    Riyad Kalla
    Member

    java.lang.UnsatisfiedLinkError: no db2jdbc in java.library.path

    Is there a setting I am missing in MyEclipse. It seems the plugin starts Geronimo differently than from Geronimo directly. Remember that i can successfully start the Geronimo server outside MyEclipse, but from within MyEclipse, I get the above mentioned error. Here is my deployment plan for reference:

    Yes, navigate to your Window > Prefs > MyEclipse > App Servers > Geronimo 1 > Paths settings, go to the last box and then click Add to append the dir that contains the DB2 DLL’s in it to the library path.

Viewing 9 posts - 16 through 24 (of 24 total)
Reply To: Local Debugging and the Application Context Root

You must be logged in to post in the forum log in