You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by James Abley <ja...@gmail.com> on 2009/10/07 17:00:58 UTC

Re: remote file event listener

2009/9/22 <Sa...@ibi.com>

> Hello,
>
>
>
> I am looking for remote file event listener sample code(java).
> Wondering if  vfs or jackrabbit would help.  Any pointers are welcome.
> Thanks in advance.
>
>
>
> Rgds,
>
> Kumar
>
>
Hi,

You might be able to roll something on top of commons-jci fam.

Cheers,

James

Re: should we have mixin type or add new non mandatory properties to the primary type node

Posted by Tobias Bocanegra <tr...@day.com>.
hi,
i would add them as mixin, especially if the new properties belong to
a new semantic group. if you just forgot to add some properties  on
the primary, i would just add them there.

regards toby

On Fri, Oct 16, 2009 at 5:03 AM, Vijay K Pandey <VP...@mdes.ms.gov> wrote:
> Hello Users,
>
> We have been using JackRabbit in production env from last couple of years (currently 1.5) and we have around 5 million nodes in the repository.
>
> We have come across a new business rule in our system where we have to add couple of  "new properties" on some specific condition to any new node that we add to the repository.
>
> My question is should we go ahead and have a mixin type for this or add these properties as non mandatory to the primary node type.
>
> Any advise will be really appreciated.
>
> Thanks
> Vijay
>

Re: Deleting Version

Posted by Sébastien Launay <se...@gmail.com>.
Hi Mohinder,

You can find answers about version history deletion in the following threads:

http://markmail.org/message/7aildokt74yeoar5
http://markmail.org/message/nhbwe7o3c7pd4sga

--
Sébastien Launay

should we have mixin type or add new non mandatory properties to the primary type node

Posted by Vijay K Pandey <VP...@mdes.ms.gov>.
Hello Users,

We have been using JackRabbit in production env from last couple of years (currently 1.5) and we have around 5 million nodes in the repository.

We have come across a new business rule in our system where we have to add couple of  "new properties" on some specific condition to any new node that we add to the repository.

My question is should we go ahead and have a mixin type for this or add these properties as non mandatory to the primary node type.

Any advise will be really appreciated.

Thanks
Vijay

Deleting Version

Posted by Mohinder Singh <ms...@swri.org>.
I am trying to remove the latest version and getting exception thrown.

 

Code is:

      VersionHistory vh = fileNode.getVersionHistory();

      VersionIterator vi = vh.getAllVersions();

      while(vi.hasNext())

            latestVersion = vi.nextVersion();

            

      vh.removeVersion(latestVersion.getName());

 

Exception is:

 

javax.jcr.ReferentialIntegrityException: Unable to remove version. At least
once referenced.

 

Any clues?

Thanks,

Mohinder

 

-----Original Message-----
From: Alexander Klimetschek [mailto:aklimets@day.com] 
Sent: Friday, October 09, 2009 2:50 AM
To: users@jackrabbit.apache.org
Subject: Re: Aborting Checkout

 

On Thu, Oct 8, 2009 at 20:40, Mohinder Singh <ms...@swri.org> wrote:

> If I checkout() a node, then its non-versionable tree becomes
write-enabled.

