Resending since i'm completely stuck with this..
Hi,
I have the same requirement as that stated in the subject. I've deployed
magnoliaAuthor and another webapp app2 (which needs to use content from
Magnolia) in the same server (Websphere).
For magnoliaAuthor, the repositories.xml was given as :
param name="contextFactoryClass"
value="com.ibm.websphere.naming.WsnInitialContextFactory" />
param name="providerURL" value="iiop://localhost:2809" />
param name="bindName" value="magnoliaCMS" />
and the initialization happens fine.
Within app2, i'm accessing the repository like :
Hashtable ht2=new Hashtable();
ht2.put(Context.INITIAL_CONTEXT_FACTORY,"com.ibm.websphere.naming.WsnInitialContextFactory");
ht2.put(Context.PROVIDER_URL,"iiop://localhost:2809");
Context ctx=new InitialContext(ht2);
Object o = ctx.lookup("magnoliaCMS");
BindableRepository repo = (BindableRepository) o;
Session session = repo.login(new
SimpleCredentials("admin",
"admin".toCharArray()));
Now, this fails with the following message :
NMSV0605W: A javax.naming.Reference object looked up from the context
"abcmachineNode01Cell/nodes/abcmachineNode01/servers/server1" with the name
"magnoliaCMS" was sent to the JNDI Naming Manager and an exception resulted.
Reference data follows:
Reference Factory Class Name:
org.apache.jackrabbit.core.jndi.BindableRepositoryFactory
Reference Factory Class Location URLs: <null>
Reference Class Name: org.apache.jackrabbit.core.jndi.BindableRepository
Type: configFilePath
Content:
C:\Workspaces\Magnolia\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\magnoliaAuthor_war.ear\magnoliaAuthor.war\WEB-INF\config\repo-conf\jackrabbit-derby-search.xml
Type: repHomeDir
Content: c:/magnolia/data/repositories/magnolia
Exception data follows:
javax.jcr.RepositoryException: The repository home
C:\magnolia\data\repositories\magnolia appears to be in use since the file
named .lock is locked by another process.
I understand there's a lock on the repository, but what's the workaround for
it ? . Surely there must be a way for an application to have "Read-only"
access to a repository, while another application (ie magnoliaAuthor) is
running at the same time.
When i'm trying to access from magnoliaAuthor itself, there's no lock issue.
Please advise how to proceed with this.
Sameer, can you please explain a bit more on having "contextFactoryClass"
as shared library between webapps. I am assuming that since i'm using
com.ibm.websphere.naming.WsnInitialContextFactory which is provided by the
server, it's a shared resource and nothing explicitly has to be done for it.
Thanks,
Joseph
Exactly!
In addition, for sharing JCR you need to make sure that class
specified under "contextFactoryClass" in repositories.xml is
available as shared
library between webapps.
Regards,
Sameer Charles
--
View this message in context:
http://www.nabble.com/Access-magnolia-content-from-external-application-deployed-in-same-server-tp11629765p16396024.html
Sent from the Magnolia - User mailing list archive at Nabble.com.
----------------------------------------------------------------
for list details see
http://documentation.magnolia.info/
----------------------------------------------------------------