[Persistence, JBoss/CMP, Hibernate, Database] - Re: .How can i change default databse Hypersonic to Mysql
by vas_srinuin
Steps to changing default Database Hypersonic to Mysql Database in Jboss
1.Download and set to the classpath the mysql driver (mysql-connector-java-5.0.4-bin.jar),
then copy this to [jboss-location]/server/default/lib directory.
2.Copty file named mysql-ds.xml([jboss-location]/ docs/examples/jca/) into the
[jboss-location]/server/default/deploy/ directory and edit IP Address,Driver Name,url ?.
<local-tx-datasource>
<jndi-name>MySqlDS</jndi-name>
<connection-url>jdbc:mysql://127.0.0.1:3306/test</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>root</user-name>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
<!-- sql to call when connection is created
<new-connection-sql>some arbitrary sql</new-connection-sql>
-->
<!-- sql to call on an existing pooled connection when it is obtained from pool
<check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
-->
<!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
<type-mapping>mySQL</type-mapping>
</local-tx-datasource>
The important lines are the bolded ones, one is for the url used for connecting to the mysql server; if you didn't change the port it listens to, leave 3306. 'localhost' is the host where the mysql server is running, if is something other than this, change it to the ip to reflect it corectly. After the slash there's the name of the datatbase the driver would connect to by default (in my case, "OPA").
The <user-name> element is obviously for specifying the user name that should be used when trying to connect to the mysql server, and the element is for its corresponding password. Make sure u've created the user before testing the connection and have assigned that user with the rights for your above mentioned database. (see mysql manual for these operations :) )
3. copy the mysql-jdbc2-service.xml ([JbossLocation]\docs\examples\jms\mysql-jdbc2-service.xml) into D:/[JbossLocation]/server/default/deploy/jms/ and change the name (line no 58)DefaultDS to MySqlDS
4.copy the mysql-jdbc-state-service.xml into [JbossLocation]/server/default/deploy/jms/
and change the name(line no 15) DefaultDS to MySqlDS
note:if u did?t found the mysql-jdbc-state-service.xml go to [JbossLocation]/server/default/deploy/jms/ and reaname the hsqldb-jdbc-state-service.xml to the mysql-jdbc-state-service.xml
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4041768#4041768
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4041768
17 years, 8 months
[JBoss Seam] - Re: unable to access application scoped component in @Timeou
by liudan2005
I get IllegalStateException when I try to call an @Asynchronous annotated method in my @Create annotated method when app is started.
| ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/]] Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener
| rg.jboss.seam.core.dispatcherjava.lang.IllegalStateException: org.jboss.seam.core.dispatcher is not installed in components.xml
| java.lang.IllegalStateException: org.jboss.seam.core.dispatcher is not installed in components.xml
| at org.jboss.seam.interceptors.AsynchronousInterceptor.aroundInvoke(AsynchronousInterceptor.java:29)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
| at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:103)
| at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:50)
| at org.javassist.tmp.java.lang.Object_$$_javassist_55.scheduleTimer(Object_$$_javassist_55.java)
| at com.example.admin.auto.RunOnStartup.init(RunOnStartup.java:45)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:20)
| at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:57)
| at org.jboss.seam.interceptors.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:34)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
| at org.jboss.seam.interceptors.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:47)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
| at org.jboss.seam.interceptors.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:27)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
| at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:103)
| at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:151)
| at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:87)
| at com.example.admin.auto.RunOnStartup_$$_javassist_54.init(RunOnStartup_$$_javassist_54.java)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:20)
| at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:123)
| at org.jboss.seam.Component.callComponentMethod(Component.java:1834)
| at org.jboss.seam.Component.callCreateMethod(Component.java:1757)
| at org.jboss.seam.Component.newInstance(Component.java:1746)
| at org.jboss.seam.contexts.Lifecycle.startup(Lifecycle.java:175)
|
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4041764#4041764
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4041764
17 years, 8 months
[JBoss jBPM] - Possible bug in conditions?
by ejbpm
We are (newbies) using 3.2 GA release of jBPM jdpl. We?ve found a strange behaviour using conditions in our process definitions. We have read previously posted topics regarding conditions but we didn?t find anything similar like this. Reading a processdefintion from file is completely ok, the conditions are used correctly in our process flow. But when we are reading the process definition from the database (exactly the same process definition as the file) the conditions are not used at all.
The attribute nodes (list of nodes) contain all nodes with all conditions in both cases.
This is what we found?
When using a process definition from file (using ProcessDefinition.parseXmlInputStream(s) ) the process definition contains a transient attribute nodesMap, but when we are using a process definition from the jbpm database (using graphSession.findLatestProcessDefinition(processName) ) the nodesMap is null.
When debugging these two different ways the only difference we?ve found is the nodesMap attribute. We have tried all methods to get process definitions from the database and all methods gives us same result (nodesMap = null). Is nodesMap used together with conditions? Is it a bug?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4041763#4041763
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4041763
17 years, 8 months