[Persistence, JBoss/CMP, Hibernate, Database] - PostgreSQL Database pool connection problem
by ANDRIA-NTOANINA
Hello!
I'm using a postgreSQL v8.0 running in an other server.
I'v set a value of 10 as a min pool in my postgre-ds.xml.
Then, running ManageEngine Application Manager 7.
AppManager show 0 pooled connection for my database but 5 for DefaultDS : Hypersonic Database.
Here's a portion of postgre-ds.xml
| <min-pool-size>5</min-pool-size>
| <max-pool-size>150</max-pool-size>
| <idle-timeout-minutes>20</idle-timeout-minutes>
| <!-- sql to call when connection is created-->
| <new-connection-sql>SELECT 1</new-connection-sql>
|
|
| <!-- sql to call on an existing pooled connection when it is obtained from pool
| -->
| <check-valid-connection-sql>SELECT 1</check-valid-connection-sql>
|
| <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
| <metadata>
|
My question is : Do JBoss creating the minimal pool when starting JBoss?
Or maybe I'v a wrong setting in my XML?
The problem : a first launch of my CMP Bean always fail. Throwing the next error:
| 09:06:37,687 WARN [TransactionImpl] XAException: tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=Herimiaina/67, BranchQual=, localId=67] errorCode=XA_UNKNOWN(0)
| org.jboss.resource.connectionmanager.JBossLocalXAException: Error trying to start local tx: ; - nested throwable: (org.jboss.resource.JBossResourceException: SQLException; - nested throwable: (java.sql.SQLException: ERROR: SET AUTOCOMMIT TO OFF is no longer supported
| ))
| at org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource.start(TxConnectionManager.java:901)
| at org.jboss.tm.TransactionImpl$Resource.startResource(TransactionImpl.java:2043)
| at org.jboss.tm.TransactionImpl.enlistResource(TransactionImpl.java:563)
|
But reruning the bean immediatly success.
I'v trying it using BMP now. When getting the connection in setContext()
, I got the same problem. To solve it, I loop my code 4 time until I get a valid connection. And this work but add a heavy load to JBoss.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3989167#3989167
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3989167
19Â years, 5Â months
[JBoss Seam] - Re: Error when using ajax and facelets
by ama55
Here is the build.xml
| <?xml version="1.0"?>
| <project name="Phone Directory" default="deploy" basedir=".">
| <!-- Allow this to be overriden by others importing this project. -->
| <dirname property="imported.basedir" file="${ant.file.Seam}" />
| <!-- Give user a chance to override without editing this file or typing -D -->
| <property file="${imported.basedir}/build.properties" />
| <!-- Name of project and version, used to create filenames -->
| <property name="Name" value="SeamApplication" />
| <property name="name" value="seamapp" />
| <!-- set global properties for this build -->
| <property name="build.dir" value="build" />
| <property name="classes.dir" value="${build.dir}/classes" />
| <property name="src.java.dir" value="src" />
| <property name="lib.dir" value="lib" />
| <property name="deploy.dir" value="${jboss.home}/server/default/deploy" />
| <property name="javac.debug" value="true" />
| <property name="javac.deprecation" value="false" />
| <!-- WAR -->
| <zipfileset id="war.docroot" dir="resources/jsp">
| <include name="**/*" />
| </zipfileset>
| <zipfileset id="war.webinf" prefix="WEB-INF" dir="resources/WEB-INF">
| <patternset refid="meta.files" />
| </zipfileset>
| <zipfileset id="war.webinf.lib" prefix="WEB-INF/lib" dir="resources/WEB-INF/lib">
| <include name="*.jar" />
| </zipfileset>
| <!-- EJB3 -->
| <fileset id="ejb3.root" dir="resources">
| <include name="import.sql" />
| <include name="seam.properties" />
| <include name="META-INF/persistence.xml" />
| </fileset>
| <fileset id="ejb3.lib" dir="lib">
| <include name="jboss-seam.jar" />
| </fileset>
| <!-- EAR -->
| <zipfileset id="ear.resources" prefix="META-INF" dir="resources/META-INF">
| <include name="*" />
| <exclude name="persistence.xml" />
| </zipfileset>
| <!-- Deploy -->
| <fileset id="deploy" dir="resources">
| <include name="_NONE_" />
| </fileset>
| <!-- Undeploy -->
| <patternset id="undeploy">
| <include name="_NONE_" />
| </patternset>
| <path id="build.classpath">
| <fileset dir="${lib.dir}">
| <include name="**/*.jar" />
| </fileset>
| </path>
| <patternset id="meta.files">
| <include name="**/*.dtd" />
| <include name="**/*.xml" />
| <include name="**/*.xslt" />
| <include name="**/*.properties" />
| </patternset>
| <patternset id="src.files">
| <!-- include everything we want in the src directory
| that we didn't want in the jar itself -->
| <include name="**/*.java" />
| </patternset>
| <target name="clean" description="Cleans up the build directory">
| <delete dir="${build.dir}" />
| </target>
| <target name="init" description="Initialize the build">
| <echo message="Build ${Name}" />
| <mkdir dir="${classes.dir}" />
| <copy todir="${classes.dir}">
| <fileset dir="${src.java.dir}">
| <patternset refid="meta.files" />
| </fileset>
| </copy>
| </target>
| <target name="compile" depends="init" description="Compile the Java source code">
| <javac destdir="${classes.dir}" classpathref="build.classpath" debug="${javac.debug}" deprecation="${javac.deprecation}" nowarn="on">
| <src path="${src.java.dir}" />
| </javac>
| </target>
| <target name="war" depends="compile">
| <jar destfile="${build.dir}/${name}.war">
| <zipfileset refid="war.docroot" />
| <zipfileset refid="war.webinf" />
| <zipfileset refid="war.webinf.lib" />
| </jar>
| </target>
| <target name="ejb3" depends="compile">
| <jar jarfile="${build.dir}/${name}.ejb3">
| <fileset dir="${imported.basedir}">
| <include name="${name}.jar" />
| </fileset>
| <fileset dir="${classes.dir}">
| <include name="**/*.class" />
| <exclude name="**/test/*.class" />
| </fileset>
| <fileset refid="ejb3.root" />
| <fileset refid="ejb3.lib" />
| </jar>
| </target>
| <target name="ear" depends="ejb3, war">
| <jar destfile="${build.dir}/${name}.ear">
| <zipfileset dir="${build.dir}">
| <include name="${name}.ejb3" />
| </zipfileset>
| <zipfileset dir="${build.dir}">
| <include name="${name}.war" />
| </zipfileset>
| <zipfileset refid="ear.resources" />
| </jar>
| </target>
| <target name="deploy" depends="ear">
| <property name="unit.ext" value="ear" />
| <fail unless="jboss.home">jboss.home MUST be set. Update build.properties to point to a valid JBoss installation.</fail>
| <copy todir="${deploy.dir}">
| <fileset refid="deploy" />
| </copy>
| <copy file="${build.dir}/${name}.${unit.ext}" todir="${deploy.dir}" />
| </target>
| <target name="undeploy">
| <property name="unit.ext" value="ear" />
| <delete file="${deploy.dir}/${name}.${unit.ext}" />
| <delete>
| <fileset dir="${deploy.dir}">
| <patternset refid="undeploy" />
| </fileset>
| </delete>
| </target>
| <target name="cleandb">
| <delete dir="${deploy.dir}/../data/hypersonic" />
| </target>
| </project>
|
and here is the application.xml file:
| <?xml version="1.0" encoding="utf-8"?>
| <application>
| <display-name>SeamApplication</display-name>
| <module>
| <web>
| <web-uri>seamapp.war</web-uri>
| <context-root>/seamapp</context-root>
| </web>
| </module>
| <module>
| <ejb>seamapp.ejb3</ejb>
| </module>
| </application>
|
Best Regards
ama55
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3989166#3989166
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3989166
19Â years, 5Â months
[JBoss jBPM] - Re: Waiting for external input
by dslevine
You would not need to send any input to a node, but rather you would need to send the input to a specific process instance which is waiting for that input on a node. So the external system needs to know the id or the instance that is waiting. (Or any qualifier that would find one or more processes, i.e. any process where Company Name = 'Dutch Beer Co'.)
If you were going to send a message out to the external system informing it that your workflow is ready for some input, you could pass some kind of instance ID in the message and have the external system send it back with their input. Your processing logic then becomes something like
1. parse id
2. get instance
3. parse input
4. signal instance with input
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3989157#3989157
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3989157
19Â years, 5Â months
[JBoss Seam] - Re: ICEfaces
by stan.silvertï¼ jboss.com
"TedGoddard" wrote : So, is it generally a bad idea to return anything but primitive types from EJBs?
No, you shouldn't be limited to primatives. That would be very ugly. This can be solved, but it's not simple.
"TedGoddard" wrote : Is there a simple way to configure the .ear so that the ClassLoaders are common?
In JBoss there is a server-wide setting that will take care of it. Look in deploy\jbossweb-tomcat55.sar\META-INF\jboss-service.xml
set UseJBossWebLoader=true
Have you considered putting these jars into the root of the .ear and leaving them out of the .war? You can add these to the classpath in the .ear's manifest.mf file. That way, the classes are found by the same classloader when they are referred to in both the EJB and the WAR.
Another trick is to refer to these root-level jars inside tags in the application.xml. There is some debate over which is the best/most portable way to do it.
I think this is solved in JEE5. If I'm not mistaken, they add something akin to the WEB-INF/lib directory for .ear files.
Stan
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3989149#3989149
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3989149
19Â years, 5Â months