[Javassist] - Using personnal type : no such class
by Jérémie Salvucci
Jérémie Salvucci [http://community.jboss.org/people/vanished_man] created the discussion
"Using personnal type : no such class"
To view the discussion, visit: http://community.jboss.org/message/569925#569925
--------------------------------------------------------------
Hello all,
I'm trying to use javassist to create a new class at the execution.
I have a class named TranslatorConstructor and this one should create a class Translator. This class is composed of a field. This field is of IBinaryOutputFile type (personnal one). So when I get ClassPool thanks to ClassPool.getDefault, I do pool.importPackage with my own package "tools.IBinaryOutputFile". The problem is that doesn't work... Even if I use a class BinaryOutputFile and not an interface...
I'm using eclipse and I configure my project with javassist as an external jar. I'm wondering if it was a good idea because I don't know how javassist does to find my class...
public TranslatorConstructor (String className) {
ClassPool pool = ClassPool.getDefault();
pool.importPackage("tools.interfaces.IBinaryOutputFile");
pool.importPackage("tools.BinaryOutputFile");
clazz = pool.makeClass(className);
}
public void init () throws CannotCompileException {
String fieldName = "private IBinaryOuputFile binaryFile;";
CtField field = CtField.make(fieldName, clazz);
clazz.addField(field);
When I create the field, an exception occured...
clazz is a class field a TranslatorConstructor affected in the constructor with makeClass.
If anyone has an idea about why it doesn't work, it would be great.
Thank you !
--
VanishedMan
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/569925#569925]
Start a new discussion in Javassist at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 5 months
[jBPM] - Problem installing jbpm-installer-3.2.7
by Odelya Holiday
Odelya Holiday [http://community.jboss.org/people/odelyaholiday] created the discussion
"Problem installing jbpm-installer-3.2.7"
To view the discussion, visit: http://community.jboss.org/message/569980#569980
--------------------------------------------------------------
Hi!
I downloaded the installer.
It installed levels 1,2,3 but level 4: download jbpm did not succeed and I got the message:
[get] Error getting http://downloads.sourceforge.net/jboss/jboss-5.0.1.GA http://downloads.sourceforge.net/jboss/jboss-5.0.1.GA.
zip to C:\Program Files\jbpm\opt\jboss-5.0.1.GA.zip
com.izforge.izpack.installer.InstallerException: The following error occurred wh
ile executing this line:
C:\Program Files\jbpm\uninstall\download-helper.xml:9: java.io.FileNotFoundExcep
tion: C:\Program Files\jbpm\opt\jboss-5.0.1.GA.zip (The system cannot find the p
ath specified)
at com.izforge.izpack.event.AntActionInstallerListener.performAllActions
(Unknown Source)
at com.izforge.izpack.event.AntActionInstallerListener.afterPack(Unknown
Source)
at com.izforge.izpack.installer.UnpackerBase.informListeners(Unknown Sou
rce)
at com.izforge.izpack.installer.Unpacker.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)
Caused by: The following error occurred while executing this line:
C:\Program Files\jbpm\uninstall\download-helper.xml:9: java.io.FileNotFoundExcep
tion: C:\Program Files\jbpm\opt\jboss-5.0.1.GA.zip (The system cannot find the p
ath specified)
at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(Projec
tHelper.java:541)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:418)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
a:105)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
at com.izforge.izpack.event.AntAction.performAction(Unknown Source)
at com.izforge.izpack.event.AntAction.performInstallAction(Unknown Sourc
e)
... 5 more
Caused by: C:\Program Files\jbpm\uninstall\download-helper.xml:9: java.io.FileNo
tFoundException: C:\Program Files\jbpm\opt\jboss-5.0.1.GA.zip (The system cannot
find the path specified)
at org.apache.tools.ant.taskdefs.Get.execute(Get.java:80)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
a:105)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(Single
CheckExecutor.java:38)
at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416)
... 17 more
Caused by: java.io.FileNotFoundException: C:\Program Files\jbpm\opt\jboss-5.0.1.
GA.zip (The system cannot find the path specified)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
at java.io.FileOutputStream.<init>(FileOutputStream.java:131)
at org.apache.tools.ant.taskdefs.Get.doGet(Get.java:216)
at org.apache.tools.ant.taskdefs.Get.execute(Get.java:76)
... 30 more
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/569980#569980]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 5 months
[Performance Tuning] - Transaction taking long time to execute
by Mayur B
Mayur B [http://community.jboss.org/people/bingojava] created the discussion
"Transaction taking long time to execute"
To view the discussion, visit: http://community.jboss.org/message/569947#569947
--------------------------------------------------------------
Hi, I am using Jboss 5.1.0 GA, EJB 3.0 , MySQL 5.x
My application is running on a Linux server.
In my java program(client), multiple threads are trying to access the entity bean "LiveSubscriber" using following funtion:
//=====================================Stateless Session Bean==============================
package com.teshwa.bingogame.clubbeans;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.Enumeration;
import java.util.List;
import java.util.Random;
import java.util.Vector;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.NoResultException;
import javax.persistence.Persistence;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import javax.persistence.RollbackException;
import com.teshwa.bingo.clubs.ClubBLO;
import com.teshwa.bingo.clubs.ClubDAO;
import com.teshwa.bingo.clubs.ClubManager;
import com.teshwa.bingo.game.Game;
import com.teshwa.bingo.game.ticket.Ticket;
import com.teshwa.bingogame.GameRule;
import com.teshwa.bingogame.LiveClub;
import com.teshwa.bingogame.LiveGame;
import com.teshwa.bingogame.LiveSubscriber;
import com.teshwa.bingogame.jpo.Bingo75_ticket;
import com.teshwa.bingogame.jpo.Bingo90_ticket;
import com.teshwa.bingogame.jpo.Bingo_game;
import com.teshwa.bingogame.jpo.Bingo_game_pattern;
import com.teshwa.bingogame.jpo.Bingo_game_type;
import com.teshwa.bingogame.jpo.Bingo_game_type_rule;
import com.teshwa.bingogame.jpo.Bingo_game_type_rulePK;
import com.teshwa.bingogame.jpo.Bingo_game_winner;
import com.teshwa.bingogame.jpo.Club;
import com.teshwa.bingogame.jpo.Club_schedule_date;
import com.teshwa.bingogame.jpo.Game_jackpot;
import com.teshwa.bingogame.jpo.Game_jackpot_transaction;
import com.teshwa.bingogame.jpo.Game_timetable_detail;
import com.teshwa.bingogame.jpo.Subscriber;
import com.teshwa.bingogame.jpo.Subscriber_purchased_ticket;
@Stateless
public class GameManagerBean implements GameManagerRemote {
@PersistenceContext (unitName=ContextMapper.MAPPINGNAME) private EntityManager manager;
public GameManagerBean(){
}
@Override
package com.clubbeans;
import statements....
@Stateless
public class GameManagerBean implements GameManagerRemote {
@PersistenceContext (unitName="gamesproject") private EntityManager manager;
public GameManagerBean(){
}
@Override
public List<LiveSubscriber> getAllSubscribers() {
System.out.println("Inside Method");
try{
return (List<LiveSubscriber>)manager.createQuery("SELECT lb FROM LiveSubscriber lb").getResultList();
}catch(NoResultException nr){
System.out.println("getting out");
return null;
}
}// Method ENDS
}// Class ENDS
//=========================================================================================
My Problem: SOMETIMES (5 out of 100 tries, mostly when number of threads acccessing, increases) the control from this method doesnt return immediately ... it prints the statement "inside method"...but doesnt print the log statement at client side , immediately after this method call. It was printed after 4 to 5 minutes.
My guess is that since lots of threads accessing the LiveSubscriber (live_subscribers table in DB) , sometimes this thread gets locked for longer time and doesnt comeout immediately . If this happens for 1 or 2 minutes , its ok for my application , but it should come out atleast after 2 minutes , otherwise next scheduling gets screwd up.
here is information from my persistence.xml ---->
persistence-unit name="gamesproject" transaction-type="JTA"
jta-data-source---->jdbc/ser
class--->com.LiveSubscriber
property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5Dialect"
property name="hibernate.hbm2ddl.auto" value="create"
I am not using any deployment descripter for session beans.
Do I need to change default isolation level for Datasource (How?) or this one perticular method should be bean managed using EntityManger.lock?
Basically can anybody tell how to prevent this transaction taking so much time?
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/569947#569947]
Start a new discussion in Performance Tuning at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 5 months
[Datasource Configuration] - HA XA Datasource
by Ross Nicholson
Ross Nicholson [http://community.jboss.org/people/rnicholson10] created the discussion
"HA XA Datasource"
To view the discussion, visit: http://community.jboss.org/message/566687#566687
--------------------------------------------------------------
Hi,
We currnently use HA local tx connections in JBoss 5.1, it is very simple to set up simply separating JNDI strings with "|", characters as follows:
<local-tx-datasource>
<jndi-name>PhaseInformixLocalTX</jndi-name>
<connection-url>jdbc:informix-sqli://rampcm1:port/database:INFORMIXSERVER=oltp_cm1;IFX_LOCK_MODE_WAIT=20|jdbc:informix-sqli:
//rampcm2:port/database:INFORMIXSERVER=oltp_cm2;IFX_LOCK_MODE_WAIT=20</connection-url>
<url-delimeter>|</url-delimeter>
<driver-class>com.informix.jdbc.IfxDriver</driver-class>
<user-name>user</user-name>
<password>password</password>
</local-tx-datasource>
What I am having difficulty with is setting up a HA XA datasource, the following is my attempt which does not work:
<xa-datasource>
<jndi-name>PhaseInformixXADS</jndi-name>
<xa-datasource-class>com.informix.jdbcx.IfxXADataSource</xa-datasource-class>
<url-delimeter>|</url-delimeter>
<xa-datasource-property name="Description">DB Pool for phase to talk to Informix</xa-datasource-property>
<xa-datasource-property name="IfxIFXHOST">rampcm1|rampcm2</xa-datasource-property>
<xa-datasource-property name="PortNumber">PORT</xa-datasource-property>
<xa-datasource-property name="DatabaseName">target db</xa-datasource-property>
<xa-datasource-property name="ServerName">oltp_cm1|oltp_cm2</xa-datasource-property>
<xa-datasource-property name="User">user</xa-datasource-property>
<xa-datasource-property name="Password">password</xa-datasource-property>
<xa-datasource-property name="IfxIFX_LOCK_MODE_WAIT">20</xa-datasource-property>
<transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
<user-name>user</user-name>
<password>password</password>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.InformixExceptionSorter</exception-sorter-class-name>
<metadata>
<type-mapping>InformixDB</type-mapping>
</metadata>
</xa-datasource>
I simply tried to separate the host and servername using "|" characters (which I know cannot work!).
Does anyone know how this should be done?
Thanks,
Ross
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/566687#566687]
Start a new discussion in Datasource Configuration at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 5 months