Hi,
I followed the instructions from Nicolas to add the DataSource in the
Jetty config and now I'm facing this error:
[WARN] Configuration problem at <resource-ref><description>MySQl
Connection</description><res-ref-name>jdbc/skyline</res-ref-name><res-
type>javax.sql.DataSource</res-type><res-auth>Container</res-auth></
resource-ref>
java.lang.ClassCastException: org.mortbay.jetty.plus.naming.Resource
cannot be cast to org.mortbay.jetty.plus.naming.NamingEntry
at org.mortbay.jetty.plus.naming.NamingEntry.lookupNamingEntry
(NamingEntry.java:211)
at org.mortbay.jetty.plus.naming.NamingEntry.bindToENC
(NamingEntry.java:104)
at org.mortbay.jetty.plus.webapp.Configuration.bindResourceRef
(Configuration.java:73)
at org.mortbay.jetty.plus.webapp.AbstractConfiguration.initResourceRef
(AbstractConfiguration.java:262)
at
org.mortbay.jetty.plus.webapp.AbstractConfiguration.initWebXmlElement
(AbstractConfiguration.java:161)
at org.mortbay.jetty.webapp.WebXmlConfiguration.initialize
(WebXmlConfiguration.java:289)
at org.mortbay.jetty.plus.webapp.AbstractConfiguration.initialize
(AbstractConfiguration.java:133)
at org.mortbay.jetty.webapp.WebXmlConfiguration.configure
(WebXmlConfiguration.java:222)
at org.mortbay.jetty.plus.webapp.AbstractConfiguration.configure
(AbstractConfiguration.java:113)
at org.mortbay.jetty.webapp.WebXmlConfiguration.configureWebApp
(WebXmlConfiguration.java:180)
at org.mortbay.jetty.plus.webapp.AbstractConfiguration.configureWebApp
(AbstractConfiguration.java:96)
at org.mortbay.jetty.plus.webapp.Configuration.configureWebApp
(Configuration.java:124)
at org.mortbay.jetty.webapp.WebAppContext.startContext
(WebAppContext.java:1217)
at org.mortbay.jetty.handler.ContextHandler.doStart
(ContextHandler.java:513)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:
448)
at skyline.frontend.server.helper.CustomJettyLauncher
$WebAppContextWithReload.doStart(CustomJettyLauncher.java:412)
at org.mortbay.component.AbstractLifeCycle.start
(AbstractLifeCycle.java:39)
at org.mortbay.jetty.handler.HandlerWrapper.doStart
(HandlerWrapper.java:130)
at org.mortbay.jetty.handler.RequestLogHandler.doStart
(RequestLogHandler.java:115)
at org.mortbay.component.AbstractLifeCycle.start
(AbstractLifeCycle.java:39)
at org.mortbay.jetty.handler.HandlerWrapper.doStart
(HandlerWrapper.java:130)
at org.mortbay.jetty.Server.doStart(Server.java:222)
at org.mortbay.component.AbstractLifeCycle.start
(AbstractLifeCycle.java:39)
at skyline.frontend.server.helper.CustomJettyLauncher.start
(CustomJettyLauncher.java:464)
at com.google.gwt.dev.HostedMode.doStartUpServer(HostedMode.java:365)
at com.google.gwt.dev.HostedModeBase.startUp(HostedModeBase.java:590)
at com.google.gwt.dev.HostedModeBase.run(HostedModeBase.java:397)
at com.google.gwt.dev.HostedMode.main(HostedMode.java:232)
I have both necessary libraries in my WEB-INF/lib directory, created
the CustomJettyLauncher as described and added the xml config:
entry in web.xml:
<resource-ref>
<description>MySQl Connection</description>
<res-ref-name>jdbc/skyline</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
jetty-env.xml:
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN"
"http://jetty.mortbay.org/configure.dtd">
<Configure class="org.mortbay.jetty.webapp.WebAppContext">
<New id="skyline" class="org.mortbay.jetty.plus.naming.Resource">
<Arg>jdbc/skyline</Arg>
<Arg>
<New
class="com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource">
<Set name="Url">jdbc:mysql://localhost:3306/skyline</
Set>
<Set name="User">root</Set>
<Set name="Password">admin</Set>
</New>
</Arg>
</New>
</Configure>
Can anyone of you tell me, what I did wrong?
Kind Regards,
Christian
On Jul 20, 5:00 am, Henning <[email protected]> wrote:
> You have to add the jetty-*.jar's in the launch configuration
> properties' classpath. The project classpath is not used for the
> internal jetty server.
>
> I made a description in my blog (in german):
>
> http://curtstech.blogspot.com/2009/07/gwt-16-hosted-mode-internen-jet...
>
> -Henning
>
> On 5 Jun., 18:59, Mark <[email protected]> wrote:
>
>
>
> > Hi Chad,
>
> > I followed your guide, but I get an error when starting up hosted
> > mode:
>
> > [WARN] Config error at
> > <New id="website" class="org.mortbay.jetty.plus.naming.Resource">
> > <Arg>java:comp/env/jdbc/database</Arg>
> > <Arg>
> > <New
> > class="com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource">
> > <Set name="Url">jdbc:mysql://localhost:3306/mydbname</Set>
> > <Set name="User">myusername</Set><Set name="Password">mypassword</
> > Set></New>
> > </Arg>
> > </New>
>
> > I read around and it seems that jetty thinks that the jetty-plus and
> > jetty-naming jars are not in my classpath, but I did add them to my
> > project file - any idea what could be missing?
>
> > Shouldn't we have an official example from GWT as well for this now
> > that the switch has been made to Jetty? Seems like a common thing
> > people would want to do,
>
> > Thanks,
> > Mark
>
> > On May 7, 12:24 pm, Chad <[email protected]> wrote:
>
> > > You can do this by configuring ajetty-web.xml file. I blogged what
> > > worked for us at:
>
> > >http://humblecode.blogspot.com/2009/05/gwt-16-using-jndi-datasource.html
>
> > > On Mar 11, 11:16 pm, wiltonj <[email protected]> wrote:
>
> > > > Hi,
> > > > How to setting DataSource in GWT 1.6 (Hosted mode -Jetty)?
>
> > > > Hoping for some guidance.
>
> > > > Thanks & Regards,
> > > > Wilton- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---