> How do I abort (don't want to make changes) this checkout() so that nodes

> tree is read-only again.

> I do not want to create another version by checkin().

 

I'd say don't change anything (session.refresh()), checkin() and

delete the unnecessary version.

 

Regards,

Alex

 

-- 

Alexander Klimetschek

alexander.klimetschek@day.com


Re: Aborting Checkout

Posted by Alexander Klimetschek <ak...@day.com>.
On Thu, Oct 8, 2009 at 20:40, Mohinder Singh <ms...@swri.org> wrote:
> If I checkout() a node, then its non-versionable tree becomes write-enabled.
> How do I abort (don't want to make changes) this checkout() so that nodes
> tree is read-only again.
> I do not want to create another version by checkin().

I'd say don't change anything (session.refresh()), checkin() and
delete the unnecessary version.

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com

Aborting Checkout

Posted by Mohinder Singh <ms...@swri.org>.
If I checkout() a node, then its non-versionable tree becomes write-enabled.
How do I abort (don't want to make changes) this checkout() so that nodes
tree is read-only again.
I do not want to create another version by checkin().
Thanks.


RE: RMI/ Oracle/ PersistenceManager/Version State Exception

Posted by Mohinder Singh <ms...@swri.org>.
Even following code worked:
	OraclePersistenceManager pm = new OraclePersistenceManager();
	
pm.getClass().getClassLoader().loadClass("oracle.jdbc.OracleDriver");

But getting the same " Could not load class oracle.jdbc.OracleDriver"
exception.


-----Original Message-----
From: Mohinder Singh [mailto:mohinder.singh@swri.org] 
Sent: Wednesday, October 07, 2009 1:18 PM
To: users@jackrabbit.apache.org
Subject: RE: RMI/ Oracle/ PersistenceManager/Version State Exception

Thanks for putting me on the track again.

The log shows that PersistenceManger could not load
"oracle.jdbc.OracleDriver" class.

 

07.10.2009 13:07:07 *INFO * LocalFileSystem: LocalFileSystem initialized at
path .\version

07.10.2009 13:07:07 *ERROR* RepositoryImpl: failed to start Repository:
Cannot instantiate persistence manager
org.apache.jackrabbit.core.state.db.OraclePersistenceManager: Could not load
class oracle.jdbc.OracleDriver: ...

 

I added following line in my code (and no exception was thrown):

         try      {

              String driverName = "oracle.jdbc.OracleDriver";

              Class.forName(driverName);

          } catch (ClassNotFoundException e) {

             e.printStackTrace();

             return;

          }

 

Any (more) help? 

 

Thanks,

Mohinder

 

-----Original Message-----
From: Alexander Klimetschek [mailto:aklimets@day.com] 
Sent: Wednesday, October 07, 2009 12:53 PM
To: users@jackrabbit.apache.org
Subject: Re: RMI/ Oracle/ PersistenceManager/Version State Exception

 

On Wed, Oct 7, 2009 at 17:43, Mohinder Singh <ms...@swri.org> wrote:

> Following code:

>        repository = new URLRemoteRepository("http://localhost:8181/rmi");

>        Session session = repository.login(new SimpleCredentials("mps",
"passwd".toCharArray()));

> 

> Works fine with Derby. As soon as I change to Oracle, as below:

> -

>        <PersistenceManager
class="org.apache.jackrabbit.core.state.db.OraclePersistenceManager">

>          <param name="url"
value="jdbc:oracle:thin:@dev-repo-vm.tspi.fer.org:1521:orcldev"/>

>          <param name="user" value="u1"/>

>          <param name="password" value="p1"/>

>          <param name="externalBLOBs" value="false"/>

>          <param name="schemaObjectPrefix" value="version_"/>

>        </PersistenceManager>

> 

> I get following exception:

> 

> javax.jcr.RepositoryException: Repository not found: Attribute
javax.jcr.Repository does not exist in servlet context Apache Jackrabbit

>        at
org.apache.jackrabbit.rmi.server.ServerObject.getRepositoryException(ServerO
bject.java:136)

>        at
org.apache.jackrabbit.rmi.server.ServerRepository.login(ServerRepository.jav
a:107)

>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

>        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)

>        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)

>        at java.lang.reflect.Method.invoke(Method.java:597)

>        at
sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)

>        at sun.rmi.transport.Transport$1.run(Transport.java:159)

>        at java.security.AccessController.doPrivileged(Native Method)

>        at sun.rmi.transport.Transport.serviceCall(Transport.java:155)

>        at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)

>        at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:
790)

>        at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:6
49)

>        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.ja
va:886)

>        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:9
08)

>        at java.lang.Thread.run(Thread.java:619)

>        at
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteC
all.java:255)

>        at
sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)

>        at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)

>        at
org.apache.jackrabbit.rmi.server.ServerRepository_Stub.login(Unknown Source)

>        at
org.apache.jackrabbit.rmi.client.ClientRepository.login(ClientRepository.jav
a:107)

>        at
org.apache.jackrabbit.commons.repository.ProxyRepository.login(ProxyReposito
ry.java:90)

>        at
org.apache.jackrabbit.commons.AbstractRepository.login(AbstractRepository.ja
va:53)

>        at org.swri.test.JCRViaRMI.main(JCRViaRMI.java:21)

 

