You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Inge Solvoll <in...@gmail.com> on 2010/10/20 12:14:11 UTC

Pollution of service namespaces

Some time ago, we had to change the id of one of our Spring beans. Reason:
chenillekit registers a service named "configurationService", which was the
name of our internal service as well.

This is a good example of a slightly polluted namespace, you can't name your
service logically according to the company's naming rules, causing our
spring/hibernate guys to say: "This rigid tapestry thing is causing too much
pain..."

The most obvious solution to this problem is to promote a coding standard
where you prefix the service id with your namespace, like
"ck:configurationService". But since most services are registered with
automatically generated id, that seems unlikely to happen.

The more involved solution would be to (optionally maybe) generate all
service ids prefixed by the module name. Or perhaps generate prefix only for
those services that have a name collision. An optional prefix (configuration
based) would mean that libraries like chenillekit and tynamo could use that,
while applications could skip that part.

Do you guys consider this to be an important issue, or is it an edge case?

Regards
Inge

Re: Tapestry 5.1 and openJPA

Posted by Richard Hill <ri...@su3analytics.com>.
Hi Josh,

Yes, after posting I figured my problem was probably not
tapestry-specific.

Will do, cheers.



-----Original Message-----
From: Josh Canfield <jo...@gmail.com>
Reply-to: "Tapestry users" <us...@tapestry.apache.org>
To: Tapestry users <us...@tapestry.apache.org>, rich@su3analytics.com
Subject: Re: Tapestry 5.1 and openJPA
Date: Wed, 20 Oct 2010 09:31:35 -0700

It sounds like your problem is more directly related to either spring
or open jpa. While you might find someone on this list with experience
in those technologies you might have more luck if you run it by
someone with spring/openjpa...


Josh

On Wed, Oct 20, 2010 at 6:22 AM, Richard Hill <ri...@su3analytics.com> wrote:
>
> Hi All,
>
> I'm using openJPA directly (no hibernate), and am having a problem with defining a persistence provider.
> When I request a page with an injected Dao I get the following exception:
>
> org.springframework.beans.factory.BeanCreationException:
> Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/beans.xml]
> ....
> Caused by: javax.persistence.PersistenceException: No Persistence provider for EntityManager named sitedelta
>        at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:84)
>
> I am not sure that my persistence.xml is being picked up. It's in WebContent/META-INF/persistence.xml.
> Is this the correct place?
>
>
> Details:
>
> In my beans.xml I have included:
>
> <bean id="entityManagerFactory"
> class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean">
>        <property name="persistenceUnitName" value="sitedelta" />
> </bean>
>
> <bean id="deltaRunDao"
> class="com.su3analytics.sitedelta.dao.DeltaRunDao" />
>
>
> In my persistence.xml I have:
>
> <persistence-unit name="sitedelta" transaction-type="RESOURCE_LOCAL">
> <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
> <class>com.su3analytics.sitedelta.model.DeltaRun</class>
>        ....
>
> </persistence>
>
>
> Thanks Richard.
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Tapestry 5.1 and openJPA

Posted by Josh Canfield <jo...@gmail.com>.
It sounds like your problem is more directly related to either spring
or open jpa. While you might find someone on this list with experience
in those technologies you might have more luck if you run it by
someone with spring/openjpa...


Josh

On Wed, Oct 20, 2010 at 6:22 AM, Richard Hill <ri...@su3analytics.com> wrote:
>
> Hi All,
>
> I'm using openJPA directly (no hibernate), and am having a problem with defining a persistence provider.
> When I request a page with an injected Dao I get the following exception:
>
> org.springframework.beans.factory.BeanCreationException:
> Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/beans.xml]
> ....
> Caused by: javax.persistence.PersistenceException: No Persistence provider for EntityManager named sitedelta
>        at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:84)
>
> I am not sure that my persistence.xml is being picked up. It's in WebContent/META-INF/persistence.xml.
> Is this the correct place?
>
>
> Details:
>
> In my beans.xml I have included:
>
> <bean id="entityManagerFactory"
> class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean">
>        <property name="persistenceUnitName" value="sitedelta" />
> </bean>
>
> <bean id="deltaRunDao"
> class="com.su3analytics.sitedelta.dao.DeltaRunDao" />
>
>
> In my persistence.xml I have:
>
> <persistence-unit name="sitedelta" transaction-type="RESOURCE_LOCAL">
> <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
> <class>com.su3analytics.sitedelta.model.DeltaRun</class>
>        ....
>
> </persistence>
>
>
> Thanks Richard.
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Tapestry 5.1 and openJPA

Posted by Richard Hill <ri...@su3analytics.com>.
Hi All,

I'm using openJPA directly (no hibernate), and am having a problem with defining a persistence provider. 
When I request a page with an injected Dao I get the following exception:

org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/beans.xml]
....
Caused by: javax.persistence.PersistenceException: No Persistence provider for EntityManager named sitedelta
	at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:84)

I am not sure that my persistence.xml is being picked up. It's in WebContent/META-INF/persistence.xml. 
Is this the correct place?


Details:

In my beans.xml I have included:

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

<bean id="deltaRunDao"
class="com.su3analytics.sitedelta.dao.DeltaRunDao" /> 


In my persistence.xml I have:

<persistence-unit name="sitedelta" transaction-type="RESOURCE_LOCAL">
<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
<class>com.su3analytics.sitedelta.model.DeltaRun</class>
	....

</persistence>


Thanks Richard.





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Pollution of service namespaces

Posted by Howard Lewis Ship <hl...@gmail.com>.
Stripping away qualified service ids (from T4/HiveMind) was one of the
simplifications that came with Tapestry.

Finding a way to deal with naming conflicts now is going to pose a bit
of a challenge.

We're we are headed is something more like Guice, where there is no
concept of a service id: just service interfaces and marker
annotations (to deal with ambiguities).

On Wed, Oct 20, 2010 at 3:14 AM, Inge Solvoll <in...@gmail.com> wrote:
> Some time ago, we had to change the id of one of our Spring beans. Reason:
> chenillekit registers a service named "configurationService", which was the
> name of our internal service as well.
>
> This is a good example of a slightly polluted namespace, you can't name your
> service logically according to the company's naming rules, causing our
> spring/hibernate guys to say: "This rigid tapestry thing is causing too much
> pain..."
>
> The most obvious solution to this problem is to promote a coding standard
> where you prefix the service id with your namespace, like
> "ck:configurationService". But since most services are registered with
> automatically generated id, that seems unlikely to happen.
>
> The more involved solution would be to (optionally maybe) generate all
> service ids prefixed by the module name. Or perhaps generate prefix only for
> those services that have a name collision. An optional prefix (configuration
> based) would mean that libraries like chenillekit and tynamo could use that,
> while applications could skip that part.
>
> Do you guys consider this to be an important issue, or is it an edge case?
>
> Regards
> Inge
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org