[JBoss jBPM] - Re: gwt-console datasource problems
by jjrs
Hi,
I was finally able to discover what the problem was.
All the birt reports included in the gwt-console, are pointing to a external datasource, so they need to be checked and modify in case it's needed to use the correct datasource...
The reports are located in ... [JBOSS]\server\default\data\birt
They are called XXXXXXX_report.rptdesign, and the section to modify in case it's needed is:
<data-sources>
| <oda-data-source extensionID="org.eclipse.birt.report.data.oda.jdbc" name="MySQL Local" id="6">
| <property name="odaDriverClass">com.mysql.jdbc.Driver</property>
| <property name="odaURL">jdbc:mysql://localhost:3306/jbpmtest</property>
| <property name="odaUser">jbpmtest</property>
| <property name="odaJndiName">java:/JbpmDS</property>
| </oda-data-source>
| </data-sources>
However after having all the reports referencing the correct datasource, they still don't work, but I will ask about them in another post as I consider this issue as a different topic.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4215649#4215649
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4215649
17 years, 1 month
[Advanced Documentation] - org.jboss.classloader.spi.base.BaseClassLoader API
by davecasserly
Hi,
I'm using jboss 5.0.1.GA.
Anybody know where i can find the source or the API to
org.jboss.classloader.spi.base.BaseClassLoader ?
When my application deploys i am getting a reference to the classloader. (ApplicationClassScanner is on of my classes)
| ClassLoader detectedClassLoader = ApplicationClassScanner.class.getClassLoader();
|
On jboss 4.5 - it used to return a class called org.jboss.mx.loading...something, i can't remember exactly. But i used reflection to execute a method called getClasspath() which returned a list of URLs of all the classpath entries.
Anyway, the classloader has changed and my code is now broken because the new classloader doesn't have this method.
I've used reflection to print out all the methods it supports, but none seem correct and i just can't seem to get a list of all the classpath entries for my loaded web application.
Any ideas.... or just tell me where the api or source is for this class. I've searched internet, and downloaded jboss source, but its just not in there - even though a lot of the other source imports this class.... i dont' get it!
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4215645#4215645
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4215645
17 years, 1 month
[JBoss AOP] - Re: Using AOP to mock out dependecies for unit-test
by nizzy
Hi Stale,
Couldn't get it any smaller, :)
Cut down Session Bean
public class AOPUnitTestManagerBean {
|
| private IPersistenceHelper helper;
|
| public AOPUnitTestManagerBean() {
| helper = new PersistenceHelper(null);
| }
|
| public void createObject(Object o) {
| helper.create(o);
| }
| }
JUnit Test
import org.junit.Before;
| import org.junit.Test;
|
| public class AOPUnitTestManagerBeanTest {
|
| private AOPUnitTestManagerBean man;
|
| @Before
| public void setUp() throws Exception {
| man = new AOPUnitTestManagerBean();
| }
|
| @Test
| public void testCreateObject() {
|
| String s = new String("Hello");
| man.createObject(s);
| }
| }
IPersistenceHelper interface
public interface IPersistenceHelper {
|
| public void create(Object o);
| }
MockPersistenceHelper
public class MockPersistenceHelper implements IPersistenceHelper {
|
| public MockPersistenceHelper(String PERSISTENCE_CONTEXT_NAME) {
| }
|
| public void create(Object o) {
| System.out.println("inside MockPersistenceHelper.create()");
| }
| }
PersistenceHelper
public class PersistenceHelper implements IPersistenceHelper {
|
| public PersistenceHelper(String persistenceContextName) {
| }
|
| public void create(Object o) {
| System.out.println("inside PersistenceHelper.create()");
| System.out.println("This should have been mocked-out --- did you set -javaagent in jvm args?");
| }
| }
Interceptor
import org.jboss.aop.advice.Interceptor;
| import org.jboss.aop.joinpoint.Invocation;
|
| public class PersistenceHelperInterceptor implements Interceptor {
|
| public String getName() {
| return "PersistenceHelperInterceptor";
| }
|
| public Object invoke(Invocation invocation) throws Throwable {
| System.out.println("Inside PersistenceHelperInterceptor.invoke");
|
| Object helper = new MockPersistenceHelper(null);
| return helper;
| }
| }
jboss-aop.xml
<?xml version="1.0" encoding="UTF-8"?>
| <aop>
|
| <bind pointcut="execution(public $typedef{persistenceHelperTypeDef}->new(java.lang.String))">
| <interceptor class="PersistenceHelperInterceptor"/>
| </bind>
|
| <!-- This causes Stack Overflow Error since both PersistenceHelper
| and MockPersistenceHelper implement IPersistenceHelper, causing
| infinite loop (of sorts) -->
| <typedef name="persistenceHelperTypeDef" expr="class($instanceof{IPersistenceHelper})" />
|
| <!-- This causes ClassCastException -->
| <!-- typedef name="persistenceHelperTypeDef" expr="class($instanceof{IPersistenceHelper}) AND !class(MockPersistenceHelper)" /-->
|
| </aop>
Hope this helps
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4215632#4215632
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4215632
17 years, 1 month