[JBoss Messaging] - Problem if messaging client deployed within same VM
by alllle
I have been struggling with deploying JBoss Messaging 1.0.1SP2 for a couple of days and got no luck. Please help.
What I need is to be able to send/receive messages in my EJB3 that is deployed in the same JBoss server as the JBoss Messaging.
I followed the instruction on the user manual for the installation, the example/queue runs okay. However, example/stateless fails with ClassNotFoundException for the org.jboss.jms.destination.JBossQueue class. I assume it is because the messaging is scoped and therefore, the example EJB "StatelessSessionExample" can't find the messaging classes.
I thought of two ways to deal with it:
1. put the jboss-messaging-client.jar to the server's lib directory so it is available to all apps.
2. Include the jboss-messaging-client.jar in the application I am deploying, in this case, the example stateless EJB.
And both approaches gave me this error:
| javax.jms.InvalidDestinationException: Not a JBossDestination:JBossQueue[testQueue]
Apparently, due to the scoped deployment of the messaging, when I try to access the queue from inside the same JBoss AS, it uses two different loaders to load the same JBossQueue class (packaged in different jar files, one from messaging, one from client jar), and therefore, thinks that they are different class types.
I am actually surprised that I could not find any existing post that discusses this problem. Did I missed something very basic?
As a side note, I could not package the jboss-messaging-client.jar in my application's EAR. It caused weird deployment problems due to class conflicts. I got some attribute setting error and my datasource would not deploy. The grand jboss-messaging-client.jar contains so many packages/classes that are already exist in the JBoss AS server and it is impossible to isolate which one is actually causing the error.
one is causing the problem.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4005540#4005540
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4005540
19 years, 3 months
[JBoss jBPM] - Unable to insert new process definitions.
by mihochan
I am trying to insert process definitions into a MySQL database from a stand-alone application.
The process definitions are good as they install from JBoss. The problem seems to be with the persistence configuration but I can't see what is going wrong.
I can also contact the database to retrieve process definitions.
| org.jbpm.JbpmException: problem closing services {persistence=org.jbpm.persistence.JbpmPersistenceException: couldn't commit hibernate session}
| [java] at org.jbpm.svc.Services.close(Services.java:223)
| [java] at org.jbpm.JbpmContext.close(JbpmContext.java:139)
| ....
| Caused by: org.jbpm.persistence.JbpmPersistenceException: couldn't commit hibernate session
| [java] at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:172)
| [java] at org.jbpm.svc.Services.close(Services.java:211)
| [java] ... 22 more
| [java] Caused by: org.hibernate.exception.DataException: could not insert: [org.jbpm.graph.node.StartState]
| [java] at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:77)
| [java]
| ...
| Caused by: java.sql.SQLException: Data too long for column 'ISASYNC_' at row 1
| [java] at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2847)
| [java] at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1531)
| [java] at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1622)
| [java] at com.mysql.jdbc.Connection.execSQL(Connection.java:2376)
| [java] at com.mysql.jdbc.Connection.execSQL(Connection.java:2297)
| [java] at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1860)
| [java] at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1957)
| [java] at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1880)
| [java] at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1741)
| [java] at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:73)
| [java] at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:33)
| [java] ... 53 more
|
The jbpm.cfg.xml file;
| <jbpm-configuration>
| <jbpm-context>
| <service name='persistence' factory='org.jbpm.persistence.db.DbPersistenceServiceFactory' />
| </jbpm-context>
| <string name="resource.hibernate.cfg.xml" value="jbpm-hibernate.xml" />
| </jbpm-configuration>
|
and the referenced hibernate config file;
| <hibernate-configuration>
|
| <session-factory>
|
| <!-- jdbc connection properties -->
|
| <property name="hibernate.cache.use_second_level_cache">false</property>
| <property name="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</property>
|
| <!-- connection settings for stand-alone application -->
| <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
| <!-- <property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property> -->
| <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
| <property name="hibernate.connection.url">jdbc:mysql://localhost/jbpmtest</property>
| <property name="hibernate.connection.username">jbpmuser</property>
| <property name="hibernate.connection.password">password</property>
| <property name="hibernate.connection.pool_size">3</property>
|
|
| <!-- other hibernate properties -->
| <property name="hibernate.show_sql">false</property>
| <property name="hibernate.format_sql">true</property>
| <property name="hibernate.use_sql_comments">true</property>
|
| <!-- Enable Hibernate's automatic session context management -->
| <property name="current_session_context_class">thread</property>
|
Any help would be greatly appreciated. Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4005539#4005539
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4005539
19 years, 3 months
[EJB 3.0] - Re: RuntimeExceptions caught, wrapped in EJBException
by ALRubinger
I've made a little Interceptor to do the trick here, but when configuring, I'm unsure how to signal to AOP that I'd like to intercept "all client calls to the service methods", not "all calls to service methods, including internal ones when a service method calls another".
I've currently configured ejb3-interceptors-aop.xml with the following:
<interceptor class="my.UncaughtExceptionInterceptor " scope="PER_VM"/>
and in each domain:
<interceptor-ref name="my.UncaughtExceptionInterceptor"/>
under:
<bind pointcut="execution(public * *->*(..))">
What should I denote as my pointcut?...I do still need to be able to throw all checked exceptions, and I'd only like to catch UNCHECKED exceptions invoked by the client.
Perhaps in the "catch" block of my advice I'd be best to do some:
if(t instanceof EJBException)
...nonsense. Anyone with better suggestions?
package my.interceptor;
|
| import org.apache.commons.logging.Log;
| import org.apache.commons.logging.LogFactory;
| import org.jboss.aop.advice.Interceptor;
| import org.jboss.aop.joinpoint.Invocation;
|
| import my.ServiceException;
|
| /**
| * Ensures that all unchecked exceptions caught and rethrown as an EJBException
| * are logged on the server side
| *
| * @author ALR
| *
| */
| public class UncaughtExceptionInterceptor implements Interceptor {
|
| // Class Members
| private static final Log logger = LogFactory
| .getLog(UncaughtExceptionInterceptor.class);
|
| public String getName() {
| return this.getClass().getName();
| }
|
| /**
| * Carries out the invocation as normal, catching any resulting exceptions
| * thrown from the container and ensuring that they're logged properly
| * before being rethrown to the client
| */
| public Object invoke(Invocation invocation) throws Exception {
|
| try {
| logger
| .trace(this.getClass().getName()
| + " intercepted invocation.");
| return invocation.invokeNext();
| } catch (Throwable t) {
| String errorMessage = "Uncaught exception found in Services invocation to "
| + invocation.getTargetObject()
| + "."
| + invocation.toString();
| logger.warn(errorMessage);
| throw new ServiceException(errorMessage, t);
| }
|
| }
|
| }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4005531#4005531
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4005531
19 years, 3 months
[JBoss Portal] - Security-constraint being ignored
by rsliotta
Good Evening.
environment:
JBoss Portal Version 2.4SP1 downloaded
JBoss AS Version 4.0.4GA
Database is Postgres 8.0.4
I am running on Windows
Describe the problem:
I am trying to add page level security to a page. It I configure it as unchecked and look in the management portal, it shows as unchecked. If I set a role, the whole constraint is ignored.
If I go in into the management portlet and configure the constraints, it works perfectly. I am however trying to configure a deployment and want to configure it with the WAR.
Here is my *-object.xml
<?xml version="1.0" encoding="UTF-8"?>
<instance-id>KNAvayaInstance</instance-id>
<portlet-ref>AvayaPortlet</portlet-ref>
<if-exists>overwrite</if-exists>
<parent-ref>default</parent-ref>
<page-name>AvayaPortletPage</page-name>
<window-name>AvayaTestWindow</window-name>
<instance-ref>KNAvayaInstance</instance-ref>
center
0
<security-constraint>
<policy-permission>
avaya
<action-name>view</action-name>
</policy-permission>
</security-constraint>
I have confirmed that the role exists in the database. I have tried view and viewrecursive with the same result. I am guessing I missed something rudimentary. There are no constraints on the instance as you can see.
This is the portlet snippet from the portlet.xml
<portlet-name>AvayaPortlet</portlet-name>
Portlet to test Avaya
<portlet-class>org.pentaho.ui.portlet.NavigationPortlet</portlet-class>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
<portlet-info>
%AvayaReports
</portlet-info>
<portlet-preferences>
solution
kn
path
customers/avaya
xsl
portal-files.xsl
secure
true
</portlet-preferences>
Can anyone shed some light on this.
Thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4005528#4005528
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4005528
19 years, 3 months