This content has been marked as final.
Show 4 replies
-
1. Re: Problems with injection of persistence context.
pmuir Jan 29, 2007 5:49 PM (in response to adamkoprowski)Post your components.xml
-
2. Re: Problems with injection of persistence context.
adamkoprowski Jan 29, 2007 6:04 PM (in response to adamkoprowski)Here it goes:
components.xml:<?xml version="1.0" encoding="UTF-8"?> <components xmlns="http://jboss.com/products/seam/components" xmlns:core="http://jboss.com/products/seam/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation= "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-1.1.xsd http://jboss.com/products/seam/components http://jboss.com/products/seam/components-1.1.xsd"> <core:init debug="true" jndi-pattern="@jndiPattern@"/> <core:manager concurrent-request-timeout="500" conversation-timeout="120000" conversation-id-parameter="cid" conversation-is-long-running-parameter="clr"/> <core:pages no-conversation-view-id="/home.xhtml"/> <core:managed-persistence-context name="entityManager" persistence-unit-jndi-name="java:/youdoEntityManagerFactory"/> <core:ejb installed="@embeddedEjb@"/> </components>
persistence.xml:<?xml version="1.0" encoding="UTF-8"?> <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0"> <persistence-unit name="youdo"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <jta-data-source>java:/youdoDatasource</jta-data-source> <properties> <property name="hibernate.hbm2ddl.auto" value="update"/> <property name="hibernate.cache.use_query_cache" value="true"/> <property name="hibernate.show_sql" value="false"/> <property name="jboss.entity.manager.factory.jndi.name" value="java:/youdoEntityManagerFactory"/> </properties> </persistence-unit> </persistence>
-
3. Re: Problems with injection of persistence context.
pmuir Jan 29, 2007 6:08 PM (in response to adamkoprowski)There's your problem, you've called the component entityManager but are trying to inject it as em. Remember Seam injects by variable name NOT class/interface.
-
4. Re: Problems with injection of persistence context.
adamkoprowski Jan 29, 2007 6:16 PM (in response to adamkoprowski)Remember Seam injects by variable name NOT class/interface.
Ups, I didn't know that. Sorry, I'm a newbie to Seam and the manual seems to go rather smoothly over such technicalities... Thanks a lot for help!
Adam