Joined: Mon Jul 31, 2006 2:41 pm Posts: 13
|
I'm using jetty6, and the latest version of Hibernate. I have this in my hibernate.cfg.xml:
<property name="connection.datasource">java:comp/env/jdbc/mysqlds</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="current_session_context_class">thread</property>
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
<property name="show_sql">true</property>
And this in my etc/jetty.xml:
<New id="mysqlds" class="org.mortbay.jetty.plus.naming.Resource">
<Arg>jdbc/mysqlds</Arg>
<Arg>
<New class="org.apache.commons.dbcp.BasicDataSource">
<Set name="url">jdbc:mysql://localhost/lendingcrowd</Set>
<Set name="driverClassName">com.mysql.jdbc.Driver</Set>
<Set name="username">username</Set>
<Set name="password">xxxxxx</Set>
<Set name="maxActive">10</Set>
<Set name="poolPreparedStatements">true</Set>
</New>
</Arg>
</New>
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.mortbay.start.Main.invokeMain(Main.java:184)
at org.mortbay.start.Main.start(Main.java:508)
at org.mortbay.start.Main.main(Main.java:116)
Caused by: java.lang.ExceptionInInitializerError
at com.lendingcrowd.util.HibernateUtil.<clinit>(HibernateUtil.java:17)
at com.lendingcrowd.util.HibernateListener.contextInitialized(HibernateListener.java:9)
at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:392)
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:996)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:365)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:373)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:38)
at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:159)
at org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:118)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:38)
at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:159)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:38)
at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:97)
at org.mortbay.jetty.Server.doStart(Server.java:194)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:38)
at org.mortbay.xml.XmlConfiguration.main(XmlConfiguration.java:900)
... 7 more
Caused by: org.hibernate.HibernateException: Could not find datasource
at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:56)
at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124)
at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:56)
at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:366)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:60)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1881)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1174)
at com.lendingcrowd.util.HibernateUtil.<clinit>(HibernateUtil.java:13)
... 22 more
Caused by: javax.naming.NameNotFoundException; remaining name 'env/jdbc/mysqlds'
at org.mortbay.naming.NamingContext.lookup(NamingContext.java:624)
at org.mortbay.naming.NamingContext.lookup(NamingContext.java:655)
at org.mortbay.naming.NamingContext.lookup(NamingContext.java:670)
at org.mortbay.naming.java.javaRootURLContext.lookup(javaRootURLContext.java:112)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:52)
|
|