[Beginners Corner] - Parsing XML file out of jar
by dr_doom
Hello,
I am trying to parse a XML file out of my jar which is deployed in JBOSS_HOME/server/default/deploy. But when I load the file with
String path="DBConfig.xml";
| configFile=builder.build(new InputSource(path));
|
I always get the following exception:
anonymous wrote : 14:51:36,671 ERROR [STDERR] java.io.FileNotFoundException: C:\j2ee\jboss420\bin\DBConfig.xml
| 14:51:36,671 ERROR [STDERR] at org.jboss.net.protocol.file.FileURLConnection.connect(FileURLConnection.java:94)
| 14:51:36,671 ERROR [STDERR] at org.jboss.net.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:103)
| 14:51:36,671 ERROR [STDERR] at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
| 14:51:36,671 ERROR [STDERR] at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
| 14:51:36,671 ERROR [STDERR] at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
Here C:\j2ee\jboss420\ is my JBOSS_HOME directory.
Is there any way to load the file without using the classloader? For example a standard path in the jar file where such files can be stored? Or can I configure JBoss to search for the file in a specified directory?
Thanks for any help on this issue.
Best regards,
dr_doom
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4072338#4072338
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4072338
18 years, 9 months
[JBoss jBPM] - Re: hook the JBPM engine to JBOSS
by yairfr
1. thanks for the answer
2. i wrote a hook function :
| protected void hookFunc()
| {
| logger.debug("hookFunc::Start");
| conf = JbpmConfiguration.getInstance();
| context = conf.createJbpmContext();
| graphSession = context.getGraphSession();
| //context.close();
| logger.debug("hookFunc::End");
| }
|
it run ok , but both option : with context.close() or without it
resulted in an error when i tried to run continue or start a process .
without the close it gives this error :
| 09:49:19,039 INFO [STDOUT] 09:49:18,367 [Thread-25] DEBUG Log4JLogger : adding converter 'D', 'org.jbpm.context.exe.converter.DoubleToStringConverter'
| 09:49:19,164 INFO [STDOUT] 09:49:19,164 [Thread-25] DEBUG Log4JLogger : adding converter 'C', 'org.jbpm.context.exe.converter.CharacterToStringConverter'
| 09:49:19,179 INFO [STDOUT] 09:49:19,179 [Thread-25] DEBUG Log4JLogger : adding converter 'B', 'org.jbpm.context.exe.converter.BooleanToStringConverter'
| 09:49:19,179 INFO [STDOUT] 09:49:19,179 [Thread-25] DEBUG Log4JLogger : adding converter 'Y', 'org.jbpm.context.exe.converter.BytesToByteArrayConverter'
| 09:49:19,179 INFO [STDOUT] 09:49:19,179 [Thread-25] DEBUG Log4JLogger : adding converter 'A', 'org.jbpm.context.exe.converter.DateToLongConverter'
| 09:49:19,195 INFO [STDOUT] 09:49:19,195 [Thread-25] DEBUG Log4JLogger : adding converter 'R', 'org.jbpm.context.exe.converter.SerializableToByteArrayConverter'
| 09:49:19,211 INFO [STDOUT] 09:49:19,211 [Thread-25] DEBUG Log4JLogger : adding converter 'I', 'org.jbpm.context.exe.converter.IntegerToLongConverter'
| 09:49:19,211 INFO [STDOUT] 09:49:19,211 [Thread-25] DEBUG Log4JLogger : adding converter 'H', 'org.jbpm.context.exe.converter.ShortToLongConverter'
| 09:49:19,211 INFO [STDOUT] 09:49:19,211 [Thread-25] DEBUG Log4JLogger : adding converter 'G', 'org.jbpm.context.exe.converter.FloatToDoubleConverter'
| 09:49:19,226 INFO [STDOUT] 09:49:19,226 [Thread-25] DEBUG Log4JLogger : adding converter 'F', 'org.jbpm.context.exe.converter.FloatToStringConverter'
| 09:49:19,242 INFO [STDOUT] 09:49:19,226 [Thread-25] DEBUG Log4JLogger : adding converter 'E', 'org.jbpm.context.exe.converter.ByteToLongConverter'
| 09:49:19,273 INFO [STDOUT] 09:49:19,273 [Thread-25] DEBUG LogUtil : RequestsHandler:writeTasks():End
| 09:49:19,273 INFO [STDOUT] 09:49:19,273 [Thread-25] DEBUG Log4JLogger : executing default save operations
| 09:49:19,304 INFO [STDOUT] 09:49:19,273 [Thread-25] DEBUG Log4JLogger : saving process instance
| 09:49:19,320 INFO [STDOUT] 09:49:19,320 [Thread-25] DEBUG Log4JLogger : ignoring logs. no logging service available.
| 09:49:19,320 INFO [STDOUT] 09:49:19,320 [Thread-25] DEBUG Log4JLogger : cascading save of 'org.jbpm.graph.exe.ProcessInstance@1a22e94'
| 09:49:19,320 INFO [STDOUT] 09:49:19,320 [Thread-25] DEBUG Log4JLogger : closing JbpmContext
| 09:49:19,320 INFO [STDOUT] 09:49:19,320 [Thread-25] DEBUG Log4JLogger : closing service 'persistence': org.jbpm.persistence.db.DbPersistenceService@13beb64
| 09:49:19,320 INFO [STDOUT] 09:49:19,320 [Thread-25] DEBUG Log4JLogger : committing hibernate transaction
| 09:49:19,367 INFO [STDOUT] Hibernate: insert into JBPM_TASKINSTANCE (NAME_, DESCRIPTION_, ACTORID_, CREATE_, START_, END_, DUEDATE_, PRIORITY_, ISCANCELLED_, ISSUSPENDED_, ISOPEN_, ISSIGNALLING_, ISBLOCKING_, TASK_, TOKEN_, SWIMLANINSTANCE_, TASKMGMTINSTANCE_, CLASS_, ID_) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 'T', ?)
| 09:49:19,383 INFO [STDOUT] Hibernate: update JBPM_TASKINSTANCE set NAME_=?, DESCRIPTION_=?, ACTORID_=?, CREATE_=?, START_=?, END_=?, DUEDATE_=?, PRIORITY_=?, ISCANCELLED_=?, ISSUSPENDED_=?, ISOPEN_=?, ISSIGNALLING_=?, ISBLOCKING_=?, TASK_=?, TOKEN_=?, SWIMLANINSTANCE_=?, TASKMGMTINSTANCE_=? where ID_=?
| 09:49:19,398 INFO [STDOUT] Hibernate: update JBPM_TOKEN set VERSION_=?, NAME_=?, START_=?, END_=?, NODEENTER_=?, NEXTLOGINDEX_=?, ISABLETOREACTIVATEPARENT_=?, ISTERMINATIONIMPLICIT_=?, ISSUSPENDED_=?, NODE_=?, PROCESSINSTANCE_=?, PARENT_=?, SUBPROCESSINSTANCE_=? where ID_=? and VERSION_=?
| 09:49:19,398 INFO [STDOUT] Hibernate: update JBPM_TASKINSTANCE set NAME_=?, DESCRIPTION_=?, ACTORID_=?, CREATE_=?, START_=?, END_=?, DUEDATE_=?, PRIORITY_=?, ISCANCELLED_=?, ISSUSPENDED_=?, ISOPEN_=?, ISSIGNALLING_=?, ISBLOCKING_=?, TASK_=?, TOKEN_=?, SWIMLANINSTANCE_=?, TASKMGMTINSTANCE_=? where ID_=?
| 09:49:19,414 INFO [STDOUT] 09:49:19,398 [Thread-25] DEBUG BasicResourcePool : trace com.mchange.v2.resourcepool.BasicResourcePool@1ce4a29 [managed: 5, unused: 3, excluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection@650ddb)
| 09:49:19,414 INFO [STDOUT] 09:49:19,414 [Thread-25] DEBUG Log4JLogger : closing hibernate session
| 09:49:19,414 INFO [STDOUT] 09:49:19,414 [Thread-25] DEBUG LogUtil : RequestsHandler:continueProcess():End
| 09:49:23,117 INFO [STDOUT] 09:49:23,117 [Thread-24] DEBUG LogUtil : Read 1 records from TASKS table
| 09:49:49,695 ERROR [STDERR] Exception in thread "Thread-23"
| 09:49:49,695 ERROR [STDERR] java.lang.NullPointerException
| 09:49:49,695 ERROR [STDERR] at java.lang.Class.forName0(Native Method)
| 09:49:49,695 ERROR [STDERR] at java.lang.Class.forName(Unknown Source)
| 09:49:49,695 ERROR [STDERR] at com.mts.WorkFlow.ProvisionHandler.createProvisionObject(ProvisionHandler.java:78)
| 09:49:49,695 ERROR [STDERR] at com.mts.WorkFlow.ProvisionHandler.provision(ProvisionHandler.java:67)
| 09:49:49,695 ERROR [STDERR] at com.mts.WorkFlow.ProvisionHandler.handleRequest(ProvisionHandler.java:25)
| 09:49:49,695 ERROR [STDERR] at com.mts.WorkFlow.WorkerThread.run(WorkerThread.java:30)
|
do u have any idea why ?
i am preety sure it is somehow connected to the transaction.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4072336#4072336
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4072336
18 years, 9 months
TxConnectionManager issue
by Ákos Maróy
Hi,
While developing a web application on JBoss, I come to the following
issue at one point:
19:02:24,119 WARN [TxConnectionManager] Connection error occured:
org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@76bbe4cf[state=NORMAL
mc=org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@59d02cf0
handles=2 lastUse=1186592544082 permit=true trackByTx=true
mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@72366ea0
context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@539904f4
xaResource=org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@63145a0c
txSync=null]
and then, no database related stuff works any longer on that page, and I
get errors like:
java.sql.SQLException: No operations allowed after connection closed.
org.jboss.util.NestedSQLException: Could not enlist in transaction on
entering meta-aware object!; - nested throwable:
(java.lang.IllegalStateException: Can't enlist - already a tx!); -
nested throwable: (org.jboss.resource.JBossResourceException: Could not
enlist in transaction on entering meta-aware object!; - nested
throwable: (java.lang.IllegalStateException: Can't enlist - already a tx!))
It seems like some connection dropped / lost issue. I'm using MySQL as a
backend. The DS configuration is fairly simple:
<local-tx-datasource>
<jndi-name>seeDataSource</jndi-name>
<connection-url>jdbc:mysql://localhost:3306/Foo</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>foo</user-name>
<password>bar</password>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
<metadata>
<type-mapping>mySQL</type-mapping>
</metadata>
</local-tx-datasource>
What could be wrong?
Akos
18 years, 9 months