Home » Modeling » EMF » [CDO] Error when editing a resource (in a repository with security)
[CDO] Error when editing a resource (in a repository with security) [message #1016040] |
Mon, 04 March 2013 17:05 |
Marc Gil Messages: 81 Registered: July 2009 |
Member |
|
|
Hi,
I'm using a repository with the security enabled. I want to use an own EPackage to populate a model. I do the following steps:
1. Register the EPackage
2. Create a Model Resource
3. Add a new element from my EPackage
4. Save the model
After the 4th step, if i'm using NO security, all works fine. But when security is enabled, it throws an error saying that the user X has no privilege to write to EPackage X.
OK. I modify the security file to give permission to that EPackage (need to restart the server, see this comment: http://www.eclipse.org/forums/index.php/t/457798/).
After that, I still cannot use my EPackage. First time I try to save the model, the following exception occurs:
[ERROR] Rollback in DBStore: org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: java.lang.IllegalArgumentException: protocol = http host = null
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException(ResourceSetImpl.java:319)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:278)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:406)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getEObject(ResourceSetImpl.java:220)
at org.eclipse.emf.internal.cdo.view.AbstractCDOView.convertIDToObject(AbstractCDOView.java:1235)
at org.eclipse.emf.internal.cdo.view.CDOStoreImpl.convertIDToObject(CDOStoreImpl.java:686)
at org.eclipse.emf.internal.cdo.view.CDOStoreImpl.convertToEMF(CDOStoreImpl.java:654)
at org.eclipse.emf.internal.cdo.view.CDOStoreImpl.get(CDOStoreImpl.java:190)
...
Second time I try to save the model, the following exception occurs:
[ERROR] Rollback in DBStore: org.eclipse.net4j.db.DBException: DBTable exists: requirementManagement_RequirementCatalogSet
at org.eclipse.net4j.spi.db.DBSchema.addTable(DBSchema.java:73)
at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.AbstractHorizontalClassMapping.initTable(AbstractHorizontalClassMapping.java:117)
at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.AbstractHorizontalClassMapping.<init>(AbstractHorizontalClassMapping.java:105)
at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.HorizontalNonAuditClassMapping.<init>(HorizontalNonAuditClassMapping.java:95)
at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.HorizontalNonAuditMappingStrategy.doCreateClassMapping(HorizontalNonAuditMappingStrategy.java:68)
at org.eclipse.emf.cdo.server.internal.db.mapping.AbstractMappingStrategy.createClassMapping(AbstractMappingStrategy.java:506)
at org.eclipse.emf.cdo.server.internal.db.mapping.AbstractMappingStrategy.mapClasses(AbstractMappingStrategy.java:492)
If I have a look to the DB, the table cdo_package_units and cdo_package_infos never contains my EPackage. It is never registered in the DB, only when the save action is done, it is registered, but without using security.
Am I forgetting something or doing anything wrong??
Thanks,
Marc
[Updated on: Tue, 05 March 2013 07:14] Report message to a moderator
|
|
|
Re: [CDO] Error when editing a resource (in a repository with security) [message #1016663 is a reply to message #1016040] |
Thu, 07 March 2013 09:49 |
|
Am 04.03.2013 18:05, schrieb Marc Gil:
> Hi,
>
> I'm using a repository with the security enabled. I want to use an own EPackage to populate a model. I do the
> following steps:
> 1. Register the EPackage
Normally this is done automatically in your step 3 below.
> 2. Create a Model Resource
> 3. Add a new element from my EPackage
> 4. Save the model
>
> After the 4th step, if i'm using NO security, all works fine. But when security is enabled, it throws an error saying
> that the user X has no privilege to write to EPackage X.
>
> OK. I modify the security file to give permission to that EPackage (need to restart the server, see this comment:
> http://www.eclipse.org/forums/index.php/t/457798/).
>
> After that, I still cannot use my EPackage. First time I try to save the model, the following exception occurs:
>
> [ERROR] Rollback in DBStore: org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException:
> java.lang.IllegalArgumentException: protocol = http host = null
That looks strange. There must be root causes with more details. Can I see them?
> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException(ResourceSetImpl.java:319)
> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:278)
> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:406)
> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getEObject(ResourceSetImpl.java:220)
> at org.eclipse.emf.internal.cdo.view.AbstractCDOView.convertIDToObject(AbstractCDOView.java:1235)
> at org.eclipse.emf.internal.cdo.view.CDOStoreImpl.convertIDToObject(CDOStoreImpl.java:686)
> at org.eclipse.emf.internal.cdo.view.CDOStoreImpl.convertToEMF(CDOStoreImpl.java:654)
> at org.eclipse.emf.internal.cdo.view.CDOStoreImpl.get(CDOStoreImpl.java:190)
> ..
>
>
> Second time I try to save the model, the following exception occurs:
>
> [ERROR] Rollback in DBStore: org.eclipse.net4j.db.DBException: DBTable exists:
> requirementManagement_RequirementCatalogSet
> at org.eclipse.net4j.spi.db.DBSchema.addTable(DBSchema.java:73)
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.AbstractHorizontalClassMapping.initTable(AbstractHorizontalClassMapping.java:117)
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.AbstractHorizontalClassMapping.<init>(AbstractHorizontalClassMapping.java:105)
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.HorizontalNonAuditClassMapping.<init>(HorizontalNonAuditClassMapping.java:95)
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.HorizontalNonAuditMappingStrategy.doCreateClassMapping(HorizontalNonAuditMappingStrategy.java:68)
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.AbstractMappingStrategy.createClassMapping(AbstractMappingStrategy.java:506)
> at org.eclipse.emf.cdo.server.internal.db.mapping.AbstractMappingStrategy.mapClasses(AbstractMappingStrategy.java:492)
>
>
>
> If I have a look to the DB, the table cdo_package_units and cdo_package_infos never contains my EPackage. It is never
> registered in the DB, only then the save action works fine (without using security).
What kind of database are you using? For some DB types we've encountered problems with DDL cleanup in case of rollbacks.
I'm currently working on that:
401763: Make CDO Server more robust against data dictionary changes
https://bugs.eclipse.org/bugs/show_bug.cgi?id=401763
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
Re: [CDO] Error when editing a resource (in a repository with security) [message #1016667 is a reply to message #1016663] |
Thu, 07 March 2013 10:02 |
Marc Gil Messages: 81 Registered: July 2009 |
Member |
|
|
Hi Eike,
I'm using PostgreSQL 9.1.
I found a solution that at least works for me. After opening a Net4jSession, I register the metamodels I want to make available for the users. I do it simply by creating an own Extension Point where I only indicate the nsURI of the metamodels, and then adding every one like following:
session.getPackageRegistry().put(nsURI, new Descriptor(EPackage.Registry.INSTANCE, nsURI));
Simply and clean, and just make very easy to register only the metamodels that you want your user use. Maybe it's only a "commercial" use, cause you don't want that your users know all the metamodels, of course...
Just doing that, I'm able to create elements into new resources, and also Import resources. But it seams strage, cause the existing action for register the metamodels do the same, isn't it?
Thanks,
Marc
|
|
|
Re: [CDO] Error when editing a resource (in a repository with security) [message #1016701 is a reply to message #1016667] |
Thu, 07 March 2013 12:18 |
|
Am 07.03.2013 11:02, schrieb Marc Gil:
> Hi Eike,
>
> I'm using PostgreSQL 9.1.
I think PostgreSQL belongs to the kind of problematic DBs when it comes to DDL exceptions. Let's wait and see what my
current refactoring brings.
> I found a solution that at least works for me. After opening a Net4jSession, I register the metamodels I want to make
> available for the users. I do it simply by creating an own Extension Point where I only indicate the nsURI of the
> metamodels, and then adding every one like following:
>
> session.getPackageRegistry().put(nsURI, new Descriptor(EPackage.Registry.INSTANCE, nsURI));
>
> Simply and clean, and just make very easy to register only the metamodels that you want your user use. Maybe it's only
> a "commercial" use, cause you don't want that your users know all the metamodels, of course...
>
> Just doing that, I'm able to create elements into new resources, and also Import resources. But it seams strage, cause
> the existing action for register the metamodels do the same, isn't it?
Yes, strange. I would like to understand what's going on but you haven't provided me with the root cause exceptions that
I asked for in my forst reply.
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
| | |
Goto Forum:
Current Time: Sat Apr 27 00:25:35 GMT 2024
Powered by FUDForum. Page generated in 4.52027 seconds
|