Hi everyone,
i'm new to hibernate (and hibernate forum hello to all by the way). I'm kinda struggling for days now on a blowin' mind problem and i really need some help here. I'll explain my case.
I'm using Struts with hibernate and Spring. Here's the main situation, i have a zip folder which contains some .csv files. What was asked me to do was to upload the zip file on server, extract all the files (onto a folder) and then convert all the .csv files to a .xls files. Each files correspond to a Business Object which possess a DAO class. I have a service class which read the .xls files cell by cell and row by row. Each row of the .xls file refer to an instance of the Business Object class.
here's an example of the what i explained :
The Business Object class Code:
public class BoDACTT extends BoBase {
private String reference;
private String semaine;
private String resume;
private Date date_de_creation;
private String createur;
private String sponsor;
private String beneficiaires;
/**
*
*/
private String application;
/**
*
*/
private String priorite;
/**
*
*/
private String equipe_assignee;
private Date date_assignation;
private String statut;
private Date date_statut;
private Float charge_previsionnelle;
/**
*
*/
private Float charge_consommee;
/**
*
*/
private String typologie;
private String reference_externe1;
private String reference_externe2;
/**
*
*/
private String management_financier;
/**
*
*/
private String projet_de_rattachement;
/**
*
*/
private String responsable_demande;
private Date de;
private Date fe;
private Date dr;
private Date luat;
private Date fuat;
/**
*
*/
private Date mep;
/**
*
*/
private Date fg;
/**
*
*/
private String statut_mc;
private Date date_maj_mc;
private String origine;
private String macro_chiffrage;
private Date dre;
private Date luate;
private Date fuate;
private Date mepe;
public String getApplication() {
return application;
}
public void setApplication(String application) {
this.application = application;
}
public String getBeneficiaires() {
return beneficiaires;
}
public void setBeneficiaires(String beneficiaires) {
this.beneficiaires = beneficiaires;
}
public Float getCharge_consommee() {
return charge_consommee;
}
public void setCharge_consommee(Float charge_consommee) {
this.charge_consommee = charge_consommee;
}
public Float getCharge_previsionnelle() {
return charge_previsionnelle;
}
public void setCharge_previsionnelle(Float charge_previsionnelle) {
this.charge_previsionnelle = charge_previsionnelle;
}
public String getCreateur() {
return createur;
}
public void setCreateur(String createur) {
this.createur = createur;
}
public Date getDate_assignation() {
return date_assignation;
}
public void setDate_assignation(Date date_assignation) {
this.date_assignation = date_assignation;
}
public Date getDate_de_creation() {
return date_de_creation;
}
public void setDate_de_creation(Date date_de_creation) {
this.date_de_creation = date_de_creation;
}
public Date getDate_maj_mc() {
return date_maj_mc;
}
public void setDate_maj_mc(Date date_maj_mc) {
this.date_maj_mc = date_maj_mc;
}
public Date getDate_statut() {
return date_statut;
}
public void setDate_statut(Date date_statut) {
this.date_statut = date_statut;
}
public Date getDe() {
return de;
}
public void setDe(Date de) {
this.de = de;
}
public Date getDr() {
return dr;
}
public void setDr(Date dr) {
this.dr = dr;
}
public Date getDre() {
return dre;
}
public void setDre(Date dre) {
this.dre = dre;
}
public String getEquipe_assignee() {
return equipe_assignee;
}
public void setEquipe_assignee(String equipe_assignee) {
this.equipe_assignee = equipe_assignee;
}
public Date getFe() {
return fe;
}
public void setFe(Date fe) {
this.fe = fe;
}
public Date getFg() {
return fg;
}
public void setFg(Date fg) {
this.fg = fg;
}
public Date getFuat() {
return fuat;
}
public void setFuat(Date fuat) {
this.fuat = fuat;
}
public Date getFuate() {
return fuate;
}
public void setFuate(Date fuate) {
this.fuate = fuate;
}
public Date getLuat() {
return luat;
}
public void setLuat(Date luat) {
this.luat = luat;
}
public Date getLuate() {
return luate;
}
public void setLuate(Date luate) {
this.luate = luate;
}
public String getMacro_chiffrage() {
return macro_chiffrage;
}
public void setMacro_chiffrage(String macro_chiffrage) {
this.macro_chiffrage = macro_chiffrage;
}
public String getManagement_financier() {
return management_financier;
}
public void setManagement_financier(String management_financier) {
this.management_financier = management_financier;
}
public Date getMep() {
return mep;
}
public void setMep(Date mep) {
this.mep = mep;
}
public Date getMepe() {
return mepe;
}
public void setMepe(Date mepe) {
this.mepe = mepe;
}
public String getOrigine() {
return origine;
}
public void setOrigine(String origine) {
this.origine = origine;
}
public String getPriorite() {
return priorite;
}
public void setPriorite(String priorite) {
this.priorite = priorite;
}
public String getProjet_de_rattachement() {
return projet_de_rattachement;
}
public void setProjet_de_rattachement(String projet_de_rattachement) {
this.projet_de_rattachement = projet_de_rattachement;
}
public String getReference() {
return reference;
}
public void setReference(String reference) {
this.reference = reference;
}
public String getReference_externe1() {
return reference_externe1;
}
public void setReference_externe1(String reference_externe1) {
this.reference_externe1 = reference_externe1;
}
public String getReference_externe2() {
return reference_externe2;
}
public void setReference_externe2(String reference_externe2) {
this.reference_externe2 = reference_externe2;
}
public String getResponsable_demande() {
return responsable_demande;
}
public void setResponsable_demande(String responsable_demande) {
this.responsable_demande = responsable_demande;
}
public String getResume() {
return resume;
}
public void setResume(String resume) {
this.resume = resume;
}
public String getSemaine() {
return semaine;
}
public void setSemaine(String semaine) {
this.semaine = semaine;
}
public String getSponsor() {
return sponsor;
}
public void setSponsor(String sponsor) {
this.sponsor = sponsor;
}
public String getStatut() {
return statut;
}
public void setStatut(String statut) {
this.statut = statut;
}
public String getStatut_mc() {
return statut_mc;
}
public void setStatut_mc(String statut_mc) {
this.statut_mc = statut_mc;
}
public String getTypologie() {
return typologie;
}
public void setTypologie(String typologie) {
this.typologie = typologie;
}
}
DAO class of the BO aboveCode:
public class DaoDACTT extends CrudDaoBase<ArcAteContextAdapter, BoDACTT, Integer>
implements IDaoDACTT {
public void delete(BoDACTT object) {
getHibernateTemplate().delete(object);
}
public void deleteAll(Collection<Integer> objects) {
getHibernateTemplate().deleteAll(objects);
}
public BoDACTT get(Integer object) throws DataAccessException {
return (BoDACTT)getHibernateTemplate().get(BoDACTT.class, object);
}
public List<BoDACTT> getAll() {
String sql = "select DACTT from " + BoDACTT.class.getName() + " as DACTT";
return getHibernateTemplate().find(sql);
}
public Serializable save(BoDACTT object) {
return getHibernateTemplate().save(object);
}
public void saveOrUpdate(BoDACTT object) {
getHibernateTemplate().saveOrUpdate(object);
}
public void update(BoDACTT object) {
getHibernateTemplate().update(object);
}
public void openConnection(){
if(getHibernateTemplate().getSessionFactory().isClosed()){
getHibernateTemplate().getSessionFactory().openSession();
}else{
closeConnection();
}
}
public void closeConnection(){
getHibernateTemplate().getSessionFactory().close();
}
}
Code:
public class SrvDacTT extends ServiceBase<ArcAteContextAdapter> implements ISrvDacTT {
//String nomFic=null;
// public SrvDacTT(String nomFic) throws BiffException, IOException {
// Workbook workBook=Workbook.getWorkbook(new File(nomFic));
// Sheet sheet=workBook.getSheet(0);
//
//
// }
public void insererDac_TT(String nomFic){
try {
Workbook workBook = Workbook.getWorkbook(new File(nomFic));
Sheet sheet=workBook.getSheet(0);
int nb = sheet.getRows();
//List<BoDACTT> list=new ArrayList<BoDACTT>();
// getDaoDACTT().openConnection();
for(int i=1;i<nb;i++){
BoDACTT boD=new BoDACTT();
//-----------------------------------//
Cell reference = sheet.getCell(0,i);
boD.setReference(reference.getContents().trim());
//----------------------------------//
Cell resume =sheet.getCell(1, i);
boD.setResume(resume.getContents().replaceAll("'", " "));
//----------------------------------//
Cell date_de_creation =sheet.getCell(2, i);
SimpleDateFormat sdf = new SimpleDateFormat("dd/mm/yyyy");
if(date_de_creation.getContents().trim().equals("")){
sdf = new SimpleDateFormat("dd/mm/yyyy");
boD.setDate_de_creation(sdf.parse("30/12/1899"));
}
boD.setDate_de_creation(sdf.parse(date_de_creation.getContents()));
//----------------------------------//
Cell createur =sheet.getCell(3, i);
boD.setCreateur(createur.getContents().replaceAll("'", " ").replaceAll("é","e").replaceAll("à","a"));
//----------------------------------//
Cell Sponsor =sheet.getCell(4, i);
boD.setSponsor(Sponsor.getContents().replaceAll("'", " ").replaceAll("é","e").replaceAll("à","a"));
//----------------------------------//
Cell Beneficiaries =sheet.getCell(5, i);
boD.setBeneficiaires(Beneficiaries.getContents().replaceAll("'", " ").replaceAll("é","e").replaceAll("à","a"));
//----------------------------------//
Cell Application =sheet.getCell(6, i);
boD.setApplication(Application.getContents().replaceAll("'", " ").replaceAll("é","e").replaceAll("à","a"));
//----------------------------------//
Cell AssignmentTeam =sheet.getCell(7, i);
boD.setEquipe_assignee(AssignmentTeam.getContents().replaceAll("'", " ").replaceAll("é","e").replaceAll("à","a").replaceAll("è", "e"));
//----------------------------------//
Cell AssignmentDate =sheet.getCell(10, i);
sdf =new SimpleDateFormat("dd/mm/yyyy");
if(AssignmentDate.getContents().trim().equals("")){
sdf = new SimpleDateFormat("dd/mm/yyyy");
boD.setDate_assignation(sdf.parse("30/12/1899"));
}
boD.setDate_assignation(sdf.parse(AssignmentDate.getContents()));
//----------------------------------//
Cell Status =sheet.getCell(8, i);
boD.setStatut(Status.getContents().replaceAll("'", " ").replaceAll("é","e").replaceAll("à","a"));
//----------------------------------//
Cell date_statut =sheet.getCell(9, i);
if(date_statut.getContents().trim().equals("")){
sdf = new SimpleDateFormat("dd/mm/yyyy");
boD.setDate_statut(sdf.parse(date_statut.getContents()));
}
boD.setDate_statut(sdf.parse(date_statut.getContents()));
//----------------------------------//
Cell ActualWorkload =sheet.getCell(12, i);
if(ActualWorkload.getContents().trim().equals(""))
{
boD.setCharge_consommee(Float.parseFloat("0.0"));
}else{
boD.setCharge_consommee(Float.parseFloat(ActualWorkload.getContents().replace(',', '.').trim()));
}
//----------------------------------//
Cell ExternalReference2 =sheet.getCell(16, i);
boD.setReference_externe2(ExternalReference2.getContents().replaceAll("'", " ").replaceAll("é","e").replaceAll("à","a"));
//----------------------------------//
Cell Origine =sheet.getCell(24, i);
boD.setOrigine(Origine.getContents().replaceAll("'", " ").replaceAll("é","e").replaceAll("à","a"));
//----------------------------------//
Cell ResponsableDac =sheet.getCell(44, i);
boD.setResponsable_demande(ResponsableDac.getContents().replaceAll("'", " ").replaceAll("é","e").replaceAll("à","a").trim());
//----------------------------------//
Cell FinancialManagement =sheet.getCell(27, i);
boD.setManagement_financier(FinancialManagement.getContents().replaceAll("'", " ").replaceAll("é","e").replaceAll("à","a"));
//----------------------------------//
Cell estimatedWorkload =sheet.getCell(22, i);
if(estimatedWorkload.getContents().trim().equals(""))
{
boD.setCharge_previsionnelle(Float.parseFloat("0,0"));
}else{
boD.setCharge_previsionnelle(Float.parseFloat(estimatedWorkload.getContents().replace('.', ',').trim()));
}
//----------------------------------//
Cell ExternalReference1 =sheet.getCell(26, i);
boD.setReference_externe1(ExternalReference1.getContents().replaceAll("'", " ").replaceAll("é","e").replaceAll("à","a"));
//----------------------------------//
Cell AttachmentProject =sheet.getCell(21, i);
boD.setProjet_de_rattachement(AttachmentProject.getContents().replaceAll("'", " ").replaceAll("é","e").replaceAll("à","a"));
//----------------------------------//
Cell DE =sheet.getCell(45, i);
if(DE.getContents().trim().equals("")){
sdf = new SimpleDateFormat("dd/mm/yyyy");
boD.setDe(sdf.parse("30/12/1899"));
}
else{
boD.setDe(sdf.parse(DE.getContents()));
}
//----------------------------------//
Cell FE =sheet.getCell(46, i);
if(FE.getContents().trim().equals("")){
sdf = new SimpleDateFormat("dd/mm/yyyy");
boD.setFe(sdf.parse("30/12/1899"));
}
else{
boD.setFe(sdf.parse(FE.getContents()));
}
//--------------------------------//
Cell Typology =sheet.getCell(20, i);
boD.setTypologie(Typology.getContents().replaceAll("'", " ").replaceAll("é","e").replaceAll("à","a"));
//--------------------------------//
Cell Priority =sheet.getCell(11, i);
boD.setPriorite(Priority.getContents().replaceAll("'"," ").replaceAll("é","e").replaceAll("à","a"));
//---------------------------//
Cell DR =sheet.getCell(39, i);
if(DR.getContents().trim().equals("")){
sdf = new SimpleDateFormat("dd/mm/yyyy");
boD.setDr(sdf.parse("30/12/1899"));
}
else{
boD.setDr(sdf.parse(DR.getContents()));
}
//---------------------------------------
Cell LUAT =sheet.getCell(40, i);
if(LUAT.getContents().trim().equals("")){
sdf = new SimpleDateFormat("dd/mm/yyyy");
boD.setLuat(sdf.parse("30/12/1899"));
}
else{
boD.setLuat(sdf.parse(LUAT.getContents()));
}
//---------------------------------------
Cell FUAT =sheet.getCell(41, i);
if(FUAT.getContents().trim().equals("")){
sdf = new SimpleDateFormat("dd/mm/yyyy");
boD.setFuat(sdf.parse("30/12/1899"));
}
else{
boD.setFuat(sdf.parse(FUAT.getContents()));
}
//---------------------------------------
Cell MEP =sheet.getCell(42, i);
if(MEP.getContents().trim().equals("")){
sdf = new SimpleDateFormat("dd/mm/yyyy");
boD.setMep(sdf.parse("30/12/1899"));
}
else{
boD.setMep(sdf.parse(MEP.getContents()));
}
//---------------------------------------
Cell FG =sheet.getCell(43, i);
if(FG.getContents().trim().equals("")){
sdf = new SimpleDateFormat("dd/mm/yyyy");
boD.setFg(sdf.parse("30/12/1899"));
}
else{
boD.setFg(sdf.parse(FG.getContents()));
}
//---------------------------------------
Cell StatusMC =sheet.getCell(13, i);
boD.setStatut_mc(StatusMC.getContents().replaceAll("'", " ").replaceAll("é","e").replaceAll("à","a"));
//---------------------------------------
Cell DateMAJMC =sheet.getCell(14, i);
if(DateMAJMC.getContents().trim().equals("")){
sdf = new SimpleDateFormat("dd/mm/yyyy");
boD.setDate_maj_mc(sdf.parse("30/12/1899"));
}
else{
boD.setDate_maj_mc(sdf.parse(DateMAJMC.getContents()));
}
//---------------------------------------
Cell macroCh =sheet.getCell(38, i);
boD.setMacro_chiffrage(macroCh.getContents().replaceAll("'", " ").replaceAll("é","e").replaceAll("à","a"));
//---------Date effectif---------------------
Cell DRE =sheet.getCell(47, i);
if(DRE.getContents().trim().equals("")){
sdf = new SimpleDateFormat("dd/mm/yyyy");
boD.setDre(sdf.parse("30/12/1899"));
}
else{
boD.setDre(sdf.parse(DRE.getContents()));
}
//-------------
Cell LUATE =sheet.getCell(48, i);
if(LUATE.getContents().trim().equals("")){
sdf = new SimpleDateFormat("dd/mm/yyyy");
boD.setLuate(sdf.parse("30/12/1899"));
}
else{
boD.setLuate(sdf.parse(LUATE.getContents()));
}
//-------------
Cell FUATE =sheet.getCell(49, i);
if(FUATE.getContents().trim().equals("")){
sdf = new SimpleDateFormat("dd/mm/yyyy");
boD.setFuate(sdf.parse("30/12/1899"));
}
else{
boD.setFuate(sdf.parse(FUATE.getContents()));
}
//-------------
Cell MEPE =sheet.getCell(50, i);
if(MEPE.getContents().trim().equals("")){
sdf = new SimpleDateFormat("dd/mm/yyyy");
boD.setMepe(sdf.parse("30/12/1899"));
}
else{
boD.setMepe(sdf.parse(MEPE.getContents()));
}
//---------------------------
java.util.Date date = new java.util.Date();
sdf = new SimpleDateFormat("yyyy-ww");
String semaine =sdf.format(date);
boD.setSemaine(semaine);
getDaoDACTT().save(boD);
}
Runtime.getRuntime().gc();
Runtime.getRuntime().gc();
//getDaoDACTT().closeConnection();
// int cpt=0;
// while(cpt<nb){
} catch (BiffException e) {
// TODO Bloc catch auto-généré
e.printStackTrace();
} catch (IOException e) {
// TODO Bloc catch auto-généré
e.printStackTrace();
} catch (ParseException e) {
// TODO Bloc catch auto-généré
e.printStackTrace();
}
//
// cpt++;
}
// return list;}
The service class which uses the DAO class and the BOCode:
public class SrvDacTT extends ServiceBase<ArcAteContextAdapter> implements ISrvDacTT {
//String nomFic=null;
// public SrvDacTT(String nomFic) throws BiffException, IOException {
// Workbook workBook=Workbook.getWorkbook(new File(nomFic));
// Sheet sheet=workBook.getSheet(0);
//
//
// }
public void insererDac_TT(String nomFic){
try {
Workbook workBook = Workbook.getWorkbook(new File(nomFic));
Sheet sheet=workBook.getSheet(0);
int nb = sheet.getRows();
//List<BoDACTT> list=new ArrayList<BoDACTT>();
// getDaoDACTT().openConnection();
for(int i=1;i<nb;i++){
BoDACTT boD=new BoDACTT();
//-----------------------------------//
Cell reference = sheet.getCell(0,i);
boD.setReference(reference.getContents().trim());
//----------------------------------//
Cell resume =sheet.getCell(1, i);
boD.setResume(resume.getContents().replaceAll("'", " "));
//----------------------------------//
Cell date_de_creation =sheet.getCell(2, i);
SimpleDateFormat sdf = new SimpleDateFormat("dd/mm/yyyy");
if(date_de_creation.getContents().trim().equals("")){
sdf = new SimpleDateFormat("dd/mm/yyyy");
boD.setDate_de_creation(sdf.parse("30/12/1899"));
}
boD.setDate_de_creation(sdf.parse(date_de_creation.getContents()));
//----------------------------------//
Cell createur =sheet.getCell(3, i);
boD.setCreateur(createur.getContents().replaceAll("'", " ").replaceAll("é","e").replaceAll("à","a"));
//----------------------------------//
Cell Sponsor =sheet.getCell(4, i);
boD.setSponsor(Sponsor.getContents().replaceAll("'", " ").replaceAll("é","e").replaceAll("à","a"));
//----------------------------------//
Cell Beneficiaries =sheet.getCell(5, i);
boD.setBeneficiaires(Beneficiaries.getContents().replaceAll("'", " ").replaceAll("é","e").replaceAll("à","a"));
//----------------------------------//
Cell Application =sheet.getCell(6, i);
boD.setApplication(Application.getContents().replaceAll("'", " ").replaceAll("é","e").replaceAll("à","a"));
//----------------------------------//
Cell AssignmentTeam =sheet.getCell(7, i);
boD.setEquipe_assignee(AssignmentTeam.getContents().replaceAll("'", " ").replaceAll("é","e").replaceAll("à","a").replaceAll("è", "e"));
//----------------------------------//
Cell AssignmentDate =sheet.getCell(10, i);
sdf =new SimpleDateFormat("dd/mm/yyyy");
if(AssignmentDate.getContents().trim().equals("")){
sdf = new SimpleDateFormat("dd/mm/yyyy");
boD.setDate_assignation(sdf.parse("30/12/1899"));
}
boD.setDate_assignation(sdf.parse(AssignmentDate.getContents()));
//----------------------------------//
Cell Status =sheet.getCell(8, i);
boD.setStatut(Status.getContents().replaceAll("'", " ").replaceAll("é","e").replaceAll("à","a"));
//----------------------------------//
Cell date_statut =sheet.getCell(9, i);
if(date_statut.getContents().trim().equals("")){
sdf = new SimpleDateFormat("dd/mm/yyyy");
boD.setDate_statut(sdf.parse(date_statut.getContents()));
}
boD.setDate_statut(sdf.parse(date_statut.getContents()));
//----------------------------------//
Cell ActualWorkload =sheet.getCell(12, i);
if(ActualWorkload.getContents().trim().equals(""))
{
boD.setCharge_consommee(Float.parseFloat("0.0"));
}else{
boD.setCharge_consommee(Float.parseFloat(ActualWorkload.getContents().replace(',', '.').trim()));
}
//----------------------------------//
Cell ExternalReference2 =sheet.getCell(16, i);
boD.setReference_externe2(ExternalReference2.getContents().replaceAll("'", " ").replaceAll("é","e").replaceAll("à","a"));
//----------------------------------//
Cell Origine =sheet.getCell(24, i);
boD.setOrigine(Origine.getContents().replaceAll("'", " ").replaceAll("é","e").replaceAll("à","a"));
//----------------------------------//
Cell ResponsableDac =sheet.getCell(44, i);
boD.setResponsable_demande(ResponsableDac.getContents().replaceAll("'", " ").replaceAll("é","e").replaceAll("à","a").trim());
//----------------------------------//
Cell FinancialManagement =sheet.getCell(27, i);
boD.setManagement_financier(FinancialManagement.getContents().replaceAll("'", " ").replaceAll("é","e").replaceAll("à","a"));
//----------------------------------//
Cell estimatedWorkload =sheet.getCell(22, i);
if(estimatedWorkload.getContents().trim().equals(""))
{
boD.setCharge_previsionnelle(Float.parseFloat("0,0"));
}else{
boD.setCharge_previsionnelle(Float.parseFloat(estimatedWorkload.getContents().replace('.', ',').trim()));
}
//----------------------------------//
Cell ExternalReference1 =sheet.getCell(26, i);
boD.setReference_externe1(ExternalReference1.getContents().replaceAll("'", " ").replaceAll("é","e").replaceAll("à","a"));
//----------------------------------//
Cell AttachmentProject =sheet.getCell(21, i);
boD.setProjet_de_rattachement(AttachmentProject.getContents().replaceAll("'", " ").replaceAll("é","e").replaceAll("à","a"));
//----------------------------------//
Cell DE =sheet.getCell(45, i);
if(DE.getContents().trim().equals("")){
sdf = new SimpleDateFormat("dd/mm/yyyy");
boD.setDe(sdf.parse("30/12/1899"));
}
else{
boD.setDe(sdf.parse(DE.getContents()));
}
//----------------------------------//
Cell FE =sheet.getCell(46, i);
if(FE.getContents().trim().equals("")){
sdf = new SimpleDateFormat("dd/mm/yyyy");
boD.setFe(sdf.parse("30/12/1899"));
}
else{
boD.setFe(sdf.parse(FE.getContents()));
}
//--------------------------------//
Cell Typology =sheet.getCell(20, i);
boD.setTypologie(Typology.getContents().replaceAll("'", " ").replaceAll("é","e").replaceAll("à","a"));
//--------------------------------//
Cell Priority =sheet.getCell(11, i);
boD.setPriorite(Priority.getContents().replaceAll("'"," ").replaceAll("é","e").replaceAll("à","a"));
//---------------------------//
Cell DR =sheet.getCell(39, i);
if(DR.getContents().trim().equals("")){
sdf = new SimpleDateFormat("dd/mm/yyyy");
boD.setDr(sdf.parse("30/12/1899"));
}
else{
boD.setDr(sdf.parse(DR.getContents()));
}
//---------------------------------------
Cell LUAT =sheet.getCell(40, i);
if(LUAT.getContents().trim().equals("")){
sdf = new SimpleDateFormat("dd/mm/yyyy");
boD.setLuat(sdf.parse("30/12/1899"));
}
else{
boD.setLuat(sdf.parse(LUAT.getContents()));
}
//---------------------------------------
Cell FUAT =sheet.getCell(41, i);
if(FUAT.getContents().trim().equals("")){
sdf = new SimpleDateFormat("dd/mm/yyyy");
boD.setFuat(sdf.parse("30/12/1899"));
}
else{
boD.setFuat(sdf.parse(FUAT.getContents()));
}
//---------------------------------------
Cell MEP =sheet.getCell(42, i);
if(MEP.getContents().trim().equals("")){
sdf = new SimpleDateFormat("dd/mm/yyyy");
boD.setMep(sdf.parse("30/12/1899"));
}
else{
boD.setMep(sdf.parse(MEP.getContents()));
}
//---------------------------------------
Cell FG =sheet.getCell(43, i);
if(FG.getContents().trim().equals("")){
sdf = new SimpleDateFormat("dd/mm/yyyy");
boD.setFg(sdf.parse("30/12/1899"));
}
else{
boD.setFg(sdf.parse(FG.getContents()));
}
//---------------------------------------
Cell StatusMC =sheet.getCell(13, i);
boD.setStatut_mc(StatusMC.getContents().replaceAll("'", " ").replaceAll("é","e").replaceAll("à","a"));
//---------------------------------------
Cell DateMAJMC =sheet.getCell(14, i);
if(DateMAJMC.getContents().trim().equals("")){
sdf = new SimpleDateFormat("dd/mm/yyyy");
boD.setDate_maj_mc(sdf.parse("30/12/1899"));
}
else{
boD.setDate_maj_mc(sdf.parse(DateMAJMC.getContents()));
}
//---------------------------------------
Cell macroCh =sheet.getCell(38, i);
boD.setMacro_chiffrage(macroCh.getContents().replaceAll("'", " ").replaceAll("é","e").replaceAll("à","a"));
//---------Date effectif---------------------
Cell DRE =sheet.getCell(47, i);
if(DRE.getContents().trim().equals("")){
sdf = new SimpleDateFormat("dd/mm/yyyy");
boD.setDre(sdf.parse("30/12/1899"));
}
else{
boD.setDre(sdf.parse(DRE.getContents()));
}
//-------------
Cell LUATE =sheet.getCell(48, i);
if(LUATE.getContents().trim().equals("")){
sdf = new SimpleDateFormat("dd/mm/yyyy");
boD.setLuate(sdf.parse("30/12/1899"));
}
else{
boD.setLuate(sdf.parse(LUATE.getContents()));
}
//-------------
Cell FUATE =sheet.getCell(49, i);
if(FUATE.getContents().trim().equals("")){
sdf = new SimpleDateFormat("dd/mm/yyyy");
boD.setFuate(sdf.parse("30/12/1899"));
}
else{
boD.setFuate(sdf.parse(FUATE.getContents()));
}
//-------------
Cell MEPE =sheet.getCell(50, i);
if(MEPE.getContents().trim().equals("")){
sdf = new SimpleDateFormat("dd/mm/yyyy");
boD.setMepe(sdf.parse("30/12/1899"));
}
else{
boD.setMepe(sdf.parse(MEPE.getContents()));
}
//---------------------------
java.util.Date date = new java.util.Date();
sdf = new SimpleDateFormat("yyyy-ww");
String semaine =sdf.format(date);
boD.setSemaine(semaine);
getDaoDACTT().save(boD);
}
Runtime.getRuntime().gc();
Runtime.getRuntime().gc();
//getDaoDACTT().closeConnection();
// int cpt=0;
// while(cpt<nb){
} catch (BiffException e) {
// TODO Bloc catch auto-généré
e.printStackTrace();
} catch (IOException e) {
// TODO Bloc catch auto-généré
e.printStackTrace();
} catch (ParseException e) {
// TODO Bloc catch auto-généré
e.printStackTrace();
}
//
// cpt++;
}
// return list;
@SuppressWarnings("unused")
private String remplacer(String remp) {
remp = remp.replaceAll("'", " ");
remp = remp.replaceAll(",", " ");
remp = remp.replaceAll("é", "e");
remp = remp.replaceAll("è", "e");
remp = remp.replaceAll("à", "a");
remp = remp.replaceAll("ê", "e");
remp = remp.replaceAll("ô", "o");
remp = remp.replaceAll("î", "i");
remp = remp.replaceAll("û", "u");
return remp;
}
public void viderDACTT(){
List<BoDACTT> listeDac=getDaoDACTT().getAll();
for(BoDACTT bo:listeDac){
getDaoDACTT().delete(bo);
}
Runtime.getRuntime().gc();
Runtime.getRuntime().gc();
}
private IDaoDACTT getDaoDACTT(){
return (IDaoDACTT) getDao(IDaoDACTT.class);
}
}
this is basically what my business side looks like. i'm using 3-tier architecture, i find my ejbface using an EJB jndi lookup which search for Business Controller class that encapsulates everything in the business side, navigate all the processing to the presentation side and then uses it like that
IBcTaches controller=(IBcTaches) RemotingHelper.getImplementation(IBcTaches.class);
controller.sauvegarder(nomFic); In my presentation side i'm using struts as i said earlier, here's the Pageform, PageEvent and the .jsp
Code:
public class ChargementDawebEvent extends PageEvent {
static final int BUFFER = 2048;
@Override
protected ActionForward onexecute(ActionMapping mapping, ActionForm actionForm,
HttpServletRequest request, HttpServletResponse response) throws Exception {
ChargementDawebForm form=(ChargementDawebForm) actionForm;
FormFile file=form.getFile();
String filePath= "C:\\workspace\\AFU_WEB\\AFU_WEB_web\\src\\main\\webapp\\upload";
String folder = "C:\\workspace\\AFU_WEB\\AFU_WEB_web\\src\\main\\webapp\\upload\\extraction";
String folder2 = "C:\\workspace\\AFU_WEB\\AFU_WEB_web\\src\\main\\webapp\\upload\\";
upload(filePath, file, request);
unzip(filePath+"\\"+file.getFileName(),folder);
convertir(folder,folder2);
chargerDaweb(folder2);
System.out.println("DAWEB CHARGE");
return mapping.findForward("success");
}
private void unzip(String path, String outputFolder){
try {
// préparation du zip
BufferedOutputStream dest = null;
BufferedInputStream is = null;
ZipEntry entry;
ZipFile zipfile = new ZipFile(path);
@SuppressWarnings("rawtypes")
Enumeration e = zipfile.entries();
// recharche du nom du zip
File pathNom = new File(path);
String nomFichier = pathNom.getName();
String nom = nomFichier.substring(0, nomFichier.length() - 4);
//System.out.println(nom);
File execution = new File(System.getProperty("user.dir"));
String executionPath = execution.getParent().replaceAll("\\\\", "/");
// création du dossier racine
File NOM = new File(outputFolder);
NOM.mkdir();
// URL de base
// String URLbase = "../" + "." + "/" + nom ;
String URLbase = outputFolder;
// boucle d'extraction des fichiers
int Compteur=5;
while (e.hasMoreElements()) {
// préparation du fichier courant à extraire
entry = (ZipEntry) e.nextElement();
String url = entry.getName();
System.out.println("Extracting: " + url);
String URLfichier = URLbase + "/" + url;
System.out.println("URL: " + URLfichier);
File URL = new File(URLfichier);
if (isFile(URL.getName())) {
// écriture du fichier (extraction)
is = new BufferedInputStream
(zipfile.getInputStream(entry));
int count;
byte data[] = new byte[BUFFER];
FileOutputStream fos = new
FileOutputStream(URLfichier);
dest = new
BufferedOutputStream(fos, BUFFER);
while ( (count = is.read(data, 0, BUFFER))
!= -1) {
dest.write(data, 0, count);
}
dest.flush();
dest.close();
is.close();
}
else {
// zone répértoire
URL.mkdirs();
}
}
}
catch (Exception e) {
e.printStackTrace();
}
}
private boolean isFile (String nom) {
for (int i=nom.length()-1; i>=0; i--) {
if (nom.charAt(i) == '.' ) {
return true;
}
}
return false;
}
private void upload(String filePath, FormFile file, HttpServletRequest request){
// create the upload folder if not exists
File folder = new File(filePath);
if(!folder.exists()){
folder.mkdir();
}
String fileName = file.getFileName();
if(!("").equals(fileName)){
System.out.println("Server path:" +filePath);
File newFile = new File(filePath, fileName);
if(!newFile.exists()){
try{
FileOutputStream fos = new FileOutputStream(newFile);
fos.write(file.getFileData());
fos.flush();
fos.close();
}catch(Exception e){
e.printStackTrace();
}
}
request.setAttribute("uploadedFilePath",newFile.getAbsoluteFile());
request.setAttribute("uploadedFileName",newFile.getName());
}
}
private void convertir(String folderInput, String folderOutput) throws TechnicalException, FunctionalException{
File dossier=new File(folderInput);
File[] listFiles=dossier.listFiles();
IBcConversion controller=(IBcConversion)RemotingHelper.getImplementation(IBcConversion.class);
for(int i=0;i<listFiles.length;i++){
if(listFiles[i].isFile()){
String path=listFiles[i].getAbsolutePath().replace("\\\\", "//");
if(listFiles[i].getName().contains("DAC_TT")){
File myfile = new File(path);
String[] a = {"CSV="+myfile.getAbsolutePath(),"SEP=;","TIT=O","SHT="+myfile.getName().replace(".csv", ""),"XLS="+folderOutput+myfile.getName().replace(".csv", "")+".xls"} ;
controller.convertir(a);
}
if(listFiles[i].getName().contains("DAS_TT")){
File myfile = new File(path);
String[] a = {"CSV="+myfile.getAbsolutePath(),"SEP=;","TIT=O","SHT="+myfile.getName().replace(".csv", ""),"XLS="+folderOutput+myfile.getName().replace(".csv", "")+".xls"} ;
controller.convertir(a);
}
if(listFiles[i].getName().contains("DIN_TT")){
File myfile = new File(path);
String[] a = {"CSV="+myfile.getAbsolutePath(),"SEP=;","TIT=O","SHT="+myfile.getName().replace(".csv", ""),"XLS="+folderOutput+myfile.getName().replace(".csv", "")+".xls"} ;
controller.convertir(a);
}
if(listFiles[i].getName().contains("SAISIE_ACT")){
File myfile = new File(path);
String[] a = {"CSV="+myfile.getAbsolutePath(),"SEP=;","TIT=O","SHT="+myfile.getName().replace(".csv", ""),"XLS="+folderOutput+myfile.getName().replace(".csv", "")+".xls"} ;
controller.convertir(a);
}
if(listFiles[i].getName().contains("USER")){
File myfile = new File(path);
String[] a = {"CSV="+myfile.getAbsolutePath(),"SEP=;","TIT=O","SHT="+myfile.getName().replace(".csv", ""),"XLS="+folderOutput+myfile.getName().replace(".csv", "")+".xls"} ;
controller.convertir(a);
}
if(listFiles[i].getName().contains("ABSENCES")){
File myfile = new File(path);
String[] a = {"CSV="+myfile.getAbsolutePath(),"SEP=;","TIT=O","SHT="+myfile.getName().replace(".csv", ""),"XLS="+folderOutput+myfile.getName().replace(".csv", "")+".xls"} ;
controller.convertir(a);
}
if(listFiles[i].getName().contains("report")){
File myfile = new File(path);
String[] a = {"CSV="+myfile.getAbsolutePath(),"SEP=;","TIT=O","SHT="+myfile.getName().replace(".csv", ""),"XLS="+folderOutput+myfile.getName().replace(".csv", "")+".xls"} ;
controller.convertir(a);
}
if(listFiles[i].getName().contains("alertes_taches")){
File myfile = new File(path);
String[] a = {"CSV="+myfile.getAbsolutePath(),"SEP=;","TIT=O","SHT="+myfile.getName().replace(".csv", ""),"XLS="+folderOutput+myfile.getName().replace(".csv", "")+".xls"} ;
controller.convertir(a);
}
}
}
}
public File TestExisteFichierInfo(String repertoire , String fichier){
File dir = new File(repertoire);
String[] children = dir.list();
File[] fich=dir.listFiles();
if (children == null) {
} else {
}
return dir;
}
public static void sauvegarderDAC(String nomFic) throws TechnicalException,FunctionalException{
IBcDACTT controller=(IBcDACTT) RemotingHelper.getImplementation(IBcDACTT.class);
controller.sauvegarder(nomFic);
}
public static void sauvegarderDAS(String nomFic) throws TechnicalException, FunctionalException{
IBcDASTT controller=(IBcDASTT) RemotingHelper.getImplementation(IBcDASTT.class);
controller.sauvegarder(nomFic);
}
public static void sauvegarderDIN(String nomFic) throws TechnicalException, FunctionalException{
IBcDINTT controller=(IBcDINTT) RemotingHelper.getImplementation(IBcDINTT.class);
controller.sauvegarder(nomFic);
}
public static void sauvegarderUsers(String nomFic) throws TechnicalException, FunctionalException{
IBcUsersBdsi controller=(IBcUsersBdsi) RemotingHelper.getImplementation(IBcUsersBdsi.class);
controller.inserer(nomFic);
}
public static void sauvegarderReport(String nomFic) throws TechnicalException, FunctionalException{
IBcReport controller=(IBcReport) RemotingHelper.getImplementation(IBcReport.class);
controller.sauvegarder(nomFic);
}
public static void sauvegarderAssignationDac(String nomFic) throws TechnicalException, FunctionalException{
IBcAssignationDac controller=(IBcAssignationDac) RemotingHelper.getImplementation(IBcAssignationDac.class);
controller.sauvegarder(nomFic);
}
public static void sauvegarderTaches(String nomFic) throws TechnicalException, FunctionalException{
IBcTaches controller=(IBcTaches) RemotingHelper.getImplementation(IBcTaches.class);
controller.sauvegarder(nomFic);
}
public static void sauvegarderSaisie(String nomFic) throws TechnicalException, FunctionalException{
IBcSaisie controller=(IBcSaisie) RemotingHelper.getImplementation(IBcSaisie.class);
controller.sauvegarder(nomFic);
}
private void chargerDaweb(String folder) throws TechnicalException, FunctionalException{
File dossier=new File(folder);
File[] listeFiles=dossier.listFiles();
for(int i=0;i<listeFiles.length;i++){
if(listeFiles[i].getName().contains("DAC_TT")){
sauvegarderDAC(listeFiles[i].getAbsolutePath().replace("\\\\", "//"));
}else if(listeFiles[i].getName().contains("DAS_TT")){
sauvegarderDAS(listeFiles[i].getAbsolutePath().replace("\\\\", "//"));
}
else if(listeFiles[i].getName().contains("DIN_TT")){
sauvegarderDIN(listeFiles[i].getAbsolutePath().replace("\\\\", "//"));
}
else if(listeFiles[i].getName().contains("USER")){
sauvegarderUsers(listeFiles[i].getAbsolutePath().replace("\\\\", "//"));
}
else if(listeFiles[i].getName().contains("SAISIE_ACT")){
sauvegarderSaisie(listeFiles[i].getAbsolutePath().replace("\\\\", "//"));
}
else if(listeFiles[i].getName().contains("report")){
sauvegarderReport(listeFiles[i].getAbsolutePath().replace("\\\\", "//"));
}
else if(listeFiles[i].getName().contains("alertes_taches")){
sauvegarderTaches(listeFiles[i].getAbsolutePath().replace("\\\\", "//"));
}else{
sauvegarderAssignationDac(listeFiles[i].getAbsolutePath().replace("\\\\", "//"));
}
}
}
}
Code:
public class ChargementDawebForm extends PageForm {
private FormFile file;
public FormFile getFile() {
return file;
}
public void setFile(FormFile file) {
this.file = file;
}
}
We're gettin' to it...
So now when i click on the button, i do the upload, the extraction and the conversion thing. But when i try to save like 7 files, using that same method, i face that problem below
Code:
[29/04/13 14:35:47:579 GMT] 00000042 SystemOut O [2013-04-29 14:35:47][WARN ] [ServiceManagerImpl] The service [DB_SERVICE] is declared more than one times in the file [services]. Only the first declaration will be used, the others will be discarded.
[29/04/13 14:35:47:986 GMT] 00000042 SystemOut O [2013-04-29 14:35:47][DEBUG] [ContextLocatorDefault] Trying to get Context with id=com.bnpparibas.eadName.arc.ate.exemple and key=com.bnpparibas.eadName.arc.ate.exemple
[29/04/13 14:35:47:986 GMT] 00000042 SystemOut O [2013-04-29 14:35:47][DEBUG] [ContextLocatorDefault] Trying to get Context with id=com.bnpparibas.eadName.arc.ate.exemple and key=com.bnpparibas.eadName.arc.ate.exemple
[29/04/13 14:35:47:986 GMT] 00000042 SystemOut O [2013-04-29 14:35:47][DEBUG] [ContextLocatorDefault] Trying to load Context with id=com.bnpparibas.eadName.arc.ate.exemple
[29/04/13 14:35:47:986 GMT] 00000042 SystemOut O [2013-04-29 14:35:47][DEBUG] [ContextLocatorDefault] Trying to load Context with id=com.bnpparibas.eadName.arc.ate.exemple
[29/04/13 14:35:48:423 GMT] 00000042 ConnectionFac W J2CA0294W: Deprecated usage of direct JNDI lookup of resource jdbc/datasource. The following default values are used: [Resource-ref settings]
res-auth: 1 (APPLICATION)
res-isolation-level: 0 (TRANSACTION_NONE)
res-sharing-scope: true (SHAREABLE)
loginConfigurationName: null
loginConfigProperties: null
[Other attributes]
res-resolution-control: 999 (undefined)
res ref or CMP bean name: AFU_WEB_bus-ear#AFU_WEB_ejb.jar#EjbFacade
Database pool properties: null
primeID: 0
isCMP1_x: false (not CMP1.x)
isJMS: false (not JMS)
[29/04/13 14:35:49:033 GMT] 00000042 SystemOut O [2013-04-29 14:35:49][WARN ] [Configurator] No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: wsjar:file:/C:/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/AFU_WEB_bus-ear.ear/target/AFU_WEB_bus-ear-1.0.0-SNAPSHOT/ehcache-1.1.jar!/ehcache-failsafe.xml
[29/04/13 14:35:49:064 GMT] 00000042 SystemOut O [2013-04-29 14:35:49][WARN ] [EhCacheProvider] Could not find configuration [com.bnpparibas.eadName.arc.ate.exemple.bo.BoAnomalies]; using defaults.
[29/04/13 14:35:49:267 GMT] 00000042 SystemOut O [2013-04-29 14:35:49][WARN ] [EhCacheProvider] Could not find configuration [com.bnpparibas.eadName.arc.ate.exemple.bo.BoBank]; using defaults.
[29/04/13 14:35:49:267 GMT] 00000042 SystemOut O [2013-04-29 14:35:49][ERROR] [PojoEntityTuplizer] Getters of lazy classes cannot be final: com.bnpparibas.eadName.arc.ate.exemple.bo.BoBank.listTiers
[29/04/13 14:35:49:267 GMT] 00000042 SystemOut O [2013-04-29 14:35:49][ERROR] [PojoEntityTuplizer] Setters of lazy classes cannot be final: com.bnpparibas.eadName.arc.ate.exemple.bo.BoBank.listTiers
[29/04/13 14:35:49:283 GMT] 00000042 SystemOut O [2013-04-29 14:35:49][WARN ] [EhCacheProvider] Could not find configuration [com.bnpparibas.eadName.arc.ate.exemple.bo.BoUsersBDSI]; using defaults.
[29/04/13 14:35:49:283 GMT] 00000042 SystemOut O [2013-04-29 14:35:49][WARN ] [EhCacheProvider] Could not find configuration [com.bnpparibas.eadName.arc.ate.exemple.bo.BoAbsences]; using defaults.
[29/04/13 14:35:49:298 GMT] 00000042 SystemOut O [2013-04-29 14:35:49][WARN ] [EhCacheProvider] Could not find configuration [com.bnpparibas.eadName.arc.ate.exemple.bo.BoSaisie]; using defaults.
[29/04/13 14:35:49:298 GMT] 00000042 SystemOut O [2013-04-29 14:35:49][WARN ] [EhCacheProvider] Could not find configuration [com.bnpparibas.eadName.arc.ate.exemple.bo.BoReport]; using defaults.
[29/04/13 14:35:49:314 GMT] 00000042 SystemOut O [2013-04-29 14:35:49][WARN ] [EhCacheProvider] Could not find configuration [com.bnpparibas.eadName.arc.ate.exemple.bo.BoAzlaf]; using defaults.
[29/04/13 14:35:49:314 GMT] 00000042 SystemOut O [2013-04-29 14:35:49][WARN ] [EhCacheProvider] Could not find configuration [com.bnpparibas.eadName.arc.ate.exemple.bo.BoDASTT]; using defaults.
[29/04/13 14:35:49:345 GMT] 00000042 SystemOut O [2013-04-29 14:35:49][WARN ] [EhCacheProvider] Could not find configuration [com.bnpparibas.eadName.arc.ate.exemple.bo.BoTiers]; using defaults.
[29/04/13 14:35:49:345 GMT] 00000042 SystemOut O [2013-04-29 14:35:49][WARN ] [EhCacheProvider] Could not find configuration [com.bnpparibas.eadName.arc.ate.exemple.bo.BoDINTT]; using defaults.
[29/04/13 14:35:49:361 GMT] 00000042 SystemOut O [2013-04-29 14:35:49][WARN ] [EhCacheProvider] Could not find configuration [com.bnpparibas.eadName.arc.ate.exemple.bo.BoDACTT]; using defaults.
[29/04/13 14:35:49:392 GMT] 00000042 SystemOut O [2013-04-29 14:35:49][WARN ] [EhCacheProvider] Could not find configuration [com.bnpparibas.eadName.arc.ate.exemple.bo.BoTaches]; using defaults.
[29/04/13 14:35:49:408 GMT] 00000042 SystemOut O [2013-04-29 14:35:49][WARN ] [EhCacheProvider] Could not find configuration [com.bnpparibas.eadName.arc.ate.exemple.bo.BoAssignationDAC]; using defaults.
[29/04/13 14:35:49:408 GMT] 00000042 SystemOut O [2013-04-29 14:35:49][WARN ] [EhCacheProvider] Could not find configuration [com.bnpparibas.eadName.arc.ate.exemple.bo.BoBank.listTiers]; using defaults.
[29/04/13 14:35:50:298 GMT] 00000042 SystemOut O [2013-04-29 14:35:50][DEBUG] [ContextLocatorDefault] Trying to get Context with id=com.bnpparibas.eadName.arc.ate.exemple and key=com.bnpparibas.eadName.arc.ate.exemple
[29/04/13 14:35:50:298 GMT] 00000042 SystemOut O [2013-04-29 14:35:50][DEBUG] [ContextLocatorDefault] Trying to get Context with id=com.bnpparibas.eadName.arc.ate.exemple and key=com.bnpparibas.eadName.arc.ate.exemple
[29/04/13 14:35:54:017 GMT] 00000042 SystemOut O [2013-04-29 14:35:54][DEBUG] [ContextLocatorDefault] Trying to get Context with id=com.bnpparibas.eadName.arc.ate.exemple and key=com.bnpparibas.eadName.arc.ate.exemple
[29/04/13 14:35:54:017 GMT] 00000042 SystemOut O [2013-04-29 14:35:54][DEBUG] [ContextLocatorDefault] Trying to get Context with id=com.bnpparibas.eadName.arc.ate.exemple and key=com.bnpparibas.eadName.arc.ate.exemple
[29/04/13 14:35:54:689 GMT] 00000042 SystemOut O [2013-04-29 14:35:54][DEBUG] [ContextLocatorDefault] Trying to get Context with id=com.bnpparibas.eadName.arc.ate.exemple and key=com.bnpparibas.eadName.arc.ate.exemple
[29/04/13 14:35:54:689 GMT] 00000042 SystemOut O [2013-04-29 14:35:54][DEBUG] [ContextLocatorDefault] Trying to get Context with id=com.bnpparibas.eadName.arc.ate.exemple and key=com.bnpparibas.eadName.arc.ate.exemple
[29/04/13 14:36:03:955 GMT] 00000042 SystemOut O [2013-04-29 14:36:03][DEBUG] [ContextLocatorDefault] Trying to get Context with id=com.bnpparibas.eadName.arc.ate.exemple and key=com.bnpparibas.eadName.arc.ate.exemple
[29/04/13 14:36:03:955 GMT] 00000042 SystemOut O [2013-04-29 14:36:03][DEBUG] [ContextLocatorDefault] Trying to get Context with id=com.bnpparibas.eadName.arc.ate.exemple and key=com.bnpparibas.eadName.arc.ate.exemple
[29/04/13 14:36:04:142 GMT] 00000042 SystemOut O [2013-04-29 14:36:04][DEBUG] [ContextLocatorDefault] Trying to get Context with id=com.bnpparibas.eadName.arc.ate.exemple and key=com.bnpparibas.eadName.arc.ate.exemple
[29/04/13 14:36:04:142 GMT] 00000042 SystemOut O [2013-04-29 14:36:04][DEBUG] [ContextLocatorDefault] Trying to get Context with id=com.bnpparibas.eadName.arc.ate.exemple and key=com.bnpparibas.eadName.arc.ate.exemple
[29/04/13 14:36:04:564 GMT] 00000042 SystemOut O [2013-04-29 14:36:04][DEBUG] [ContextLocatorDefault] Trying to get Context with id=com.bnpparibas.eadName.arc.ate.exemple and key=com.bnpparibas.eadName.arc.ate.exemple
[29/04/13 14:36:04:564 GMT] 00000042 SystemOut O [2013-04-29 14:36:04][DEBUG] [ContextLocatorDefault] Trying to get Context with id=com.bnpparibas.eadName.arc.ate.exemple and key=com.bnpparibas.eadName.arc.ate.exemple
[29/04/13 14:36:05:189 GMT] 00000042 SystemOut O [2013-04-29 14:36:05][DEBUG] [ContextLocatorDefault] Trying to get Context with id=com.bnpparibas.eadName.arc.ate.exemple and key=com.bnpparibas.eadName.arc.ate.exemple
[29/04/13 14:36:05:189 GMT] 00000042 SystemOut O [2013-04-29 14:36:05][DEBUG] [ContextLocatorDefault] Trying to get Context with id=com.bnpparibas.eadName.arc.ate.exemple and key=com.bnpparibas.eadName.arc.ate.exemple
[29/04/13 14:36:06:095 GMT] 00000042 SystemOut O [2013-04-29 14:36:06][DEBUG] [ContextLocatorDefault] Trying to get Context with id=com.bnpparibas.eadName.arc.ate.exemple and key=com.bnpparibas.eadName.arc.ate.exemple
[29/04/13 14:36:06:095 GMT] 00000042 SystemOut O [2013-04-29 14:36:06][DEBUG] [ContextLocatorDefault] Trying to get Context with id=com.bnpparibas.eadName.arc.ate.exemple and key=com.bnpparibas.eadName.arc.ate.exemple
[29/04/13 14:36:07:205 GMT] 00000042 SystemOut O [2013-04-29 14:36:07][DEBUG] [ContextLocatorDefault] Trying to get Context with id=com.bnpparibas.eadName.arc.ate.exemple and key=com.bnpparibas.eadName.arc.ate.exemple
[29/04/13 14:36:07:205 GMT] 00000042 SystemOut O [2013-04-29 14:36:07][DEBUG] [ContextLocatorDefault] Trying to get Context with id=com.bnpparibas.eadName.arc.ate.exemple and key=com.bnpparibas.eadName.arc.ate.exemple
[29/04/13 14:36:08:455 GMT] 00000042 SystemOut O [2013-04-29 14:36:08][DEBUG] [ContextLocatorDefault] Trying to get Context with id=com.bnpparibas.eadName.arc.ate.exemple and key=com.bnpparibas.eadName.arc.ate.exemple
[29/04/13 14:36:08:455 GMT] 00000042 SystemOut O [2013-04-29 14:36:08][DEBUG] [ContextLocatorDefault] Trying to get Context with id=com.bnpparibas.eadName.arc.ate.exemple and key=com.bnpparibas.eadName.arc.ate.exemple
[29/04/13 14:36:08:845 GMT] 00000042 SystemOut O [2013-04-29 14:36:08][DEBUG] [ContextLocatorDefault] Trying to get Context with id=com.bnpparibas.eadName.arc.ate.exemple and key=com.bnpparibas.eadName.arc.ate.exemple
[29/04/13 14:36:08:845 GMT] 00000042 SystemOut O [2013-04-29 14:36:08][DEBUG] [ContextLocatorDefault] Trying to get Context with id=com.bnpparibas.eadName.arc.ate.exemple and key=com.bnpparibas.eadName.arc.ate.exemple
[29/04/13 14:36:08:970 GMT] 00000042 SystemOut O [2013-04-29 14:36:08][DEBUG] [ContextLocatorDefault] Trying to get Context with id=com.bnpparibas.eadName.arc.ate.exemple and key=com.bnpparibas.eadName.arc.ate.exemple
[29/04/13 14:36:08:970 GMT] 00000042 SystemOut O [2013-04-29 14:36:08][DEBUG] [ContextLocatorDefault] Trying to get Context with id=com.bnpparibas.eadName.arc.ate.exemple and key=com.bnpparibas.eadName.arc.ate.exemple
[29/04/13 14:36:08:986 GMT] 00000042 SharedPool I J2CA0086W: Shareable connection MCWrapper id 1380138 Managed connection WSRdbManagedConnectionImpl@4a804a8 State:STATE_TRAN_WRAPPER_INUSE
from resource jdbc/datasource was used within a local transaction containment boundary.
[29/04/13 14:36:11:330 GMT] 00000042 SystemOut O [2013-04-29 14:36:11][DEBUG] [ContextLocatorDefault] Trying to get Context with id=com.bnpparibas.eadName.arc.ate.exemple and key=com.bnpparibas.eadName.arc.ate.exemple
[29/04/13 14:36:11:330 GMT] 00000042 SystemOut O [2013-04-29 14:36:11][DEBUG] [ContextLocatorDefault] Trying to get Context with id=com.bnpparibas.eadName.arc.ate.exemple and key=com.bnpparibas.eadName.arc.ate.exemple
[29/04/13 14:36:11:923 GMT] 00000042 SystemOut O [2013-04-29 14:36:11][WARN ] [Configurator] No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: wsjar:file:/C:/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/AFU_WEB_bus-ear.ear/target/AFU_WEB_bus-ear-1.0.0-SNAPSHOT/ehcache-1.1.jar!/ehcache-failsafe.xml
[29/04/13 14:36:14:158 GMT] 00000042 SystemOut O [2013-04-29 14:36:14][ERROR] [AssertionFailure] an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session)
Can somebody save this poor guy please ?
Thank you in advance.