Benjamin Brown | 1 Jun 2009 16:43

RE: Auditing required - JCR hack added

> -----Original Message-----
> From: Benjamin Brown [mailto:benjamin.brown <at> thisisnumero.com]
> Sent: 29 May 2009 10:48
> To: users <at> jackrabbit.apache.org
> Subject: RE: Auditing required - JCR hack added
> 
> That looks ideal - I wonder why I missed that...!
> 
> Thanks,
> 
> Benjamin
> 
> > -----Original Message-----
> > From: Jukka Zitting [mailto:jukka.zitting <at> gmail.com]
> > Sent: 29 May 2009 10:50
> > To: users <at> jackrabbit.apache.org
> > Subject: Re: Auditing required - JCR hack added
> >
> > Hi,
> >
> > On Fri, May 29, 2009 at 11:25 AM, Benjamin Brown
> > <benjamin.brown <at> thisisnumero.com> wrote:
> > > To do this I've implemented a NodeStateListener class - which seems to
> > do
> > > everything that I need such as watching for added/removed nodes etc
> etc.
> >
> > Couldn't you use the standard observation mechanism in JCR? That way
> > you wouldn't need to depend on Jackrabbit internals.
> >
(Continue reading)

aasoj j | 1 Jun 2009 23:43
Picon

Re: Scalability issues while storing large number of small properties

Hi,

Thanks for your suggestions.

I allocated 1GB memory and still my application crashed everytime while the
tree was getting created. I then thought of disabling indexes using my own
analyzer and filter. And to my surprise even then the application crashed.

public class EmptyAnalyzer extends Analyzer {
    public TokenStream tokenStream(String arg0, Reader arg1) {
        return new EmptyFilter(new KeywordTokenizer(arg1));
    }

    private class EmptyFilter extends TokenFilter {
        public EmptyFilter(KeywordTokenizer keywordTokenizer) {
            super(keywordTokenizer);
        }
        public Token next(Token result) throws IOException {
            return null;
        }
    }
}

*Repository configuration
*    <Workspace>
                ....
        <SearchIndex
class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
            <param name="path" value="${wsp.home}/index"/>
            <param name="textFilterClasses"
(Continue reading)

Micah Whitacre | 2 Jun 2009 16:36
Picon
Gravatar

JNDI Support and responding to JNDI Events

Hello All,
  I currently have a JEE application which uses a Jackrabbit
repository under the covers.  The repository resides in an Oracle
database and currently the connection to the database is through JDBC
URLs in the repository.xml.  I was presented with the requirement that
for security reasons the database connection password with need to be
changes with a regular frequency.  Changing the password will require
the JEE application to be taken down to notice the change in the
repository.xml.  In the interest of preventing regular downtime, I'm
looking at how I can accomplish this.
  JNDI seems like a possibility at accomplishing this by configuring
the repository.xml to pull its connections that way instead of putting
the JDBC strings directly in the xml file.  I saw that Oracle JNDI
support for the PersistenceManager[1] is available.  However the File
system seems to only support JNDI or Oracle but not both.  So based
off of this, I'd need to probably roll my own FileSystem that would
support both.  Is that correct?  JNDI
support is only part of the possible solution.  I'd also would need
the implementations to respond to JNDI events.[3]  It doesn't seem
like the code does this.  Looking through the ConnectionFactory, the
information is only read once.  Or am I missing something?

Note I'm currently based on Jackrabbit 1.4.6 and the JEE application
is hosted on Websphere Application Server.

Thanks for your help,
Micah

[1] - https://issues.apache.org/jira/browse/JCR-948
[2] - https://issues.apache.org/jira/browse/JCR-942
(Continue reading)

sjtirtha | 2 Jun 2009 22:53
Picon

Runnig jackrabbit as web application

Hi,

I'm trying to run jackrabbit as a web application(wicket)
Unfortunately I got error during the login in the TransientRepository.
The DB that is used is Derby.

I wrote a Test class to test the login and it works.
Does anybody know, why it does not work if I run it as a web application?

Steve

I attached you the class that executes the lgin into TransientRepository

##########################################################
import javax.jcr.Repository;
import javax.jcr.Session;
import javax.jcr.SimpleCredentials;

import org.apache.jackrabbit.core.TransientRepository;

public class JcrUtil {
    private static Session session;

