[JBoss jBPM] - Hello world example failed on junit test , throws ClassCastE
by developerdev
Hi
I am trying to run hello world example provided with jbpm.bpel tut. All the steps are successful but at last on running run-test it gives folloeing error..
any help????
run-test:
[junit] Testsuite: org.jbpm.bpel.tutorial.hello.ClientTest
[junit] Tests run: 2, Failures: 0, Errors: 2, Time elapsed: 0.391 sec
[junit] Testcase: testSayHello_proxy(org.jbpm.bpel.tutorial.hello.ClientTest
): Caused an ERROR
[junit] javax.naming.Reference
[junit] java.lang.ClassCastException: javax.naming.Reference
[junit] at org.jbpm.bpel.tutorial.hello.ClientTest.setUp(ClientTest.java
:33)
[junit] Testcase: testSayHello_dii(org.jbpm.bpel.tutorial.hello.ClientTest):
Caused an ERROR
[junit] javax.naming.Reference
[junit] java.lang.ClassCastException: javax.naming.Reference
[junit] at org.jbpm.bpel.tutorial.hello.ClientTest.setUp(ClientTest.java
:33)
[junit] Test org.jbpm.bpel.tutorial.hello.ClientTest FAILED
regards
devesh
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961186#3961186
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961186
19 years, 9 months
[Clustering/JBoss] - Re: MDB fails to deploy when placed in deploy-hasingleton
by edungey
Here is the datasource definition we are using:
<datasources>
| <local-tx-datasource>
| <jndi-name>DefaultDS</jndi-name>
| <connection-url>jdbc:oracle:thin:@localhost:1521:orcl</connection-url>
| <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
| <user-name>tas</user-name>
| <password>tas</password>
|
| <!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->
|
| <!--valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name-->
| <!-- Checks the Oracle error codes and messages for fatal errors -->
| <exception-sorter-class-name>
| org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
| <new-connection-sql>select 1 from dual</new-connection-sql>
| <check-valid-connection-sql>select 1 from dual</check-valid-connection-sql>
| <track-statements>true</track-statements>
| <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
| <metadata>
| <type-mapping>Oracle9i</type-mapping>
| </metadata>
| <max-pool-size>30</max-pool-size>
| </local-tx-datasource>
|
| </datasources>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961181#3961181
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961181
19 years, 9 months
[JBoss Portal] - Re: Jboss Forum 2.2.1-SP3 Bug?
by johncena
I did re-install and re-deployment of Jboss-forum... Now I can view the Dummy Demo Cat > 2 Forums... I've tried editing the names and posted my first topic under one forum. It added successfully. But when I browsed port 8080 again and logging out as admin.. when clicked on the Forum nav link I got a blank page again.
Now i get these error messages....
12:11:46,203 WARN [JDBCExceptionReporter] SQL Error: 932, SQLState: 42000
12:11:46,204 ERROR [JDBCExceptionReporter] ORA-00932: inconsistent datatypes: expected - got CLOB
12:11:46,204 ERROR [ForumsPortlet] The portlet threw an exception
org.hibernate.exception.SQLGrammarException: could not initialize a collection: [org.jboss.portlet.forums.impl.PostImpl.attachments#6]
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.Loader.loadCollection(Loader.java:1926)
at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:36)
at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:541)
at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:60)
at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1705)
at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:344)
at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86)
at org.hibernate.collection.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:109)
at org.hibernate.collection.PersistentBag.size(PersistentBag.java:222)
at org.jboss.portlet.forums.ForumsPortlet.fillShowTopicContext(ForumsPortlet.java:5851)
at org.jboss.portlet.forums.ForumsPortlet.doView(ForumsPortlet.java:425)
at org.jboss.portlet.JBossPortlet.doDispatch(JBossPortlet.java:230)
at org.jboss.portlet.JBossPortlet.render(JBossPortlet.java:217)
at org.jboss.portlet.JBossPortlet.render(JBossPortlet.java:360)
at org.jboss.portal.portlet.PortletContainer.invokeRender(PortletContainer.java:521)
at org.jboss.portal.portlet.PortletContainer.dispatch(PortletContainer.java:433)
at org.jboss.portal.server.app.ComponentInvocation.dispatch(ComponentInvocation.java:79)
at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:140)
at org.jboss.portal.core.aspects.component.TransactionInterceptor.invoke(TransactionInterceptor.java:72)
at org.jboss.portal.server.app.ComponentInterceptor.invoke(ComponentInterceptor.java:38)
at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:130)
at org.jboss.portal.core.aspects.component.HeaderInterceptor.invoke(HeaderInterceptor.java:50)
at org.jboss.portal.server.app.ComponentInterceptor.invoke(ComponentInterceptor.java:38)
at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:130)
at org.jboss.portal.server.aspects.component.NavigationInterceptor.invoke(NavigationInterceptor.java:76)
at org.jboss.portal.server.app.ComponentInterceptor.invoke(ComponentInterceptor.java:38)
at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:130)
at org.jboss.portal.server.aspects.component.CacheInterceptor.invoke(CacheInterceptor.java:167)
at org.jboss.portal.server.app.ComponentInterceptor.invoke(ComponentInterceptor.java:38)
at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:130)
at org.jboss.portal.server.aspects.component.ModesInterceptor.invoke(ModesInterceptor.java:88)
at org.jboss.portal.server.app.ComponentInterceptor.invoke(ComponentInterceptor.java:38)
at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:130)
at org.jboss.portal.server.aspects.component.WindowStatesInterceptor.invoke(WindowStatesInterceptor.java:87)
at org.jboss.portal.server.app.ComponentInterceptor.invoke(ComponentInterceptor.java:38)
at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:130)
at org.jboss.portal.bridge.BridgeInterceptor.invoke(BridgeInterceptor.java:49)
at org.jboss.portal.server.app.ComponentInterceptor.invoke(ComponentInterceptor.java:38)
at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:130)
at org.jboss.portal.portlet.aspects.component.SessionPostDispatchInterceptor.invoke(SessionPostDispatchInterceptor.java:65)
How come? at first it was working fine... and now it doesn't? Is there something wrong with the configuration? is there a way to make it stable? .. on first timers point of view, what are the loopholes?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961179#3961179
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961179
19 years, 9 months
[JBoss Seam] - Re: @Redirect
by chane
Thanks!
I'll give your 1st option a shot tomorrow to see what I can come up with. I have not used the redirect filter explicetly before, so it'll be something new to learn about.
In the meantime below is something that I have been playing with. Basically I am adding a new interceptor. I believe I have acheived what I want for handling the exception and returning a navigation rule that is an error page. I have yet to use a FacesMessage on it; but I don't see why it shouldn't work.
I have not tested this extensively yet and would appreciate thoughts/concerns that anyone might see with my approach.
Thanks,
Chris....
The annotation I use on the BusinessException and as a marker on the SFSB:
| @Target(TYPE)
| @Retention(RUNTIME)
| @Interceptors(ExceptionInterceptor.class)
| public @interface Redisplay {
| String viewId() default "";
| }
|
The Interceptor I am using (for now I have named it the same as the Seam Interceptor - except it is in a different package). In fact I do most of the same stuff, except I had to add the rollback stuff which I grabbed from the SeamExceptionFilter.
I'm not sure if I need to add the SeamExceptionFilter.endWebRequestAfterException(request) functionality.
| @Around( { ConversationalInterceptor.class, RemoveInterceptor.class, BijectionInterceptor.class })
| public class ExceptionInterceptor{
|
| private static final Log log = LogFactory.getLog(ExceptionInterceptor.class);
|
| @AroundInvoke
| public Object handleExceptions(InvocationContext invocation) throws Exception{
| boolean outermost = invocation.getContextData().get("custom.outermost.ExceptionInterceptor") == null;
| invocation.getContextData().put("custom.outermost.ExceptionInterceptor", true);
| try {
| log.fatal("===== Execute Exception Handler ==========");
| return invocation.proceed();
| } catch(Exception e) {
| log.fatal("====== Process Exception =======");
|
| if(outermost && FacesContext.getCurrentInstance() != null) {
| if(e.getClass().isAnnotationPresent(Redisplay.class)) {
| rollbackTransactionIfNecessary();
| handled(e);
| return e.getClass().getAnnotation(Redisplay.class).viewId();
| }
| }
| throw e;
| }
| }
|
| private void rollbackTransactionIfNecessary(){
| try {
| if(Transactions.isTransactionActiveOrMarkedRollback()) {
| log.info("killing transaction");
| Transactions.getUserTransaction().rollback();
| }
| } catch(Exception te) {
| log.error("could not roll back transaction", te);
| }
| }
|
| private static void handled(Exception e){
| getRequest().put("org.jboss.seam.exceptionHandled", e);
| }
|
| private static Map getRequest(){
| return FacesContext.getCurrentInstance().getExternalContext()
| .getRequestMap();
| }
|
| }
|
|
Usage would be:
| @Name("editor")
| @Stateful
| @Redisplay
| public class Editor implements IEditor{
|
| public Fulfillment fulfill;
|
| @Begin
| public String save(){
| //persist logic //throws BusinessException
| return "save";
| }
| }
|
Simple exception class
| @Redisplay(viewId="exceptionErrorMessage")
| public class BusinessException extends RuntimeException{
| private static final long serialVersionUID = -4422447214761623238L;
|
| public BusinessException(){
| super("Generic Business Exception");
| }
|
| public BusinessException(String msg){
| super(msg);
| }
|
| }
|
simple navigation rule
| <navigation-rule>
| <navigation-case>
| <from-outcome>exceptionErrorMessage</from-outcome>
| <to-view-id>/error.xhtml</to-view-id>
| </navigation-case>
| </navigation-rule>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961178#3961178
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961178
19 years, 9 months
[Javassist user questions] - javassist can't work with jdk1.6
by drymartine
The class which I modified with javassist works normally under JDK 1.5, but it throws exception as below under JDK 1.6 beta2.
Caused by: java.lang.ClassFormatError: Illegal class modifiers in class test/MyClass: 0x621
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
4)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
4)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961176#3961176
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961176
19 years, 9 months