hi Florian
Florian Ried wrote:
I'm trying to implement a JSR-170 Content Repository as an EJB
Application. This is a similar approach as described in JackRabbit
Deployment Model 3 (Repository Server with RMI).
IMO it's not a similar approach.
If I understand you correctly you want to *implement* a jcr compliant
repository. The JCR-RMI contribution is not a full implementation, it
consists of two parts, a server that wraps an already implemented jcr
repository (e.g. Jackrabbit), and a client that lets you access the
remote server transparently.
All methods in the (Remote-) interface RepositoryImpl have to throw
RemoteExceptions (see J2EE Spec) but the interface javax.jcr.Repository
doesn't define them.
As you noted while compiling the remote interfaces of your EJBs, remote
calls throw RemoteExceptions. jcr-rmi tackles this problem with a design
that makes intensive use of the adapter pattern. It hides the
RemoteExceptions and it makes the remote objects available locally
through the jcr API. see
http://svn.apache.org/viewcvs.cgi/incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/client/ClientItem.java?view=markup
> Are there any solutions for this problem?
If you want to implement a jcr compliant repository from scratch it will
be hard work and you'll find many more problems in the path. I guess you
should ask the Day team, they already walked that path and did a great job.
If all you want is to access a remote jcr repository you might want to
try jcr-rmi.
Recompling the javax.jcr.* Interfaces?
it doesn't seem a good idea. What's the point of making a jcr compliant
impl that's not jcr compliant? ;)
Why is the scenario of building a JCR-Server on top of a EJB Container
not considered by the specification? Is the approach of building a JCR
by using an EJB Container the right way?
IMHO it's not.
Is it perhaps possible to use jackrabbit within an EJB-Container (with
custom DB-Mapping)?
yes, you can use it in an ejb container. No matter the container I guess
it shouldn't be so different to the example in the site. Just find out
how to declare a jndi resource in your container and you'll be able to
access the jcr repo either from your ejbs or from your jsp/servlets.
The db topic was discussed quite a few times in the list, you'll find
many threads in the archive
(http://dir.gmane.org/gmane.comp.apache.jackrabbit.devel). You can also
take a look to the wiki
(http://wiki.apache.org/jackrabbit/PersistenceManagerFAQ), it has some
info about how the persistent storage is handled in jackrabbit and which
are the current options.
kind regards,
edgar
Thanks for your answers.
-Flo