[EJB 3.0] - Re: JBoss 5 deployment error
by jaikiran
I hadn't tried reproducing this so far. Today i got this reproduced on JBoss-5.0 GA. The issue happens in the following scenario:
1) Your application is packaged as EAR
2) Your application has a jboss-app.xml with classloader configuration (does not matter whether it is java2ParentDelegation=false or java2ParentDelegation=true)
3) You have an EJB in which there is a @Resource injection happening for a application specific type (i.e. the class/interface belongs to your own application)
In this specific scenario, you see this ClassNotFoundException. This is a bug.
"jhsingle" wrote :
| There was one other bean with self-injection and I had changed that one also before my last post. Just to be sure, here's the code for WorkflowEngine with the self-injection removed:
I am sure there's definitely some other place where the @Resource injection of application specific class is happening. Are you sure you deployed the fresh files (cleanup existing ones from JBoss).
"jaikiran" wrote :
| The code which you posted, shows self-injection
|
Based on the test case that i have, this has got nothing to do with self-injection. Injecting resource of type myapp.A into myapp.B manifests this problem.
Possible workarounds:
1) Probably the easiest - Remove all @Resource injection of application specific classes
OR
2) Deploy the application as a standalone jar instead of EAR. The problem does not arise in a standalone jar
OR
3) Do not configure classloading through jboss-app.xml - You can leave that file empty or remove it. From what you posted, i see that you are not using this jboss-app.xml for anything else.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4200639#4200639
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4200639
17 years, 3 months
[JBoss Cache: Core Edition] - Re: Deadlock in JDBCCacheLoader
by gpklimek
Actually the 2 fqns' hashcodes do not map to the same shared lock.
Let's say that "/a/m" maps to lock X and "/l/p" maps to lock Y. But then "/a" maps to lock Y and "/l" maps to lock X.
JDBCCacheLoader when executing put() acquires at least two locks at a time. First it is lock for the fqn itself (this one is in exclusive mode) and then it tries to acquire lock for the fqn's parent when it calls exist().
Generally when you have a scenario where you attempt to acquire 2 locks you have two be sure that there is no concurrent scenario where the locks are acquired in reverse order. Otherwise you might experience a deadlock. Once it happens you will have rest of your locks in deadlock quickly.
I have to admit chances of this are small but I have experienced a production server going down because of this. Since the first deadlock happened the server was not responding to certain requests and then in the next 2 hours was not responding at all. The number of deadlocked threads was growing like a snow ball and eventually all of them were locked.
A solution I see for this issue would be to maintain one StripedLock instance per fqn size and review the code to make sure that whenever you acquire 2 locks you start from child and then go to parent (you also have to be careful about the exclusive mode).
Regards,
Grzegorz
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4200636#4200636
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4200636
17 years, 3 months
[Installation, Configuration & DEPLOYMENT] - Re: Problem while migrating from weblogic to Jboss
by sachin1506
Here my jboss.xml is
| <jboss>
| <enterprise-beans>
| <entity>
| <ejb-name>RaContactInfo</ejb-name>
| <entity-descriptor>
| <persistence>
| <persistence-use>
| <type-identifier>Jboss_CMP_JDBC</type-identifier>
| <type-version>6.0</type-version>
| <type-storage>META-INF/jbosscmp-jdbc.xml</type-storage>
| </persistence-use>
| </persistence>
| </entity-descriptor>
| <jndi-name>clh/ram/RaContactInfo</jndi-name>
| <local-jndi-name>clh/ram/RaContactInfoLocal</local-jndi-name>
| </entity>
| </enterprise-beans>
| </jboss>
|
My jbosscmp-jdbc.xml
| <?xml version="1.0" encoding="UTF-8"?>
|
| <!DOCTYPE jbosscmp-jdbc PUBLIC
| "-//JBoss//DTD JBOSSCMP-JDBC 4.0//EN"
| "http://www.jboss.org/j2ee/dtd/jbosscmp-jdbc_4_0.dtd">
|
|
|
| <!-- ===================================================================== -->
| <!-- -->
| <!-- Standard JBossCMP-JDBC Configuration -->
| <!-- -->
| <!-- ===================================================================== -->
|
| <!-- $Id: jbosscmp-jdbc.xml,v 1.17 2008/04/10 11:22:15 swgen Exp $ -->
|
| <jbosscmp-jdbc>
|
| <defaults>
| <datasource>java:/RAM_DS</datasource>
| <datasource-mapping>Oracle8</datasource-mapping>
|
| <create-table>false</create-table>
| <remove-table>false</remove-table>
| <read-only>false</read-only>
| <read-time-out>300</read-time-out>
| <pk-constraint>true</pk-constraint>
| <fk-constraint>false</fk-constraint>
| <row-locking>false</row-locking>
| <preferred-relation-mapping>foreign-key</preferred-relation-mapping>
| <read-ahead>
| <strategy>on-load</strategy>
| <page-size>1000</page-size>
| <eager-load-group>*</eager-load-group>
| </read-ahead>
| <list-cache-max>1000</list-cache-max>
| </defaults>
| <type-mapping>
| <name>Oracle8</name>
| <row-locking-template>SELECT ?1 FROM ?2 WHERE ?3 FOR UPDATE</row-locking-template>
| <pk-constraint-template>CONSTRAINT ?1 PRIMARY KEY (?2)</pk-constraint-template>
| <fk-constraint-template>ALTER TABLE ?1 ADD CONSTRAINT ?2 FOREIGN KEY (?3) REFERENCES ?4 (?5)</fk-constraint-template>
| <alias-header-prefix>t</alias-header-prefix>
| <alias-header-suffix>_</alias-header-suffix>
| <alias-max-length>30</alias-max-length>
| <subquery-supported>true</subquery-supported>
| <true-mapping>1</true-mapping>
| <false-mapping>0</false-mapping>
|
| <function-mapping>
| <function-name>concat</function-name>
| <function-sql>(?1 || ?2)</function-sql>
| </function-mapping>
| <function-mapping>
| <function-name>substring</function-name>
| <function-sql>substr(?1, ?2, ?3)</function-sql>
| </function-mapping>
| <function-mapping>
| <function-name>lcase</function-name>
| <function-sql>lower(?1)</function-sql>
| </function-mapping>
| <function-mapping>
| <function-name>length</function-name>
| <function-sql>length(?1)</function-sql>
| </function-mapping>
| <function-mapping>
| <function-name>locate</function-name>
| <function-sql>instr(?2, ?1, ?3)</function-sql>
| </function-mapping>
| <function-mapping>
| <function-name>abs</function-name>
| <function-sql>abs(?1)</function-sql>
| </function-mapping>
| <function-mapping>
| <function-name>sqrt</function-name>
| <function-sql>sqrt(?1)</function-sql>
| </function-mapping>
| <function-mapping>
| <function-name>ucase</function-name>
| <function-sql>upper(?1)</function-sql>
| </function-mapping>
|
| <mapping>
| <java-type>java.lang.Boolean</java-type>
| <jdbc-type>BIT</jdbc-type>
| <sql-type>NUMBER(1)</sql-type>
| </mapping>
| <mapping>
| <java-type>java.lang.Byte</java-type>
| <jdbc-type>NUMERIC</jdbc-type>
| <sql-type>NUMBER(3)</sql-type>
| </mapping>
| <mapping>
| <java-type>java.lang.Short</java-type>
| <jdbc-type>NUMERIC</jdbc-type>
| <sql-type>NUMBER(5)</sql-type>
| </mapping>
| <mapping>
| <java-type>java.lang.Integer</java-type>
| <jdbc-type>INTEGER</jdbc-type>
| <sql-type>NUMBER(10)</sql-type>
| </mapping>
| <mapping>
| <java-type>java.lang.Long</java-type>
| <jdbc-type>BIGINT</jdbc-type>
| <sql-type>NUMBER(19)</sql-type>
| </mapping>
| <mapping>
| <java-type>java.lang.Float</java-type>
| <jdbc-type>REAL</jdbc-type>
| <sql-type>NUMBER(38,7)</sql-type>
| </mapping>
| <mapping>
| <java-type>java.math.BigDecimal</java-type>
| <jdbc-type>DECIMAL</jdbc-type>
| <sql-type>NUMBER(38,15)</sql-type>
| <jdbc-type>DATE</jdbc-type>
| <sql-type>DATE</sql-type>
| </mapping>
| <mapping>
| <java-type>java.sql.Time</java-type>
| <jdbc-type>TIME</jdbc-type>
| <sql-type>DATE</sql-type>
| </mapping>
| <mapping>
| <!--
| | Note that you lose granularity here
| | Use a numeric type and store milliseconds if you really need it
| -->
| <java-type>java.sql.Timestamp</java-type>
| <jdbc-type>TIMESTAMP</jdbc-type>
| <sql-type>DATE</sql-type>
| </mapping>
| <mapping>
| <java-type>java.lang.Object</java-type>
| <jdbc-type>BLOB</jdbc-type>
| <sql-type>BLOB</sql-type>
| <!--
| | Change this from BLOB to RAW(n) if you know your
| | serialized object will be <= n bytes and n <= 2000
| -->
| </mapping>
| <enterprise-beans>
| <entity>
| <ejb-name>RaContactInfo</ejb-name>
| <table-name>RA_CONTACT_INFO</table-name>
| <cmp-field>
| <field-name>contactInfoId</field-name>
| <column-name>CONTACT_INFO_ID</column-name>
| </cmp-field>
|
| <cmp-field>
| <field-name>contactInfoName</field-name>
| <column-name>CONTACT_INFO_NAME</column-name>
| </cmp-field>
|
| <cmp-field>
| <field-name>roamingMngtAddrId</field-name>
| <column-name>ROAMING_MNGT_ADDR_ID</column-name>
| </cmp-field>
|
| <cmp-field>
| <field-name>interPmnInvoiceAddrId</field-name>
| <column-name>INTER_PMN_INVOICE_ADDR_ID</column-name>
| </cmp-field>
|
| <cmp-field>
| <field-name>custCareAddrId</field-name>
| <column-name>CUST_CARE_ADDR_ID</column-name>
| </cmp-field>
| <cmp-field>
| <field-name>mktAddrId</field-name>
| <column-name>MKT_ADDR_ID</column-name>
| </cmp-field>
| <cmp-field>
| <field-name>simAddrId</field-name>
| <column-name>SIM_ADDR_ID</column-name>
| <cmp-field>
| <cmp-field>
| <field-name>fraudMngtAddrId</field-name>
| </cmp-field>
| <cmp-field>
| <field-name>dataInterchangeAddrId</field-name>
| <column-name>DATA_INTERCHANGE_ADDR_ID</column-name>
| </cmp-field>
| <cmp-field>
| <field-name>pmnAddrId</field-name>
| <column-name>PMN_ADDR_ID</column-name>
| </cmp-field>
| <cmp-field>
| <field-name>tadigTestingAddrId</field-name>
| <column-name>TADIG_TESTING_ADDR_ID</column-name>
| </cmp-field>
| <cmp-field>
| <field-name>iregTestingAddrId</field-name>
| <column-name>IREG_TESTING_ADDR_ID</column-name>
| </cmp-field>
| <cmp-field>
| <field-name>mapSignallingAddrId</field-name>
| <column-name>MAP_SIGNALLING_ADDR_ID</column-name>
| </cmp-field>
| <cmp-field>
| <field-name>agreementMngt_AddrId</field-name>
| <column-name>AGREEMENT_MNGT__ADDR_ID</column-name>
| </cmp-field>
| <cmp-field>
| <field-name>status</field-name>
| <column-name>STATUS</column-name>
| </cmp-field>
| <cmp-field>
| <field-name>remarks</field-name>
| <column-name>REMARKS</column-name>
| </cmp-field>
| <cmp-field>
| <field-name>internationalRoamingAddrId</field-name>
| <column-name>INTERNATIONAL_ROAMING_ADDR_ID</column-name>
| </cmp-field>
| </cmp-field>
|
| </entity>
| </enterprise-beans>
| </jbosscmp-jdbc>
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4200623#4200623
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4200623
17 years, 3 months
[JBoss jBPM] - Hibernate and log4j
by glnd
I'm currently struggling a little bit with the combination of hibernate and logging in the jbp-jpd-3.2.3 suite. I'm not really familiar with log4j and all I want to do is to log the DML statements (but also nothing more or less then that).
I haven't touched the logging setting in hibernate.cfg.xml because I'm pretty sure they are just fine , but I include them just for completeness.
<!-- logging properties (begin) ===
| <property name="hibernate.show_sql">true</property>
| <property name="hibernate.format_sql">true</property>
| <property name="hibernate.use_sql_comments">true</property>
| ==== logging properties (end) -->
To adapt log4j I've copied the log4j.xml file from the folder: jbpm-jpdl-3.2.3\deploy to jbpm-jpdl-3.2.3\server\server\jbpm\conf and renamed it to jboss-log4j.xml.
I also changed the file a little bit according to my requirements, But the logger still shows me the wrong information --> the transaction info is still shown and on the other hand it misses the binding parameters information.
Can some help me to configure log4j? Thanks.
jboss-log4j.xml
<?xml version="1.0" encoding="UTF-8"?>
| <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
|
| <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
|
| <!-- Usage: replace the log4j.xml file in the conf directory of your jboss server
| configuration with this file
| Contents: This configuration file will log only to standard output and it will
| put the jBPM logs to level TRACE.
| -->
|
| <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
| <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
| <param name="Target" value="System.out"/>
| <param name="Threshold" value="TRACE"/>
| <layout class="org.apache.log4j.PatternLayout">
| <!-- The default pattern: Date Priority [Category] Message\n -->
| <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
| </layout>
| </appender>
|
| <!--
| <category name="org.jbpm"><priority value="INFO"/></category>
| -->
|
| <category name="org.apache"><priority value="INFO"/></category>
| <category name="org.apache.myfaces"><priority value="TRACE"/></category>
| <category name="org.jboss"><priority value="INFO"/></category>
| <category name="org.hibernate"><priority value="INFO"/></category>
| <category name="org.hibernate.SQL"><priority value="DEBUG"/></category>
| <category name="org.hibernate.transaction"><priority value="INFO"/></category>
| <category name="org.hibernate.type"><priority value="DEBUG"/></category>
| <category name="net.sf"><priority value="INFO"/></category>
|
| <root>
| <appender-ref ref="CONSOLE"/>
| </root>
|
| </log4j:configuration>
Log snapshot:
.JDBCTransaction@1dd040a
| 16:14:10,801 DEBUG [DbPersistenceService] closing hibernate session
| 16:14:10,801 DEBUG [Services] closing service 'tx': org.jbpm.tx.TxService@f60f20
| 16:14:10,801 DEBUG [JobExecutorThread] obtained lock on jobs: []
| 16:14:10,801 DEBUG [JbpmContextInfo] creating jbpm context with service factories '[message, tx, sc
| eduler, authentication, persistence, logging]'
| 16:14:10,801 DEBUG [JbpmContext] creating org.jbpm.JbpmContext@5b38d6
| 16:14:10,817 DEBUG [DbPersistenceServiceFactory] creating persistence service
| 16:14:10,817 DEBUG [DbPersistenceService] creating hibernate session
| 16:14:10,817 DEBUG [DbPersistenceService] beginning hibernate transaction
| 16:14:10,817 DEBUG [DbPersistenceService] begun hibernate transaction org.hibernate.transaction.JDB
| Transaction@179d47f
| 16:14:10,817 DEBUG [SQL] select * from ( select job0_.ID_ as ID1_26_, job0_.VERSION_ as VERSION3_26
| , job0_.DUEDATE_ as DUEDATE4_26_, job0_.PROCESSINSTANCE_ as PROCESSI5_26_, job0_.TOKEN_ as TOKEN6_2
| _, job0_.TASKINSTANCE_ as TASKINST7_26_, job0_.ISSUSPENDED_ as ISSUSPEN8_26_, job0_.ISEXCLUSIVE_ as
| ISEXCLUS9_26_, job0_.LOCKOWNER_ as LOCKOWNER10_26_, job0_.LOCKTIME_ as LOCKTIME11_26_, job0_.EXCEPT
| ON_ as EXCEPTION12_26_, job0_.RETRIES_ as RETRIES13_26_, job0_.NAME_ as NAME14_26_, job0_.REPEAT_ a
| REPEAT15_26_, job0_.TRANSITIONNAME_ as TRANSIT16_26_, job0_.ACTION_ as ACTION17_26_, job0_.GRAPHEL
| MENTTYPE_ as GRAPHEL18_26_, job0_.GRAPHELEMENT_ as GRAPHEL19_26_, job0_.NODE_ as NODE20_26_, job0_.
| LASS_ as CLASS2_26_ from JBPM_JOB job0_ where (job0_.LOCKOWNER_ is null or job0_.LOCKOWNER_=?) and
| ob0_.RETRIES_>0 and job0_.ISSUSPENDED_<>1 order by job0_.DUEDATE_ asc ) where rownum <= ?
| 16:14:10,817 DEBUG [JbpmContext] closing jbpmContext org.jbpm.JbpmContext@5b38d6
| 16:14:10,817 DEBUG [Services] closing service 'persistence': org.jbpm.persistence.db.DbPersistenceS
| rvice@56291a
| 16:14:10,817 DEBUG [DbPersistenceService] committing hibernate transaction org.hibernate.transactio
| .JDBCTransaction@179d47f
| 16:14:10,817 DEBUG [DbPersistenceService] closing hibernate session
| 16:14:10,817 DEBUG [Services] closing service 'tx': org.jbpm.tx.TxService@a4911d
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4200619#4200619
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4200619
17 years, 3 months