I guess there is some problem starting Jackrabbit (maybe the PM fails

to connect to the DB), hence the javax.jcr.Repository object is not

put into the RMI registry and you get this exception. I would look in

the logs to find out why it doesn't start.

 

Regards,

Alex

 

-- 

Alexander Klimetschek

alexander.klimetschek@day.com



RE: RMI/ Oracle/ PersistenceManager/Version State Exception

Posted by Mohinder Singh <ms...@swri.org>.
Thanks for putting me on the track again.

The log shows that PersistenceManger could not load
"oracle.jdbc.OracleDriver" class.

 

07.10.2009 13:07:07 *INFO * LocalFileSystem: LocalFileSystem initialized at
path .\version

07.10.2009 13:07:07 *ERROR* RepositoryImpl: failed to start Repository:
Cannot instantiate persistence manager
org.apache.jackrabbit.core.state.db.OraclePersistenceManager: Could not load
class oracle.jdbc.OracleDriver: ...

 

I added following line in my code (and no exception was thrown):

         try      {

              String driverName = "oracle.jdbc.OracleDriver";

              Class.forName(driverName);

          } catch (ClassNotFoundException e) {

             e.printStackTrace();

             return;

          }

 

Any (more) help? 

 

Thanks,

Mohinder

 

-----Original Message-----
From: Alexander Klimetschek [mailto:aklimets@day.com] 
Sent: Wednesday, October 07, 2009 12:53 PM
To: users@jackrabbit.apache.org
Subject: Re: RMI/ Oracle/ PersistenceManager/Version State Exception

 

On Wed, Oct 7, 2009 at 17:43, Mohinder Singh <ms...@swri.org> wrote:

> Following code:

>        repository = new URLRemoteRepository("http://localhost:8181/rmi");

>        Session session = repository.login(new SimpleCredentials("mps",
"passwd".toCharArray()));

> 

> Works fine with Derby. As soon as I change to Oracle, as below:

> -

>        <PersistenceManager
class="org.apache.jackrabbit.core.state.db.OraclePersistenceManager">

>          <param name="url"
value="jdbc:oracle:thin:@dev-repo-vm.tspi.fer.org:1521:orcldev"/>

>          <param name="user" value="u1"/>

>          <param name="password" value="p1"/>

>          <param name="externalBLOBs" value="false"/>

>          <param name="schemaObjectPrefix" value="version_"/>

>        </PersistenceManager>

> 

> I get following exception:

> 

> javax.jcr.RepositoryException: Repository not found: Attribute
javax.jcr.Repository does not exist in servlet context Apache Jackrabbit

>        at
org.apache.jackrabbit.rmi.server.ServerObject.getRepositoryException(ServerO
bject.java:136)

>        at
org.apache.jackrabbit.rmi.server.ServerRepository.login(ServerRepository.jav
a:107)

>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

>        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)

>        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)

>        at java.lang.reflect.Method.invoke(Method.java:597)

>        at
sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)

>        at sun.rmi.transport.Transport$1.run(Transport.java:159)

>        at java.security.AccessController.doPrivileged(Native Method)

>        at sun.rmi.transport.Transport.serviceCall(Transport.java:155)

>        at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)

>        at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:
790)

>        at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:6
49)

>        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.ja
va:886)

>        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:9
08)

>        at java.lang.Thread.run(Thread.java:619)

>        at
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteC
all.java:255)

>        at
sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)

>        at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)

>        at
org.apache.jackrabbit.rmi.server.ServerRepository_Stub.login(Unknown Source)

>        at
org.apache.jackrabbit.rmi.client.ClientRepository.login(ClientRepository.jav
a:107)

>        at
org.apache.jackrabbit.commons.repository.ProxyRepository.login(ProxyReposito
ry.java:90)

>        at
org.apache.jackrabbit.commons.AbstractRepository.login(AbstractRepository.ja
va:53)

>        at org.swri.test.JCRViaRMI.main(JCRViaRMI.java:21)

 

I guess there is some problem starting Jackrabbit (maybe the PM fails

to connect to the DB), hence the javax.jcr.Repository object is not

put into the RMI registry and you get this exception. I would look in

the logs to find out why it doesn't start.

 

Regards,

Alex

 

-- 

Alexander Klimetschek

alexander.klimetschek@day.com


