By the way, the error I get is this one:
javax.naming.NoInitialContextException: Need to specify class name in
environment or system property, or as an applet parameter, or in an
application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext
(NamingManager.java:645)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:
288)
at javax.naming.InitialContext.getURLOrDefaultInitCtx
(InitialContext.java:325)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at com.tamariu.server.util.ApartmentConnectionPool.<init>
(ApartmentConnectionPool.java:19)
at com.tamariu.server.util.ApartmentConnectionPool.getInstance
(ApartmentConnectionPool.java:31)
at
com.tamariu.server.util.ApartmentInformationReciever.getAllApartments
(ApartmentInformationReciever.java:56)
at com.tamariu.server.ApartmentListServiceImpl.getApartments
(ApartmentListServiceImpl.java:55)
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:597)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse
(RPC.java:527)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall
(RemoteServiceServlet.java:166)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost
(RemoteServiceServlet.java:86)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
487)
at org.mortbay.jetty.servlet.ServletHandler.handle
(ServletHandler.java:362)
at org.mortbay.jetty.security.SecurityHandler.handle
(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle
(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle
(ContextHandler.java:729)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:
405)
at org.mortbay.jetty.handler.HandlerWrapper.handle
(HandlerWrapper.java:152)
at org.mortbay.jetty.handler.RequestLogHandler.handle
(RequestLogHandler.java:49)
at org.mortbay.jetty.handler.HandlerWrapper.handle
(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:324)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:
505)
at org.mortbay.jetty.HttpConnection$RequestHandler.content
(HttpConnection.java:843)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:205)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
at org.mortbay.io.nio.SelectChannelEndPoint.run
(SelectChannelEndPoint.java:395)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run
(QueuedThreadPool.java:488)
On 2 abr, 02:31, polbat02 <[email protected]> wrote:
> My question is simple... how do I define a new DataSource (to connect
> to a DataBase) in Hosted Mode in the new GWT 1.6 RC2??
> I tried with this in a jetty-env.xml file and in a context.xml file:
> <resource-ref>
> <description>My DataSource Reference</description>
> <res-ref-name>jdbc/apartments</res-ref-name>
> <res-type>javax.sql.DataSource</res-type>
> <res-auth>Container</res-auth>
> </resource-ref>
>
> <New id="apartments" class="org.mortbay.jetty.plus.naming.Resource">
> <Arg></Arg>
> <Arg>jdbc/apartments</Arg>
> <Arg>
> <New class="org.apache.commons.dbcp.BasicDataSource">
> <Set
> name="driverClassName">com.mysql.jdbc.Driver</Set>
> <Set
> name="factory">org.apache.commons.dbcp.BasicDataSourceFactory</Set>
> <Set name="url">
>
> jdbc:mysql://******************?autoReconnect=true</Set>
> <Set name="username">********</Set>
> <Set name="password">********</Set>
> </New>
> </Arg>
> </New>
>
> I also tried with this in a typical tomcat style context.xml file:
> <?xml version='1.0' encoding='utf-8'?>
> <Context path="">
> <Resource name="jdbc/apartments" auth="Container"
> type="javax.sql.DataSource" />
> <ResourceParams name="jdbc/apartments">
> <parameter>
> <name>factory</name>
> <value>org.apache.commons.dbcp.BasicDataSourceFactory
> </value>
> </parameter>
> <parameter>
> <name>username</name>
> <value>***********</value>
> </parameter>
> <parameter>
> <name>password</name>
> <value>***********</value>
> </parameter>
> <parameter>
> <name>driverClassName</name>
> <value>com.mysql.jdbc.Driver</value>
> </parameter>
> <parameter>
> <name>url</name>
> <value>jdbc:mysql://**************?autoReconnect=true
> </value>
> </parameter>
> </ResourceParams>
> </Context>
>
> It was working just fine before updating to 1.6 modifying the ROOT.xml
> file in the tomcate lite directory.
>
> I would REALLY appreciate any help...
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---