8 Replies Latest reply on Feb 15, 2016 5:51 AM by Rishi Anand

    How can I access modeshape repository in mysql from modeshape-explorer gui ?

    Rishi Anand Novice

      I am following below tutorial to setup modeshape into wildfly :

      https://docs.jboss.org/author/display/MODE40/Installing+ModeShape+into+Wildfly

       

      and I am using below link for storing data into modeshape sql repository :

      modeshape-examples/modeshape-jdbc-store-example at master · ModeShape/modeshape-examples · GitHub

       

      How can I access data stored in sql repository from modeshape-explorer gui ?

      I want to perform all funtion of adding, deleting and updating information stored in db by web gui.

        • 1. Re: How can I access modeshape repository in mysql from modeshape-explorer gui ?
          Horia Chiorean Master
          I am following below tutorial to setup modeshape into wildfly :

          https://docs.jboss.org/author/display/MODE40/Installing+ModeShape+into+Wildfly

           

          and I am using below link for storing data into modeshape sql repository :

          modeshape-examples/modeshape-jdbc-store-example at master · ModeShape/modeshape-examples · GitHub

          if you are using Wildfly, then the web-explorer is part of the ModeShape WF kit which can be accessed as a webapp (https://docs.jboss.org/author/display/MODE40/Repository+Web+Explorer)

          The example you mention is a standalone example, not a Wildfly example. When using Wildfly your repository and datasources have to be defined as part of the WF configuration.

          • 2. Re: How can I access modeshape repository in mysql from modeshape-explorer gui ?
            Rishi Anand Novice

            I have a very simple use case, I want to store data in sql repository using modeshape and want to access it via web gui interface. Now, How should I proceed ?

             

            I am able to setup jdbc data store using above link and and I am able to access "sample" and "artifact" repository in wildfly. If I am using wildfly for this use case then  can you tell location of files that I need to modify to get sql repo in web gui ? This will help me to know which file to modify.

            If there is some another application server that I should use because of easy configuration then please suggest that one.

            • 3. Re: How can I access modeshape repository in mysql from modeshape-explorer gui ?
              Horia Chiorean Master

              The steps required to do so are roughly (assuming you're using ModeShape 4.5.0.Final)

              1. install the Modeshape WF kit (i.e. unpack the zip)

              2. install the sql driver in WF and define a sql datasource

              3. add a new repository (besides sample and artifacts) and configure it do use the datasource at step 2. You do this by configuring Infinispan to use that particular datasource. You can see an example of how to do this here: modeshape/standalone-modeshape.xml at 4.x · ModeShape/modeshape · GitHub and https://github.com/ModeShape/modeshape/blob/4.x/integration/modeshape-jbossas-integration-tests/src/main/resources/kit/jboss-wf9/standalone/configuration/modeshape/infinispan-test-caches.xml#L68

              If your configuration is correct, after you start the server you should be able to access the web-explorer application and see your repository.

               

              You should be aware though that the Repository Explorer should mainly be used as development/debug tool for looking at repository data, not a tool for writing data into the repository (although it has limited write capability). ModeShape is primarily a JCR implementation and as such, the main interaction should be via the JCR API.

              • 4. Re: How can I access modeshape repository in mysql from modeshape-explorer gui ?
                Rishi Anand Novice

                <datasource jndi-name="java:/mydb" pool-name="my_pool" enabled="true" jta="true" use-java-context="true">

                                     <connection-url>jdbc:mysql://<ip>:<port>/<dbname></connection-url>

                                     <driver>mysql</driver>

                                     <security>

                                            <user-name>root</user-name>

                                            <password><!-- Password --></password>

                                     </security>

                                     <statement>

                                            <prepared-statement-cache-size>100</prepared-statement-cache-size>

                                            <share-prepared-statements/>

                                     </statement>

                                </datasource>

                 

                I have added above data source now how to bind this with a repository. Can you provide some sample code to bind this with mysql ?

                • 5. Re: How can I access modeshape repository in mysql from modeshape-explorer gui ?
                  Horia Chiorean Master

                  the links from my previous post show an example of how you need to configure ModeShape and Infinispan to use a datasource.

                  • 6. Re: How can I access modeshape repository in mysql from modeshape-explorer gui ?
                    Rishi Anand Novice

                    I tried doing above steps as mentioned by you. I am getting below error

                    Error while starting 'artifacts' repository: Unable to invoke method public void org.infinispan.persistence.manager.PersistenceManagerImpl.start() on object of type PersistenceManagerImpl


                    Please Suggest me, what to do ?

                    • 7. Re: How can I access modeshape repository in mysql from modeshape-explorer gui ?
                      Rishi Anand Novice

                      and I am getting below error on consle where server is running :

                       

                      14:40:32,279 ERROR [org.infinispan.persistence.jdbc.TableManipulation] (default task-21) ISPN008011: Error while creating table; used DDL statement: 'CREATE TABLE `ISPN__jdbcRepository`(ID_COLUMN VARCHAR(200) NOT NULL, DATA_COLUMN BYTEA, TIMESTAMP_COLUMN BIGINT, PRIMARY KEY (ID_COLUMN))': com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'BYTEA, TIMESTAMP_COLUMN BIGINT, PRIMARY KEY (ID_COLUMN))' at line 1

                        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

                        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

                        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

                        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)

                        at com.mysql.jdbc.Util.handleNewInstance(Util.java:404)

                        at com.mysql.jdbc.Util.getInstance(Util.java:387)

                        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:939)

                        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3878)

                        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3814)

                        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2478)

                        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2625)

                        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2547)

                        at com.mysql.jdbc.StatementImpl.executeUpdateInternal(StatementImpl.java:1541)

                        at com.mysql.jdbc.StatementImpl.executeLargeUpdate(StatementImpl.java:2605)

                        at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1469)

                        at org.jboss.jca.adapters.jdbc.WrappedStatement.executeUpdate(WrappedStatement.java:430)

                        at org.infinispan.persistence.jdbc.TableManipulation.executeUpdateSql(TableManipulation.java:123)

                        at org.infinispan.persistence.jdbc.TableManipulation.createTable(TableManipulation.java:106)

                        at org.infinispan.persistence.jdbc.TableManipulation.start(TableManipulation.java:149)

                        at org.infinispan.persistence.jdbc.stringbased.JdbcStringBasedStore.initializeConnectionFactory(JdbcStringBasedStore.java:423)

                        at org.infinispan.persistence.jdbc.stringbased.JdbcStringBasedStore.start(JdbcStringBasedStore.java:101)

                        at org.infinispan.persistence.manager.PersistenceManagerImpl.start(PersistenceManagerImpl.java:129)

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

                        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

                        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

                        at java.lang.reflect.Method.invoke(Method.java:498)

                        at org.infinispan.commons.util.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:168)

                        at org.infinispan.factories.AbstractComponentRegistry$PrioritizedMethod.invoke(AbstractComponentRegistry.java:869)

                        at org.infinispan.factories.AbstractComponentRegistry.invokeStartMethods(AbstractComponentRegistry.java:638)

                        at org.infinispan.factories.AbstractComponentRegistry.internalStart(AbstractComponentRegistry.java:627)

                        at org.infinispan.factories.AbstractComponentRegistry.start(AbstractComponentRegistry.java:530)

                        at org.infinispan.factories.ComponentRegistry.start(ComponentRegistry.java:218)

                        at org.infinispan.cache.impl.CacheImpl.start(CacheImpl.java:850)

                        at org.infinispan.manager.DefaultCacheManager.wireAndStartCache(DefaultCacheManager.java:599)

                        at org.infinispan.manager.DefaultCacheManager.createCache(DefaultCacheManager.java:554)

                        at org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java:424)

                        at org.infinispan.schematic.Schematic.get(Schematic.java:90)

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

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

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

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

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

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

                        at org.modeshape.web.server.impl.RepositoryList.testLogin(RepositoryList.java:76)

                        at org.modeshape.web.server.impl.RepositoryList.getRepositories(RepositoryList.java:46)

                        at org.modeshape.web.server.impl.ConnectorImpl.start(ConnectorImpl.java:75)

                        at org.modeshape.web.server.JcrServiceImpl.loadConnector(JcrServiceImpl.java:1058)

                        at org.modeshape.web.server.JcrServiceImpl.connector(JcrServiceImpl.java:110)

                        at org.modeshape.web.server.JcrServiceImpl.getUserName(JcrServiceImpl.java:146)

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

                        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

                        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

                        at java.lang.reflect.Method.invoke(Method.java:498)

                        at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:561)

                        at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208)

                        at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)

                        at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)

                        at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)

                        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)

                        at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)

                        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)

                        at org.modeshape.web.AuthFilter.doFilter(AuthFilter.java:83)

                        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60)

                        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)

                        at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)

                        at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)

                        at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)

                        at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)

                        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

                        at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)

                        at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)

                        at io.undertow.server.handlers.DisableCacheHandler.handleRequest(DisableCacheHandler.java:33)

                        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

                        at io.undertow.security.handlers.AuthenticationConstraintHandler.handleRequest(AuthenticationConstraintHandler.java:51)

                        at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)

                        at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)

                        at io.undertow.servlet.handlers.security.ServletSecurityConstraintHandler.handleRequest(ServletSecurityConstraintHandler.java:56)

                        at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)

                        at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)

                        at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)

                        at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)

                        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

                        at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)

                        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

                        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

                        at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:284)

                        at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:263)

                        at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)

                        at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:174)

                        at io.undertow.server.Connectors.executeRootHandler(Connectors.java:202)

                        at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:793)

                        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

                        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

                        at java.lang.Thread.run(Thread.java:745)