Re: RMI/ Oracle/ PersistenceManager/Version State Exception

Posted by Alexander Klimetschek <ak...@day.com>.
On Wed, Oct 7, 2009 at 17:43, Mohinder Singh <ms...@swri.org> wrote:
> Following code:
>        repository = new URLRemoteRepository("http://localhost:8181/rmi");
>        Session session = repository.login(new SimpleCredentials("mps", "passwd".toCharArray()));
>
> Works fine with Derby. As soon as I change to Oracle, as below:
> -
>        <PersistenceManager class="org.apache.jackrabbit.core.state.db.OraclePersistenceManager">
>          <param name="url" value="jdbc:oracle:thin:@dev-repo-vm.tspi.fer.org:1521:orcldev"/>
>          <param name="user" value="u1"/>
>          <param name="password" value="p1"/>
>          <param name="externalBLOBs" value="false"/>
>          <param name="schemaObjectPrefix" value="version_"/>
>        </PersistenceManager>
>
> I get following exception:
>
> javax.jcr.RepositoryException: Repository not found: Attribute javax.jcr.Repository does not exist in servlet context Apache Jackrabbit
>        at org.apache.jackrabbit.rmi.server.ServerObject.getRepositoryException(ServerObject.java:136)
>        at org.apache.jackrabbit.rmi.server.ServerRepository.login(ServerRepository.java:107)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>        at java.lang.reflect.Method.invoke(Method.java:597)
>        at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
>        at sun.rmi.transport.Transport$1.run(Transport.java:159)
>        at java.security.AccessController.doPrivileged(Native Method)
>        at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
>        at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
>        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
>        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
>        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>        at java.lang.Thread.run(Thread.java:619)
>        at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
>        at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
>        at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)
>        at org.apache.jackrabbit.rmi.server.ServerRepository_Stub.login(Unknown Source)
>        at org.apache.jackrabbit.rmi.client.ClientRepository.login(ClientRepository.java:107)
>        at org.apache.jackrabbit.commons.repository.ProxyRepository.login(ProxyRepository.java:90)
>        at org.apache.jackrabbit.commons.AbstractRepository.login(AbstractRepository.java:53)
>        at org.swri.test.JCRViaRMI.main(JCRViaRMI.java:21)

I guess there is some problem starting Jackrabbit (maybe the PM fails
to connect to the DB), hence the javax.jcr.Repository object is not
put into the RMI registry and you get this exception. I would look in
the logs to find out why it doesn't start.

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com

RMI/ Oracle/ PersistenceManager/Version State Exception

Posted by Mohinder Singh <ms...@swri.org>.
Following code:
	repository = new URLRemoteRepository("http://localhost:8181/rmi");
	Session session = repository.login(new SimpleCredentials("mps", "passwd".toCharArray()));

Works fine with Derby. As soon as I change to Oracle, as below:
-
        <PersistenceManager class="org.apache.jackrabbit.core.state.db.OraclePersistenceManager">
          <param name="url" value="jdbc:oracle:thin:@dev-repo-vm.tspi.fer.org:1521:orcldev"/>
	  <param name="user" value="u1"/>
          <param name="password" value="p1"/>
          <param name="externalBLOBs" value="false"/>
          <param name="schemaObjectPrefix" value="version_"/>
        </PersistenceManager>

I get following exception:

javax.jcr.RepositoryException: Repository not found: Attribute javax.jcr.Repository does not exist in servlet context Apache Jackrabbit
	at org.apache.jackrabbit.rmi.server.ServerObject.getRepositoryException(ServerObject.java:136)
	at org.apache.jackrabbit.rmi.server.ServerRepository.login(ServerRepository.java:107)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
	at sun.rmi.transport.Transport$1.run(Transport.java:159)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:619)
	at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
	at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
	at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)
	at org.apache.jackrabbit.rmi.server.ServerRepository_Stub.login(Unknown Source)
	at org.apache.jackrabbit.rmi.client.ClientRepository.login(ClientRepository.java:107)
	at org.apache.jackrabbit.commons.repository.ProxyRepository.login(ProxyRepository.java:90)
	at org.apache.jackrabbit.commons.AbstractRepository.login(AbstractRepository.java:53)
	at org.swri.test.JCRViaRMI.main(JCRViaRMI.java:21)