Running a separate server is what I did for the past couple of months
whilst developing my web app and, frankly, is a pain :-)

I ran into exactly the same problem and, after searching in vain for a
Jetty-solution, I decided to just address the issue at the root and do
away with the LocalContainerEntityManagerFactoryBean.
I'm using instead a (much more limited)
org.springframework.orm.jpa.LocalEntityManagerFactoryBean.

so my beans.xml has changed to:

  <bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean">
    <property name="persistenceUnitName" value="StocksPU"/>
  </bean>

  <!--  no longer used
  <bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
    <property name="dataSource" ref="dataSource" />
    <property name="jpaVendorAdapter">
      <bean
class="org.springframework.orm.jpa.vendor.TopLinkJpaVendorAdapter">
        <property name="showSql" value="false" />
        <property name="generateDdl" value="false" />
        <property name="databasePlatform"
value="oracle.toplink.essentials.platform.database.MySQL4Platform" />
      </bean>
    </property>
    <property name="loadTimeWeaver">
      <bean
class="org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver"
 /
>
    </property>
  </bean>
  -->

 this was the original bean def - what I particularly liked was the
fact I could configure the data source from
         a properties file, and in fact, I had several of them (prod,
dev and test) all operating on different db's (in fact, the dev
instance was even on a different server altogheter.

  <bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
    <property name="url" value="${jdbc.url}" />
    <property name="driverClassName" value="${jdbc.driver}" />
    <property name="username" value="${jdbc.username}" />
    <property name="password" value="${jdbc.password}" />
  </bean>

  <bean id="testDataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
    <property name="url" value="${jdbc.test.url}" />
    <property name="driverClassName" value="${jdbc.driver}" />
    <property name="username" value="${jdbc.test.username}" />
    <property name="password" value="${jdbc.test.password}" />
  </bean>

This is now all gone out of the window - the datasource parameters are
configured in META-INF/persistence.xml:

<?xml version="1.0" encoding="UTF-8"?>

<persistence xmlns="http://java.sun.com/xml/ns/persistence";
      version="1.0" >
      <persistence-unit name="StocksPU" transaction-
type="RESOURCE_LOCAL">
        <class>com.g.MyClass</class>
        <class>com.g.AnotherClass</class>
        <class>...</class>

        <properties>
          <property name="toplink.jdbc.driver"
                    value="com.mysql.jdbc.Driver" />
          <property name="toplink.jdbc.url"
                    value="jdbc:mysql://fangorn:3306/stocks_dev" />
          <property name="toplink.jdbc.user" value="asif" />
          <property name="toplink.jdbc.password" value="blah" />
        </properties>
      </persistence-unit>
</persistence>

although, I guess I could create several PUs and have a similar
flexibility.
This _seems_ to work just fine (at least, for the very limited testing
I've done).

Not sure how can I get access to the other properties for the
datasource and the vendor adapter, so if anyone has any suggestions,
that would be greatly appreciated.

On Apr 16, 2:58 am, Sumit Chandel <[email protected]> wrote:
> Hello everyone,
> The best way to use custom server-side frameworks or technologies with
> hosted mode is to use your own server instead of the embedded Jetty
> instance. This can be accomplished by passing in the -noserver flag, or if
> you're using the Google Eclipse Plug-in, by setting a couple of options in
> the Web Application run configuration.
>
> If you're running hosted mode from command line, simply add the following as
> GWTShell / HostedMode arguments in your script:
> -noserver <URL pointing to your development server>
>
> If you're using the Google Eclipse Plug-in, follow these steps instead:
>
> 1) Select and open the Web Application run configuration you want to execute
> (Run > Run Configurations... > Expand the 'Web Application' configurations >
> Select your run configuration).
>
> 2) In the 'Main' tab, under the Embedded Server section, uncheck the "Run
> built-in server checkbox.
>
> 3) Next, in the "GWT" tab, change the URL to point to your development
> server.
>
> This way you can run hosted mode with your own development server,
> customized as needed to match your production server-side settings.
>
> Hope that helps,
> -Sumit Chandel
>
> On Mon, Apr 13, 2009 at 5:06 AM, EZhulenev <[email protected]> wrote:
>
> > I have the same problem. How is it possible to use spring-agent in
> > hosted mode?
>
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to