jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From saraheg <sara...@gmail.com>
Subject Issues while importing.
Date Thu, 07 Aug 2008 16:35:02 GMT

Hello.  I am getting an intermittent error while doing an import.  I export 3
base nodes site, foo, and bar.
*Sometimes I can do the import with NO errors at all.


The whole error stacktrace is sometimes shown, sometimes not. The error is
never thrown (it appears to be a lucene error).  My temp fix for this is to
delete the index dir after the import, it will rebuild itself when the site
that uses this starts up, and works correctly, otherwise a search of the
repo has missing data (i can see the missing data if i do an export of the
new repo).

Any idea what is causing this error?

Do the import/export times look right? They seem extremly long to me.

total time to export is 14 mins (also very long)! using exportSystemView
with NO binaray data all data is very nested..no nodes have more than 300
children

I am exporting using the
org.apache.jackrabbit.core.persistence.bundle.MSSqlPersistenceManager
PersistenceManager, and importing using
org.apache.jackrabbit.core.persistence.bundle.BundleFsPersistenceManager

Jackrabbit version 1.4
jdk 1.5

The exported xmls are: 



site-1.xml : 5.8M
foo-1.xml : 7.6M
bar-1.xml :  is 8M





start import=Aug 07,2008 09:58
custom node types registered:Aug 07,2008 09:58
importing site:Aug 07,2008 09:58
saving site:Aug 07,2008 09:58
[2008-08-07 10:02:12,103] ERROR [IndexMerger]
[org.apache.jackrabbit.core.query.lucene.IndexMerger] Error while merging
indexes: java.io.IOException: Directory was previously created with a
different LockFactory instance; please pass null as the lockFactory instance
and use setLockFactory to change it
site imported:Aug 07,2008 10:02
importing foo:Aug 07,2008 10:02
saving foo:Aug 07,2008 10:02
[2008-08-07 10:06:24,343] ERROR [resin-tcp-connection-127.0.0.4:6800-9]
[org.apache.jackrabbit.core.SearchManager] Error indexing node.
java.io.IOException: Directory was previously created with a different
LockFactory instance; please pass null as the lockFactory instance and use
setLockFactory to change it
        at
org.apache.lucene.store.FSDirectory.getDirectory(FSDirectory.java:192)
        at
org.apache.jackrabbit.core.query.lucene.PersistentIndex.<init>(PersistentIndex.java:63)
        at
org.apache.jackrabbit.core.query.lucene.MultiIndex.getOrCreateIndex(MultiIndex.java:581)
        at
org.apache.jackrabbit.core.query.lucene.MultiIndex$CreateIndex.execute(MultiIndex.java:1631)
        at
org.apache.jackrabbit.core.query.lucene.MultiIndex.executeAndLog(MultiIndex.java:936)
        at
org.apache.jackrabbit.core.query.lucene.MultiIndex.commitVolatileIndex(MultiIndex.java:983)
        at
org.apache.jackrabbit.core.query.lucene.MultiIndex.flush(MultiIndex.java:868)
        at
org.apache.jackrabbit.core.query.lucene.MultiIndex.update(MultiIndex.java:429)
        at
org.apache.jackrabbit.core.query.lucene.SearchIndex.updateNodes(SearchIndex.java:496)
        at
org.apache.jackrabbit.core.SearchManager.onEvent(SearchManager.java:495)
        at
org.apache.jackrabbit.core.observation.EventConsumer.consumeEvents(EventConsumer.java:231)
        at
org.apache.jackrabbit.core.observation.ObservationDispatcher.dispatchEvents(ObservationDispatcher.java:201)
        at
org.apache.jackrabbit.core.observation.EventStateCollection.dispatch(EventStateCollection.java:425)
        at
org.apache.jackrabbit.core.state.SharedItemStateManager$Update.end(SharedItemStateManager.java:721)
        at
org.apache.jackrabbit.core.state.SharedItemStateManager.update(SharedItemStateManager.java:857)
        at
org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemStateManager.java:324)
        at
org.apache.jackrabbit.core.state.XAItemStateManager.update(XAItemStateManager.java:313)
        at
org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemStateManager.java:300)
        at
org.apache.jackrabbit.core.state.SessionItemStateManager.update(SessionItemStateManager.java:306)
        at org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:1244)
        at org.apache.jackrabbit.core.SessionImpl.save(SessionImpl.java:896)
        at
com.metrowerks.mdp2.channels.ChannelManagerSingleton.importSection(ChannelManagerSingleton.java:1316)
        at
com.metrowerks.mdp2.channels.ChannelManagerSingleton.importRepository(ChannelManagerSingleton.java:1358)
        at
