IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Wildfly/JBoss Java Discussion :

[jBPM][4.2 GA]Problème de persistence


Sujet :

Wildfly/JBoss Java

  1. #1
    Membre du Club
    Profil pro
    Inscrit en
    Août 2005
    Messages
    73
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Août 2005
    Messages : 73
    Points : 56
    Points
    56
    Par défaut [jBPM][4.2 GA]Problème de persistence
    Bonjour,

    Je suis entrain de faire quelques petits exemples pour découvrir jBPM pour une utilisation future. Je m'attaque pour l'instant à la partie persitence des données en me basant sur les exemples fournis... Mais là, problème lorsque je veux déployer un ProcessDefinition... J'obtient l'exception no jbpm tx service configured. Exception que je n'ai pas quand j'utilise la version 3.1.3 de jBPM. Quelqu'un aurait-il déjà eu (et/ou solutionné) ce problème en 3.4? ou est-ce vraiment du à un problème de la 3.4 ?

    Le schéma est bien créé dans la db donc j'imagine que tout ce qui est hibernate doit fonctionner.

    Le "code" :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
     
    public class TestPersistence {
     
     
    	  static JbpmConfiguration jbpmConfiguration = null; 
     
    	  static {
    	    // An example configuration file such as this can be found in 
    	    // 'src/config.files'.  Typically the configuration information is in the 
    	    // resource file 'jbpm.cfg.xml', but here we pass in the configuration 
    	    // information as an XML string.
     
    	    // First we create a JbpmConfiguration statically.  One JbpmConfiguration
    	    // can be used for all threads in the system, that is why we can safely 
    	    // make it static.
     
    	    jbpmConfiguration = JbpmConfiguration.parseXmlString(
    	      "<jbpm-configuration>" +
     
    	      // A jbpm-context mechanism separates the jbpm core 
    	      // engine from the services that jbpm uses from 
    	      // the environment.  
     
    	      "  <jbpm-context>" +
    	      "    <service name='persistence' " +
    	      "             factory='org.jbpm.persistence.db.DbPersistenceServiceFactory' />" + 
    	      "  </jbpm-context>" +
     
    	      // Also all the resource files that are used by jbpm are 
    	      // referenced from the jbpm.cfg.xml
     
    	      "  <string name='resource.hibernate.cfg.xml' value='hibernate.cfg.xml' />" +
    	      "</jbpm-configuration>"
    	    );
    	  }
     
     
     
    	public TestPersistence(){
     
    		jbpmConfiguration.createSchema();
     
    		deployProcessDefinition();
    	}
     
        public void deployProcessDefinition() {
     
    		DbPersistenceServiceFactory dbPersistenceServiceFactory = (DbPersistenceServiceFactory) jbpmConfiguration
    		.getServiceFactory(Services.SERVICENAME_PERSISTENCE);
     
    		if(dbPersistenceServiceFactory == null){
    			System.out.println("DB FACTORY IS NULL");
    		}
     
        	// This test shows a process definition and one execution 
    		// of the process definition.  The process definition has 
    		// 3 nodes: an unnamed start-state, a state 's' and an 
    		// end-state named 'end'.
    		ProcessDefinition processDefinition = ProcessDefinition
    				.parseXmlString("<process-definition name='hello world'>"
    						+ "  <start-state name='start'>"
    						+ "    <transition to='s' />" + "  </start-state>"
    						+ "  <state name='s'>" + "    <transition to='end' />"
    						+ "  </state>" + "  <end-state name='end' />"
    						+ "</process-definition>");
     
    		// Lookup the pojo persistence context-builder that is configured above
    		JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
     
     
    		try {
     
    			// Deploy the process definition in the database 
    			jbpmContext.deployProcessDefinition(processDefinition);
     
    		} finally {
    			// Tear down the pojo persistence context.
    			// This includes flush the SQL for inserting the process definition  
    			// to the database.
    			jbpmContext.close();
    		}
    	}
     
     
    	public static void main (String ... args ){
     
    		new TestPersistence();
     
    		System.out.println("DONE");
     
    	}

    Les traces :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
     
    ...
    11:35:55,093 [main] DEBUG JbpmContext : creating org.jbpm.JbpmContext@116318b
    11:35:55,093 [main] DEBUG DbPersistenceServiceFactory : creating persistence service
    11:35:55,093 [main] DEBUG DbPersistenceService : creating hibernate session
    11:35:55,140 [main] DEBUG DbPersistenceService : beginning hibernate transaction
    11:35:55,249 [main] DEBUG JbpmContext : closing JbpmContext
    11:35:55,249 [main] DEBUG Services : closing service 'persistence': org.jbpm.persistence.db.DbPersistenceService@ac06d4
    org.jbpm.JbpmException: no jbpm tx service configured
    	at org.jbpm.persistence.db.DbPersistenceService.isRollbackOnly(DbPersistenceService.java:388)
    	at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:210)
    	at org.jbpm.svc.Services.close(Services.java:222)
    	at org.jbpm.JbpmContext.close(JbpmContext.java:139)
    	at mytests.TestPersistence.deployProcessDefinition(TestPersistence.java:87)
    	at mytests.TestPersistence.<init>(TestPersistence.java:50)
    	at mytests.TestPersistence.main(TestPersistence.java:94)
    11:35:55,280 [main] ERROR Services : problem closing service 'persistence'
    org.jbpm.JbpmException: no jbpm tx service configured
    	at org.jbpm.persistence.db.DbPersistenceService.isRollbackOnly(DbPersistenceService.java:388)
    	at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:210)
    	at org.jbpm.svc.Services.close(Services.java:222)
    	at org.jbpm.JbpmContext.close(JbpmContext.java:139)
    	at mytests.TestPersistence.deployProcessDefinition(TestPersistence.java:87)
    	at mytests.TestPersistence.<init>(TestPersistence.java:50)
    	at mytests.TestPersistence.main(TestPersistence.java:94)
    Exception in thread "main" org.jbpm.JbpmException: problem closing services {persistence=org.jbpm.JbpmException: no jbpm tx service configured}
    	at org.jbpm.svc.Services.close(Services.java:235)
    	at org.jbpm.JbpmContext.close(JbpmContext.java:139)
    	at mytests.TestPersistence.deployProcessDefinition(TestPersistence.java:87)
    	at mytests.TestPersistence.<init>(TestPersistence.java:50)
    	at mytests.TestPersistence.main(TestPersistence.java:94)
    Caused by: org.jbpm.JbpmException: no jbpm tx service configured
    	at org.jbpm.persistence.db.DbPersistenceService.isRollbackOnly(DbPersistenceService.java:388)
    	at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:210)
    	at org.jbpm.svc.Services.close(Services.java:222)
    	... 4 more

  2. #2
    Membre éclairé Avatar de XmasRock
    Inscrit en
    Janvier 2007
    Messages
    729
    Détails du profil
    Informations forums :
    Inscription : Janvier 2007
    Messages : 729
    Points : 821
    Points
    821
    Par défaut
    C'est quoi la version 3.4 dont tu parles ?

  3. #3
    Membre du Club
    Profil pro
    Inscrit en
    Août 2005
    Messages
    73
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Août 2005
    Messages : 73
    Points : 56
    Points
    56
    Par défaut
    Citation Envoyé par XmasRock
    C'est quoi la version 3.4 dont tu parles ?
    Oups j'ai du être intéromppu quand j'ai écrit le post... 3.4 c'est la version de l'appli sur laquelle je travailles Au temps pour moi...

    Pour correction ce n'est pas de la 3.4 que je voulais parler mais bien de jbpm 3.2 GA qui semble avoir des problèmes quand je fait de la persistence que je ne retrouves pas dans la 3.1.3 ... Donc je ne sais pas si d'autres personnes ont rencontré le même problème ?

    Merci


    Grégoire

  4. #4
    Membre du Club
    Profil pro
    Inscrit en
    Août 2005
    Messages
    73
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Août 2005
    Messages : 73
    Points : 56
    Points
    56
    Par défaut
    Pour résoudre ce problème, ajouter ceci dans le jbpmcontext :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <service name="tx" factory="org.jbpm.tx.TxServiceFactory" />

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Problème de persistence
    Par maliba dans le forum Hibernate
    Réponses: 1
    Dernier message: 23/12/2007, 11h54
  2. many-to-many problème de persistance
    Par kokumbo dans le forum Hibernate
    Réponses: 1
    Dernier message: 28/11/2007, 16h11
  3. Problème de persistance de ma connection en ADO ?
    Par hesky dans le forum VBA Access
    Réponses: 2
    Dernier message: 08/03/2007, 14h32
  4. [Problème de persistance d'un BufferedReader]
    Par xarius dans le forum Langage
    Réponses: 2
    Dernier message: 31/05/2006, 21h44
  5. Problème LDAP (persistant!!!!!)
    Par onouiri dans le forum Développement
    Réponses: 15
    Dernier message: 27/11/2005, 11h00

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo