-
1. Re: Could not create a new Tx
nfilotto Feb 27, 2012 4:26 AM (in response to rory8000)Please describe more your issue. What is your code? What is your data source configuration?...
-
2. Re: Could not create a new Tx
rory8000 Feb 27, 2012 10:10 AM (in response to nfilotto)My gatein-ds.xml for jcr:
<local-tx-datasource>
<jndi-name>gatein-jcr_portal</jndi-name>
<connection-url>jdbc:hsqldb:${jboss.server.data.dir}${/}gatein${/}hypersonic${/}gatein-jcr_portal-localDB</connection-url>
<driver-class>org.hsqldb.jdbcDriver</driver-class>
<user-name>sa</user-name>
<password></password>
<min-pool-size>5</min-pool-size>
<max-pool-size>20</max-pool-size>
<idle-timeout-minutes>0</idle-timeout-minutes>
<prepared-statement-cache-size>32</prepared-statement-cache-size>
</local-tx-datasource>
My code:
PortalContainer container = RootContainer.getInstance().getPortalContainer("ecmdemo");
PortalContainer.setInstance(container);
RepositoryService repositoryService = (RepositoryService) container.getComponentInstanceOfType(RepositoryService.class);
repositoryService.setCurrentRepositoryName("repository");
Repository repository = repositoryService.getCurrentRepository();
Credentials cred = new SimpleCredentials("root","gtn".toCharArray());
Session session = repository.login(cred, "collaboration");
Workspace workspace = session.getWorkspace();
//JCR Stuff
workspace.getNamespaceRegistry().registerNamespace("myn", "mynamespace");
session.logout();
Thanks
-
3. Re: Could not create a new Tx
nfilotto Feb 27, 2012 1:47 PM (in response to rory8000)This is weird, anyway your code even if it worked would only register the namespace at Runtime so it is not enough. If you want to register a namespace and persist it, you will need to add it in your configuration file. In the next example, I register 2 namespaces with their corresponding prefixes.
... <external-component-plugins> <target-component>org.exoplatform.services.jcr.RepositoryService</target-component> <component-plugin> <name>add.namespaces</name> <set-method>addPlugin</set-method> <type>org.exoplatform.services.jcr.impl.AddNamespacesPlugin</type> <init-params> <properties-param> <name>namespaces</name> <property name="imd" value="http://www.exoplatform.com/image/metadata/1.0/"/> <property name="mmd" value="http://www.exoplatform.com/media/metadata/1.0/"/> </properties-param> </init-params> </component-plugin> </external-component-plugins> ...
-
4. Re: Could not create a new Tx
rory8000 Feb 27, 2012 1:53 PM (in response to nfilotto)What abou if I need to remove node types that I registered within the content manager. Anyway, any operation for create, update or delete gave the previous error
-
5. Re: Could not create a new Tx
nfilotto Feb 28, 2012 6:15 AM (in response to rory8000)I believe that your issue is not related to this, it is probably a consequence of a more general issue. Which product do you use? What is the exact version of it? Please provide the log file of your application server.