com.metrowerks.kpimdp.deploy.BundledDeployer.deploy(BundledDeployer.java:111)
        at
com.metrowerks.kpimdp.deploy.action.DeploySaveAction.doActionAfterPermissionCheck(DeploySaveAction.java:38)
        at
com.metrowerks.kpimdp.permissions.action.CheckPermissionsAction.doAction(CheckPermissionsAction.java:32)
        at
com.metrowerks.mdp2.action.LoginReqAction.execute(LoginReqAction.java:50)
        at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
        at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
        at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
        at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:153)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:91)
        at
com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:103)
        at
com.metrowerks.mdp2.logging.PageViewFilter.doFilter(PageViewFilter.java:132)
        at
com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:73)
        at
com.metrowerks.mdp2.web.cms.JackrabbitSessionRequestFilter.doFilter(JackrabbitSessionRequestFilter.java:57)
        at
com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:73)
        at
com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:175)
        at
com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:240)
        at
com.caucho.server.hmux.HmuxRequest.handleRequest(HmuxRequest.java:424)
        at com.caucho.server.port.TcpConnection.run(TcpConnection.java:481)
        at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:685)
        at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:607)
        at java.lang.Thread.run(Thread.java:619)
foo imported:Aug 07,2008 10:06
importing bar:Aug 07,2008 10:06
saving bar:Aug 07,2008 10:07
[2008-08-07 10:10:53,160] ERROR [resin-tcp-connection-127.0.0.4:6800-9]
[org.apache.jackrabbit.core.SearchManager] Error indexing node.
java.io.IOException: Directory was previously created with a different
LockFactory instance; please pass null as the lockFactory instance and use
setLockFactory to change it
        at
org.apache.lucene.store.FSDirectory.getDirectory(FSDirectory.java:192)
        at
org.apache.jackrabbit.core.query.lucene.PersistentIndex.<init>(PersistentIndex.java:63)
        at
org.apache.jackrabbit.core.query.lucene.MultiIndex.getOrCreateIndex(MultiIndex.java:581)
        at
org.apache.jackrabbit.core.query.lucene.MultiIndex$CreateIndex.execute(MultiIndex.java:1631)
        at
org.apache.jackrabbit.core.query.lucene.MultiIndex.executeAndLog(MultiIndex.java:936)
        at
org.apache.jackrabbit.core.query.lucene.MultiIndex.commitVolatileIndex(MultiIndex.java:983)
        at
org.apache.jackrabbit.core.query.lucene.MultiIndex.checkVolatileCommit(MultiIndex.java:961)
        at
org.apache.jackrabbit.core.query.lucene.MultiIndex.update(MultiIndex.java:422)
        at
org.apache.jackrabbit.core.query.lucene.SearchIndex.updateNodes(SearchIndex.java:496)
        at
org.apache.jackrabbit.core.SearchManager.onEvent(SearchManager.java:495)
        at
org.apache.jackrabbit.core.observation.EventConsumer.consumeEvents(EventConsumer.java:231)
        at
org.apache.jackrabbit.core.observation.ObservationDispatcher.dispatchEvents(ObservationDispatcher.java:201)
        at
org.apache.jackrabbit.core.observation.EventStateCollection.dispatch(EventStateCollection.java:425)
        at
org.apache.jackrabbit.core.state.SharedItemStateManager$Update.end(SharedItemStateManager.java:721)
        at
org.apache.jackrabbit.core.state.SharedItemStateManager.update(SharedItemStateManager.java:857)
        at
org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemStateManager.java:324)
        at
org.apache.jackrabbit.core.state.XAItemStateManager.update(XAItemStateManager.java:313)
        at
org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemStateManager.java:300)
        at
org.apache.jackrabbit.core.state.SessionItemStateManager.update(SessionItemStateManager.java:306)
        at org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:1244)
        at org.apache.jackrabbit.core.SessionImpl.save(SessionImpl.java:896)
        at
com.metrowerks.mdp2.channels.ChannelManagerSingleton.importSection(ChannelManagerSingleton.java:1316)
        at
com.metrowerks.mdp2.channels.ChannelManagerSingleton.importRepository(ChannelManagerSingleton.java:1364)
        at
com.metrowerks.kpimdp.deploy.BundledDeployer.deploy(BundledDeployer.java:111)
        at
com.metrowerks.kpimdp.deploy.action.DeploySaveAction.doActionAfterPermissionCheck(DeploySaveAction.java:38)
        at
com.metrowerks.kpimdp.permissions.action.CheckPermissionsAction.doAction(CheckPermissionsAction.java:32)
        at
com.metrowerks.mdp2.action.LoginReqAction.execute(LoginReqAction.java:50)
        at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
        at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
        at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
        at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:153)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:91)
        at