    public static Session getSession() throws Exception{
        if(session == null){
            Repository repository = new TransientRepository();
            session = repository.login(new SimpleCredentials("username",
"password".toCharArray()));
            //session = repository.login("admin");
            System.out.println("Logged in");
(Continue reading)

Jukka Zitting | 3 Jun 2009 09:43
Picon
Gravatar

Re: Auditing required - JCR hack added

Hi,

On Mon, Jun 1, 2009 at 4:43 PM, Benjamin Brown
<benjamin.brown <at> thisisnumero.com> wrote:
> I'm now using this interface but for a NODE_REMOVED event I need to find the node id
> of the now removed node (so I can audit that id as deleted).
> [...]
> How can I get the node id when using javax.jcr.observation.Event or
> org.apache.jackrabbit.core.observation.EventImpl classes?

Can you target your application to the upcoming JCR 2.0 standard? The
JCR 2.0 version of javax.jcr.observation.Event interface contains a
getIdentifier() method that's pretty much what you're looking for.

See the Jackrabbit dev <at>  list for current status of the JCR 2.0
implementation efforts.

BR,

Jukka Zitting

loreii alpha | 3 Jun 2009 15:00
Picon

Re: worspace.move() deadlock

I'm preparing the test case, in the mean time this is the stacktrace :

Thread [DefaultQuartzScheduler_Worker-3] (Suspended)
    Object.wait(long) line: not available [native method] [local variables
unavailable]
    WriterPreferenceReadWriteLock$ReaderLock(Object).wait() line: 485 [local
variables unavailable]
    WriterPreferenceReadWriteLock$ReaderLock.acquire() line: not available
[local variables unavailable]
    DefaultISMLocking$ReadLockImpl.<init>(Sync) line: 78
    DefaultISMLocking$ReadLockImpl.<init>(Sync, DefaultISMLocking$1) line:
72
    DefaultISMLocking.acquireReadLock(ItemId) line: 40
    SharedItemStateManager.acquireReadLock(ItemId) line: 1401
    SharedItemStateManager.hasItemState(ItemId) line: 279
    XAItemStateManager.hasItemState(ItemId) line: 288
    SessionItemStateManager.hasItemState(ItemId) line: 206
    CachingHierarchyManager(HierarchyManagerImpl).hasItemState(ItemId) line:
164
    CachingHierarchyManager.nodeRemoved(NodeState, Path, NodeId) line:
725
    CachingHierarchyManager.nodeRemoved(NodeState, Name, int, NodeId) line:
455
    StateChangeDispatcher.notifyNodeRemoved(NodeState, Name, int, NodeId)
line: 157
    SessionItemStateManager.nodeRemoved(NodeState, Name, int, NodeId) line:
941
    NodeState.notifyNodeRemoved(ChildNodeEntry) line: 871
    NodeState.removeChildNodeEntry(Name, int) line: 388
    XASessionImpl(SessionImpl).move(String, String) line: 1035
(Continue reading)

Arne v.Irmer | 3 Jun 2009 17:03
Picon
Favicon

Re: WebDAV-enabled Root-Folder

Hi Charly,
that was a perfect hint! Now everything works perfectly.

For anyone who wants to build a server with a webdav-enabled Root-Folder (i.e. http://localhost:8080 )
here is a small cooking recipe:
Normally the jackrabbit-webdav servlet can be reached at
http://localhost:8080/jackrabbit-webapp/repository/default/ 
We have to remove three parts from that URL.
1) "jackrabbit-webapp"
To remove "jackrabbit-webapp" from the URL rename "jackrabbit-webapp.war" to "ROOT.war". This will
cause the Servlet-Container to start the URL of all servlets in "ROOT.war" at "/".
Be sure that not other ROOT.war is in the Servlet-Container. In JBoss 4.x.x the ROOT.war resides in
server/deploy/jboss-web.deployer 

2) "repository"
To remove "repository" from the URL open the web.xml in the ROOT.war (aka jackrabbit-webapp.war) and
replace all "/repository" with "/" 

3) "default" 
To remove "repository" from the URL build the following class and put it in the classpath of your servlet-container:

package my.package;
import javax.jcr.Repository;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.servlet.ServletException;

import org.apache.jackrabbit.j2ee.SimpleWebdavServlet;
import org.apache.jackrabbit.webdav.simple.LocatorFactoryImpl;

(Continue reading)

Sascha.Theves | 3 Jun 2009 17:02
Picon
Favicon

Error when shutting down Jackrabbit with Derby

Hi all,

we are using Jackrabbit Core 1.5.0 and have trouble with the shutdown of
the Derby database. I found an Issue that seems to fit exactly our

problem:

https://issues.apache.org/jira/browse/JCR-1499?page=com.atlassian.jira.p
lugin.system.issuetabpanels%3Acomment-tabpanel

But the Issue is resolved for 1.4.3 and we are using 1.5.0!

Here is our StackTrace:

2009-06-03 15:58:41,820 [OSGi Console] ERROR DatabaseFileSystem - failed
to re-establish connection

java.sql.SQLException: A network protocol error was encountered and the
connection has been terminated: the requested command encountered an
unarchitected and implementation-specific condition for which there was
no architected message

      at
org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown
Source)

      at org.apache.derby.client.am.SqlException.getSQLException(Unknown
Source)

      at org.apache.derby.client.am.Connection.prepareStatement(Unknown
(Continue reading)

loreii alpha | 3 Jun 2009 17:36
Picon

Re: worspace.move() deadlock

Hi Alex,

Follow my test snippet, as you can see no synchronization is done over
thread and if an exception is thrown is simply skipped.
If you run this test the repository stops to work. Probably i'm doing some
mistake, if it is please report to me.
I hope this could be useful.

Cheers
Lore

%<------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

     <at> Override
    public void execute() {
        try{
            Repository repo = JRFactory.getRepository(); //utility class
4load the repo

            //create default directories
            {
                Session session = repo.login(new
SimpleCredentials("username", "password".toCharArray()));
                Node root = session.getRootNode();
                if(!root.hasNode("A"))
                    root.addNode("A","nt:folder");
                if(!root.hasNode("B"))
                    root.addNode("B","nt:folder");
                if(!root.hasNode("D"))
                    root.addNode("D","nt:folder");
(Continue reading)

Alexander Klimetschek | 4 Jun 2009 00:51
Favicon

Re: Scalability issues while storing large number of small properties

On Mon, Jun 1, 2009 at 11:43 PM, aasoj j <aas.ojj <at> gmail.com> wrote:
> *Repository configuration
> *    <Workspace>
>                ....
>        <SearchIndex
> class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
>            <param name="path" value="${wsp.home}/index"/>
>            <param name="textFilterClasses"
> value="org.apache.jackrabbit.extractor.PlainTextExtractor"/>
>            <param name="extractorPoolSize" value="2"/>
>            <param name="supportHighlighting" value="true"/>
>            <param name="analyzer"
> value="repository.jackrabbit.EmptyAnalyzer" />
>        </SearchIndex>
>    </Workspace>

Did you change the workspace.xml?

Regards,
Alex

--

-- 
Alexander Klimetschek
alexander.klimetschek <at> day.com


Gmane