5 Replies Latest reply on Feb 13, 2013 7:21 AM by estel1212

    Problem with loading cnd file in Jboss-as-7

      I already try this in standalone-modeshape.xml by trying modeshape and it has worked.

      https://community.jboss.org/message/795112#795112

       

      Now I tray to integrate this in my project also in my standard.xml in JBoss-as-7 and I still have some problem:

      I use Modeshape 3.1.Final:

       

      The configuration in standalone.xml looks like this:

       

      After I add extension <extension module="org.modeshape"/> I do following:

       

               <subsystem xmlns="urn:jboss:domain:infinispan:1.2" default-cache-container="hibernate">

                     ...

                <cache-container name="modeshape" default-cache="orc">

                      <local-cache name="orc">

                          <transaction mode="NON_XA"/>

                          <file-store relative-to="jboss.server.data.dir" path="modeshape/store/orc" passivation="false" purge="false"/>

                      </local-cache>

                  </cache-container>

              </subsystem>

              <subsystem xmlns="urn:jboss:domain:modeshape:1.0">

                  <repository name="orc" cache-name="orc" cache-container="modeshape">

                        <node-types>

                          <node-type>orc.cnd</node-type>

                        </node-types>

                      <workspaces default-workspace="orc">

                          <workspace name="orc"/>

                          <initial-content>

                              orc-initial-content-default.xml

                          </initial-content>

                      </workspaces>

                      <external-sources>

                          <source name="fsSource" classname="org.modeshape.connector.filesystem.FileSystemConnector" cacheTtlSeconds="1" readonly="true" directoryPath="/tmp">

                              <projection>

                                  orc:/files/tmp => /

                              </projection>

                          </source>

                      </external-sources>

                  </repository>

              </subsystem>

              <subsystem xmlns="urn:jboss:domain:security:1.1">

                     ....

                     <security-domain name="modeshape-security" cache-type="default">

                          <authentication>

                              <login-module code="UsersRoles" flag="required">

                                  <module-option name="usersProperties" value="modeshape-users.properties"/>

                                  <module-option name="rolesProperties" value="modeshape-roles.properties"/>

                              </login-module>

                          </authentication>

                      </security-domain>

                  </security-domains>

              </subsystem>

       

      ---"orc.cnd" looks like this-------:

       

      <jcr='http://www.jcp.org/jcr/1.0'>

      <nt='http://www.jcp.org/jcr/nt/1.0'>

      <mix='http://www.jcp.org/jcr/mix/1.0'>

      <orc='http://www.orc.org/jcr/orcs/1.0'>

       

      //------------------------------------------------------------------------------

      // N O D E T Y P E S

      //------------------------------------------------------------------------------

       

      [orc:patient] > nt:unstructured orderable

        - orc:name (string)

        - orc:vorname (string)

        - orc:dob (date)

        + * (orc:patientcase)

       

      [orc:patientcase] > nt:unstructured

        - orc:name (string)

        + * (orc:procedure)

       

      [orc:procedure] > nt:unstructured

        - orc:name (string)

        + * (nt:file)

       

      ---- "orc-initial-content-default.xml" looks like this ----------

       

      <?xml version="1.0" encoding="UTF-8"?>

      <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0">

          <files/>

      </jcr:root>

       

      Staring JBoss and  now my problem is that: when I bind the repository "orc" through "webdav" and I navigate to this link : "dav://admin@localhost:8080/modeshape-webdav/orc/orc/jcr:system/jcr:nodeTypes" I can't find my created  nodetypes. I already delete "res.index" in modeshape module and my "orc.cnd" is placed  under "jboss/modules/org/modeshape/main/res".

      Know somebody, where is the problem? Did I miss soemthing?

        • 1. Re: Problem with loading cnd file in Jboss-as-7
          hchiorean

          Hi,

           

          What version of AS7 are you using ?

           

          You can also try to check if a node type is loaded by using the rest service like so: http://<host:port>/modeshape-rest/<repositoryName>/<workspaceName>/nodetypes/<nodeName>

          • 2. Re: Problem with loading cnd file in Jboss-as-7

            I use JBoss as 7.1.1 and when I use rest to access my repository: "http://localhost:8080/modeshape-rest/orc" I get these errors:

             

             

            {
              "exception": "Error while starting 'orc' repository: null",
              "stacktrace": "javax.jcr.RepositoryException: Error while starting 'orc' repository: nullntat org.modeshape.jcr.JcrRepository.login(JcrRepository.java:613)nt
            at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:149)ntat org.modeshape.web.jcr.RepositoryManager.getSession(RepositoryManager.java:116)nt
            at org.modeshape.web.jcr.rest.handler.AbstractHandler.getSession(AbstractHandler.java:63)ntat org.modeshape.web.jcr.rest.handler.RestRepositoryHandler.getWorkspaces(RestRepositoryHandler.java:55)nt
            at org.modeshape.web.jcr.rest.ModeShapeRestService.getWorkspaces(ModeShapeRestService.java:176)ntat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)nt
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)ntat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)nt
            at java.lang.reflect.Method.invoke(Method.java:597)ntat org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:155)nt
            at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:257)ntat org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:222)nt
            at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:211)ntat org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:525)nt
            at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:502)ntat org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119)nt
            at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208)nt
            at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55)nt
            at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50)nt
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)ntat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)nt
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)ntat org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)nt
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)ntat org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:489)nt
            at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)ntat org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)nt
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)ntat org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)nt
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)ntat org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)nt
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671)nt
            at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930)ntat java.lang.Thread.run(Thread.java:662)n
            Caused by: java.lang.NullPointerExceptionntat org.modeshape.jcr.RepositoryNodeTypeManager$NodeTypes.validate(RepositoryNodeTypeManager.java:2524)nt
            at org.modeshape.jcr.RepositoryNodeTypeManager$NodeTypes.validate(RepositoryNodeTypeManager.java:2420)nt
            at org.modeshape.jcr.RepositoryNodeTypeManager.registerNodeTypes(RepositoryNodeTypeManager.java:500)ntat org.modeshape.jcr.NodeTypesImporter.importNodeTypes(NodeTypesImporter.java:75)nt
            at org.modeshape.jcr.JcrRepository$RunningState.postInitialize(JcrRepository.java:1260)nt
            t org.modeshape.jcr.JcrRepository.doStart(JcrRepository.java:358)ntat org.modeshape.jcr.JcrRepository.login(JcrRepository.java:611)nt... 34 moren"
            }
            

             

            Do you have an idea, thanks.

             

            Radouane

            • 3. Re: Problem with loading cnd file in Jboss-as-7
              hchiorean

              It seems there's a bug in the node type manager, when importing orc.cnd.

               

              I've opened https://issues.jboss.org/browse/MODE-1807 to handle this.

               

              Message was edited by: Horia Chiorean

              • 4. Re: Problem with loading cnd file in Jboss-as-7

                ok, you already do it with Jira.. thanks

                • 5. Re: Problem with loading cnd file in Jboss-as-7

                  Now evry thing works fine, I don't think, this is a bug ...

                  What I do, I create my cnd file with cnd editor plugin from eclipse and not manualy as I did it before, I copy then this created cnd file in JBoss and every thing works fine, now I see that my node types are created navigating to web-dav in "jcr:system/jcr:nodeTypes" under my workspace :

                   

                   

                  //------------------------------------------------------------------------------
                  // N A M E S P A C E S
                  //------------------------------------------------------------------------------
                  <jcr='http://www.jcp.org/jcr/1.0'>
                  <nt='http://www.jcp.org/jcr/nt/1.0'>
                  <mix='http://www.jcp.org/jcr/mix/1.0'>
                  <orc='http://www.orc.org/jcr/orcs/1.0'>
                  //------------------------------------------------------------------------------
                  // N O D E T Y P E S
                  //------------------------------------------------------------------------------
                  
                  [orc:patient] > nt:unstructured orderable query primaryitem orc:patientcase
                    - orc:name (STRING) VERSION
                    - orc:vorname (STRING) VERSION
                    - orc:dob (DATE) VERSION
                    + orc:patientcase (orc:patientcase) = orc:patientcase VERSION sns
                  
                  [orc:patientcase] > nt:unstructured orderable query primaryitem orc:procedure
                    - orc:name (STRING)
                    + orc:procedure (orc:procedure) = orc:procedure VERSION sns
                  
                  [orc:procedure] > nt:unstructured
                    - orc:name (STRING) VERSION
                    + nt:paths (nt:file) = nt:file VERSION
                  

                   

                  Before it was like this:

                   

                  <jcr='http://www.jcp.org/jcr/1.0'>
                  <nt='http://www.jcp.org/jcr/nt/1.0'>
                  <mix='http://www.jcp.org/jcr/mix/1.0'>
                  <orc='http://www.orc.org/jcr/orcs/1.0'>
                  
                  //------------------------------------------------------------------------------
                  // N O D E T Y P E S
                  //------------------------------------------------------------------------------
                  
                  [orc:patient] > nt:unstructured orderable
                    - orc:name (string)
                    - orc:vorname (string)
                    - orc:dob (date)
                    + * (orc:patientcase)
                  
                  [orc:patientcase] > nt:unstructured
                    - orc:name (string)
                    + * (orc:procedure)
                  
                  [orc:procedure] > nt:unstructured
                    - orc:name (string)
                    + * (nt:file)
                  

                   

                  That means the cnd file has some errors.

                   

                  I hope this helps .

                   

                  Radouane