5 Replies Latest reply on Jul 15, 2013 8:15 AM by rhauch

    MS 3 on JBAS5

    nl

      Hi,

       

      i am currently trying to run MS on a JBAS5. Upon starting a repository MS tries to bind the JcrRepository to JNDI. But this fails with the following exception:

       

      {code}

      javax.naming.CommunicationException [Root exception is java.io.NotSerializableException: org.modeshape.jcr.JcrRepository]

          at org.jnp.interfaces.NamingContext.bind(NamingContext.java:701)

          at org.jnp.interfaces.NamingContext.bind(NamingContext.java:635)

          at javax.naming.InitialContext.bind(InitialContext.java:400)

          at org.modeshape.jcr.JcrRepository$RunningState.bindIntoJndi(JcrRepository.java:1601)

          at org.modeshape.jcr.JcrRepository$RunningState.<init>(JcrRepository.java:1181)

          at org.modeshape.jcr.JcrRepository$RunningState.<init>(JcrRepository.java:926)

          at org.modeshape.jcr.JcrRepository.doStart(JcrRepository.java:359)

          at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:603)

      {code}

       

      Obviously, JcrRepository does implement java.io.Serializable. But I found no way to tell MS not bind to JNDI.

       

      Any ideas?

       

      Thanks, Niels

        • 1. Re: MS 3 on JBAS5
          rhauch

          To tell ModeShape not to register the repository into JNDI, simply set the "jndiName" field in your repository configuration JSON file to a blank string value.

          1 of 1 people found this helpful
          • 2. Re: MS 3 on JBAS5
            nl

            Thanks Randall,

             

            and yet another question:

             

            I switched my file-based binary store to a database (oracle) store. But upon adding a node and calling save() on the JcrSession I get

             

             

            {code}

            org.modeshape.jcr.value.binary.BinaryStoreException: java.sql.SQLException: Ungültiger Vorgang bei Nur-Weiterleiten-Ergebnismenge: first

                at org.modeshape.jcr.value.binary.Database.asString(Database.java:622)

                at org.modeshape.jcr.value.binary.DatabaseBinaryStore.getExtractedText(DatabaseBinaryStore.java:235)

                at org.modeshape.jcr.value.binary.AbstractBinaryStore.getText(AbstractBinaryStore.java:122)

                at org.modeshape.jcr.query.lucene.basic.BasicLuceneSchema.addDynamicField(BasicLuceneSchema.java:278)

                at org.modeshape.jcr.query.lucene.basic.BasicLuceneSchema.nodeInfo(BasicLuceneSchema.java:212)

                at org.modeshape.jcr.query.lucene.basic.BasicLuceneSchema.addToIndex(BasicLuceneSchema.java:406)

                at org.modeshape.jcr.JcrRepository$RepositoryMonitorFactory$2.recordAdd(JcrRepository.java:1875)

                at org.modeshape.jcr.cache.document.WritableSessionCache.persistChanges(WritableSessionCache.java:1088)

                at org.modeshape.jcr.cache.document.WritableSessionCache.save(WritableSessionCache.java:544)

                at org.modeshape.jcr.JcrSession.save(JcrSession.java:1022)

            {code}

             

            The exception message is : "Invalid operation for forward-only result set: first"

             

            Thanks, Niels

            • 3. Re: MS 3 on JBAS5
              rhauch

              Niels, please log a defect for that case. Oracle is not an open source database, so it's difficult for us to test against it. It looks like that error is because Oracle doesn't like us calling "resultSet.first()" on a non-scrollable query (see this discussion). We'll have to re-evaluate whether we even need to call 'first', or whether we should be wrapping that call in a try-catch block and using the exception to signal that we should ignore the operation. (Or, we could make the method non-static, and use the database type to check for Oracle and skip the call entirely in that case.)

              • 4. Re: MS 3 on JBAS5
                nl

                MODE-1992

                 

                Thanks, Niels

                • 5. Re: MS 3 on JBAS5
                  rhauch

                  Thanks!