[JBoss AOP] - How test aop in junit testcase in Eclipse (loadtime weaving)
by afloom
I'm trying to get a junit testcase running with my aop interceptors. As I understand that the AOP IDE is very outdated I'm trying to configure Eclipse to do this myself. I'm trying ot get this working with loadtime weaving so that no special compilation is needed, which (I think) would simplify development. I'm not using ant either, but Maven.
What I've done is that I have a Eclipse project with my interceptors, my jboss-aop.xml and a jUnit (3) test case. Everything in standard maven structure.
I'm trying to run my test case by creating my own JUnit run configuration in Eclipse. (Right click on the test case class and choose Run As...->Run.) I've configured the -javaagent VM argument (-javaagent:${project_loc}/jbossaop-lib/jboss-aop-jdk50.jar) and I've also added the jar files needed to the classpath.
However, the interceptor is not run. The jboss-aop.xml file is being read, because if I introduce some syntax error in it I get an error message.
Anyone doing something like this and can help me? I understand it's difficult to say what the problem is but maybe you have some ideas where I should start looking? How should i troubleshoot this?
/Anders
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4089591#4089591
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4089591
18 years, 6 months
[JBoss Seam] - Re: Change Database Connection at Runtime
by knuwu
Hi breaveFencer
In your resources/WEB-INF/components.xml configuration file you find the following line:
| <core:managed-persistence-context name="entityManager"
| auto-create="true"
| persistence-unit-jndi-name="java:/yourDBnameEntityManagerFactory" />
|
Where "yourDBname" is normaly the name of your db reference in /META-INF/persistence.xml
| <persistence-unit name="yourDBname">
| <provider>org.hibernate.ejb.HibernatePersistence</provider>
| <jta-data-source>java:/yourDBnameDatasource</jta-data-source>
| <properties>
| <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
| <property name="hibernate.cache.use_query_cache" value="true"/>
| <property name="hibernate.show_sql" value="true"/>
| <property name="jboss.entity.manager.factory.jndi.name" value="java:/yourDBnameEntityManagerFactory"/>
| </properties>
| </persistence-unit>
|
which is actually a reference to the jboss *-ds.xml configuration.
You may configure a second database connection (an addition *-ds.xml, a new enty in your persitence.xml and components.xml).
| <core:managed-persistence-context name="entityManager2"
| auto-create="true"
| persistence-unit-jndi-name="java:/yourOtherDBnameEntityManagerFactory" />
|
On code level you may reference the new entityManager with
| entityManager= (EntityManager) Component.getInstance( "entityManager2" );
|
The old one with
| entityManager= (EntityManager) Component.getInstance( "entityManager" );
|
| Or simply with annotation
|
| @In EntityManager entityManager;
|
Can not garantee this works but i would try it.
Greetings Ralph
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4089585#4089585
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4089585
18 years, 6 months
[JBoss Seam] - Re: Hibernate Search and JBoss Seam example
by brachie
"pete.muir(a)jboss.org" wrote : whats the error?
The error I get is:
(personensuche.xhtml is the template showing the results)
| Exception during request processing:
| Caused by javax.servlet.ServletException with message: "/application/personensuche.xhtml: value of context variable is not an instance of the component bound to the context variable: person"
|
| javax.faces.webapp.FacesServlet.service(FacesServlet.java:256)
| org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:208)
| org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:165)
| org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:138)
| org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
| org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
| org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
| org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
| org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:44)
| org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
| org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
| org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
| org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
| org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
| org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:150)
| org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
| org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
| org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
| org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
| org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
| org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
| org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
| org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
| org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
| org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
| java.lang.Thread.run(Thread.java:619)
|
Can anybode tell me how to display elements of the object array correct?
Thanks!
Alexander
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4089582#4089582
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4089582
18 years, 6 months