[JCA/JBoss] - Re: need help! JCA sample!
by bruce_yuan
thanks a lot.
i've deploy the sample on my JBoss 4.0.5 AS.
the output of the guide was successful shown
run-example1:
| [copy] Copying 1 file to D:\jboss-4.0.5.GA\server\default\deploy
| [echo] Waiting for deploy...
| [java] Created Echo
| [java] Echo.echo('Hello') = Hello
But when i went to step 3 (to call the EchoBean), the console shows
| 20:58:07,952 INFO [EchoBean] echo, arg=Hello
| 20:58:07,962 ERROR [EchoBean] Failed during JNDI access
| javax.naming.NamingException: Could not dereference object [Root exception is javax.naming.NameNotFoundException: NoTransFS not bound]
| at org.jnp.interfaces.NamingContext.resolveLink NamingContext.java:1067)
|
| ......44more
|
is that alright? or something wrong?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4034994#4034994
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4034994
19 years
[JBoss Seam] - Can't get s:selectItems and s:convertEntity to work
by waynebagguley
I have this in my components.xml:
<component name="org.jboss.seam.ui.entityConverter">
| <property name="entityManager">#{em}</property>
| </component>
...and this in a session bean:
@PersistenceContext
| EntityManager em;
...and this on a page
<h:form>
| <h:selectOneMenu value="#{requestManager.item}" style="width:300px">
| <s:selectItems value="#{requestManager.items}" var="item" label="#{item.code} #{item.name}" />
| <s:convertEntity />
| </h:selectOneMenu>
| <h:commandButton id="proceed" value="Add" action="#{requestManager.addItem}"/>
| </h:form>
And although the selection box contains all the correct items, when I submit the page I get this error:
ERROR [EntityConverter] Entity Manager not found
Clearly I'm missing something vital but I can't figure out what it is. There's nothing in the documentation or examples that has helped.
Thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4034987#4034987
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4034987
19 years
[Beginners Corner] - TestNG, Eclipse and Database Connectivity Error
by brucecoad
Hi There
I'm try to write a very basic test and run it from Eclipse, that gets a hook into a postgres database, but am getting the error
"No Persistence provider for EntityManager named matches".
Here is my test.
public class BasicTest {
|
| private EntityManagerFactory emf;
|
| @Test
| public void test() throws Exception {
| EntityManager em =
| getEntityManagerFactory().createEntityManager();
| em.getTransaction().begin();
| // Some code
| em.close();
| }
|
| public EntityManagerFactory getEntityManagerFactory() {
| return emf;
| }
|
| @Configuration(beforeTestClass=true)
| public void init() {
| emf = Persistence.createEntityManagerFactory("matches");
| }
|
| @Configuration(afterTestClass=true)
| public void destroy() {
| emf.close();
| }
|
| }
My persistance.xml looks like this.
<persistence-unit name="matches">
| <provider>org.hibernate.ejb.HibernatePersistence</provider>
| <jta-data-source>java:/matchesDatasource</jta-data-source>
| <properties>
| <property name="hibernate.hbm2ddl.auto" value="update"/>
| <property name="hibernate.show_sql" value="true"/>
| <property name="jboss.entity.manager.factory.jndi.name"
| value="java:/matchesEntityManagerFactory"/>
| </properties>
| </persistence-unit>
And my components.xml has this piece of code.
<core:managed-persistence-context name="entityManager"
| persistence-unit-jndi-name="java:/matchesEntityManagerFactory"/>
|
| // Some standard Code
| <core:entity-manager-factory persistence-unit-name="matches"
| jndi-name="java:/matchesEntityManagerFactory" />
|
| <core:ejb installed="@embeddedEjb@"/>
| // More standard code
|
Any advice would be appreciated. I've followed most of the tutorials that I could find, but must be doing something wrong.
Thanks a lot.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4034983#4034983
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4034983
19 years
[JBoss Seam] - Re: Trinidad PPR/Ajax and Seam
by dajevtic
Hi Chane. Let's see:
"chane" wrote :
| 1) Did you extend/override the Seam PhaseListener or did you incorporate another one into the stack?
|
Created my own phase listener and added it in faces-config like this:
| <lifecycle>
| <phase-listener>
| mypackage.MyPhaseListener
| </phase-listener>
| <phase-listener>org.jboss.seam.jsf.TransactionalSeamPhaseListener</phase-listener>
| </lifecycle>
|
"chane" wrote :
| 2) Same question for the ActionListener?
|
Also in faces-config.xml just added:
| <action-listener>mypackage.MyActionListener</action-listener>
|
"chane" wrote :
| I have not worked with either of these, so new stuff to learn. Would you mind posting an example of the faces config for these two?
|
See the above samples!
"chane" wrote :
| Would you have an example page/config files that you could share?
|
I'll mix something up over the weekend, ok?!
"chane" wrote :
| I'm reading through the Trinidad docs and have not fully incorporated all of the pieces yet.
| - To date I have not used navigation rules, but it looks like I must for dialog:something to work in the commandButton action (did you find something else that would work?)
|
Unfortunately, I haven't. I use navigation rules for the dialog framework just like you do!
Kind regards,
dj :-)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4034982#4034982
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4034982
19 years