com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:103)
        at
com.metrowerks.mdp2.logging.PageViewFilter.doFilter(PageViewFilter.java:132)
        at
com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:73)
        at
com.metrowerks.mdp2.web.cms.JackrabbitSessionRequestFilter.doFilter(JackrabbitSessionRequestFilter.java:57)
        at
com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:73)
        at
com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:175)
        at
com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:240)
        at
com.caucho.server.hmux.HmuxRequest.handleRequest(HmuxRequest.java:424)
        at com.caucho.server.port.TcpConnection.run(TcpConnection.java:481)
        at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:685)
        at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:607)
        at java.lang.Thread.run(Thread.java:619)
bar imported:Aug 07,2008 10:10
index dir deleted:Aug 07,2008 10:10
import complete:Aug 07,2008 10:10


public void importSection(Session jrSession, String path, String section,
int environmentId) throws IOException, RepositoryException{
      Timestamp timestamp = null;
      DateFormat dateFormatter = new SimpleDateFormat("MMM dd,yyyy hh:mm");
      timestamp = new Timestamp(System.currentTimeMillis());
      System.out.println("importing "+ section +":" +
dateFormatter.format(timestamp)  );
      InputStream siteIn = new FileInputStream(path + "/" + section + "-" +
environmentId + ".xml");
      jrSession.importXML("/", siteIn,
ImportUUIDBehavior.IMPORT_UUID_COLLISION_REPLACE_EXISTING);
      timestamp = new Timestamp(System.currentTimeMillis());
      System.out.println("saving " + section + ":" +
dateFormatter.format(timestamp)  );
      jrSession.save();
      jrSession.logout();
      timestamp = new Timestamp(System.currentTimeMillis());
      System.out.println(section + " imported:" +
dateFormatter.format(timestamp)  );
   }

   public void importRepository(String path, int environmentId, String
repositoryXMLPath, String repositoryPath, String username, String password)
throws RepositoryException, IOException, InterruptedException,
DeleteRmRfException {
    Timestamp timestamp = null;
    DateFormat dateFormatter = new SimpleDateFormat("MMM dd,yyyy hh:mm");

    timestamp = new Timestamp(System.currentTimeMillis());
    System.out.println("start import=" + dateFormatter.format(timestamp)  );
    Session jrSession = null;
    Repository repository = null;
    try {
      repository = new TransientRepository(repositoryXMLPath,
repositoryPath);
      SimpleCredentials creds = new SimpleCredentials(username,
password.toCharArray());
      jrSession = repository.login(creds);

      //register the name space
      NamespaceRegistry nsReg =
jrSession.getWorkspace().getNamespaceRegistry();

      nsReg.registerNamespace("test", "http://www.test.com/test");

      JackrabbitNodeTypeManager manager = (JackrabbitNodeTypeManager)
jrSession.getWorkspace().getNodeTypeManager();
      manager.registerNodeTypes(new FileInputStream(nodeTypeConfig),
JackrabbitNodeTypeManager.TEXT_X_JCR_CND);
      jrSession.save();
      jrSession.logout();
      shutdownRepository(repository);
      repository  = null;

      timestamp = new Timestamp(System.currentTimeMillis());
      System.out.println("custom node types registered:" +
dateFormatter.format(timestamp)  );

      repository = new TransientRepository(repositoryXMLPath,
repositoryPath);
      jrSession = repository.login(creds);
      importSection(jrSession, path, "site", environmentId);
      shutdownRepository(repository);
      repository  = null;

      repository = new TransientRepository(repositoryXMLPath,
repositoryPath);
      jrSession = repository.login(creds);
      importSection(jrSession, path, "foo", environmentId);
      shutdownRepository(repository);
      repository  = null;

      repository = new TransientRepository(repositoryXMLPath,
repositoryPath);
      jrSession = repository.login(creds);
      importSection(jrSession, path, "bar", environmentId);
      shutdownRepository(repository);


      repository = null;
      jrSession = null;
      
      
        deleteDir(repositoryPath + "/workspaces/default/index");
        timestamp = new Timestamp(System.currentTimeMillis());
        System.out.println("index dir deleted:" +
dateFormatter.format(timestamp)  );
      
    } finally {
      if (jrSession != null){
        jrSession.logout();
      }
      if (repository != null){
        shutdownRepository(repository);
      }
      repository = null;

    }
    timestamp = new Timestamp(System.currentTimeMillis());
    System.out.println("import complete:" + dateFormatter.format(timestamp) 
);
   }
-- 
View this message in context: http://www.nabble.com/Issues-while-importing.-tp18874536p18874536.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Mime
View raw message