Menu

Unabled to Connect To Database - HELP!

Help
2003-09-25
2003-09-26
  • Brandon Ridenour

    I'm trying to connect to a MySQL database from WSAD 5.0 using Hibernator.  Unfortunately, no matter what I do I receive the following error:

    java.lang.IllegalArgumentException: Path must include project and resource name.

    Here are my connection config settings:

    ConnectionName: mytest
    username: odbc
    password: odbc
    URL:  JDBC:mysql://127.0.0.1:3306/test
    Driver Class:  com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource
    Dialect:  net.sf.hibernate.dialect.MySQLDialect
    Driver Filename: C:\development\WebSphere\AppServer\lib\mysql-connector-java-3.0.8-stable\mysql-connector-java-3.0.8-stable-bin.jar

    Can you tell me if I've configured these properties appropriately?  I've searched hi and low and can't find any docs showing how these should be set.

    Also, I have my source in subfolders, and i have all the jar files in my workspace (hibernate jars).  In addition, i included the j4log jar in the hibernator plug in directory.

    Here is the complete stack-trace:

    Adding Project Depedents C:/Documents and Settings/Brandon/My Documents/IBM/wsappdevie/workspace/HibernateTest/hibernate2.jar
    java.lang.IllegalArgumentException: Path must include project and resource name.
        at org.eclipse.core.internal.resources.Workspace.newResource(Workspace.java(Compiled Code))
        at org.eclipse.core.internal.resources.Workspace.newResource(Workspace.java(Compiled Code))
        at org.eclipse.core.internal.resources.Container.getFolder(Container.java:137)
        at net.sf.hibernator.HibernateConnection.createConnection(HibernateConnection.java:130)
        at net.sf.hibernator.views.ConnectionView.connect(ConnectionView.java:185)
        at net.sf.hibernator.views.ConnectionView.access$4(ConnectionView.java:180)
        at net.sf.hibernator.views.ConnectionView$6.run(ConnectionView.java:164)
        at org.eclipse.jface.action.Action.runWithEvent(Action.java:749)
        at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:407)
        at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent(ActionContributionItem.java(Compiled Code))
        at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent(ActionContributionItem.java(Compiled Code))
        at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent(ActionContributionItem.java(Compiled Code))
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java(Compiled Code))
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java(Compiled Code))
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java(Compiled Code))
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java(Compiled Code))
        at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java(Compiled Code))
        at org.eclipse.ui.internal.Workbench.run(Workbench.java:1326)
        at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:831)
        at org.eclipse.core.boot.BootLoader.run(BootLoader.java:462)
        at java.lang.reflect.Method.invoke(Native Method)
        at org.eclipse.core.launcher.Main.basicRun(Main.java:247)
        at org.eclipse.core.launcher.Main.run(Main.java:703)
        at org.eclipse.core.launcher.Main.main(Main.java:539)

    Thanks,
    Brandon

     
    • Daniel Bradby

      Daniel Bradby - 2003-09-25

      This error can happen when your source and classes are in the root directory of your project. I have fixed this in current CVS and will make a release shortly.

      In the meantime, put your source code in /src and output into /classes and it should work fine.

      Daniel

       
    • Brandon Ridenour

      Ai ai ai....so close and yet so far away....

      I've worked through about a dozen problems now (including the one above -- thanks for your help.)  Unfortunately, now it keeps saying it can't find my oracle driver...everything seems to be configured properly, as follows:

      URL:  jdbc:oracle:thin:@ 10.202.4.23:1521:DBOTGBS1

      Dialect:  net.sf.hibernate.dialect.OracleDialect

      Driver Class: 

      Wait...as i was copying and pasting this info in, i discovered an extra space at the end of my Driver Class name...remove that, and voila...

      sheesh...

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.