Hippo cms and mysql on Glassfish

情到浓时终转凉″ 提交于 2019-12-07 13:58:04

问题


I have a big problem with the addition of a mysql database to Glassfish. I did all the steps located here http://www.onehippo.org/library/deployment/configuring/configuring-hippo-7-for-mysql.html .

When I use

$ mvn clean install
$ mvn -P cargo.run

It's looks fine, because in my workspace.xml I have :

<FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem">
  <param name="url" value="java:comp/env/jdbc/repositoryDS"/>
  <param name="driver" value="javax.naming.InitialContext"/>
  <param name="schemaObjectPrefix" value="${wsp.name}_"/>
  <param name="schema" value="mysql"/>
</FileSystem>

next I use

$ mvn clean install
$ mvn -P dist

and deploy created cms.war and site.war to glassfish server (Previously, I copied all the libraries and everything works. Inspired by https://blogs.oracle.com/geertjan/entry/hippo_tip_deploying_hippo_to ). All of project works fine.

The problem is the database. In new workspace.xml in glassfish (/opt/glassfish4/glassfish/domains/domain1/applications/cms/WEB-INF/storage/workspaces/default/workspace.xml) I have:

<FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
  <param name="path" value="${wsp.home}"/>
</FileSystem>

<PersistenceManager   class="org.apache.jackrabbit.core.persistence.pool.H2PersistenceManager">
  <param name="url" value="jdbc:h2:file:${wsp.home}/db"/>
  <param name="schemaObjectPrefix" value="${wsp.name}_"/>
  <param name="minBlobSize" value="4194304"/>
</PersistenceManager>

and server created db.h2.db file in storage/workspace/default, but I need a base in mysql. What can I do wrong?

Additional question. How to check what is in the database? In mysql hippo created something like this:

+--------------------+
| Tables_in_hippo    |
+--------------------+
| DATASTORE          |
| DEFAULT_BINVAL     |
| DEFAULT_BUNDLE     |
| DEFAULT_FSENTRY    |
| DEFAULT_NAMES      |
| DEFAULT_REFS       |
| REPOSITORY_FSENTRY |
| VERSION_BINVAL     |
| VERSION_BUNDLE     |    
| VERSION_FSENTRY    |
| VERSION_NAMES      |
| VERSION_REFS       |
+--------------------+

There are no tables like "Book" "Author" "Shop". But in server Hippo have all this data which I can edit.

Thanks for reading.


回答1:


Your MySQL configuration seems to be fine. You have to keep in mind that the most important thing is that all the configuration needs to be correct in the repository.xml file. The workspace.xml is generated/extracted out of the repository.xml file once the repository gets initialized for the first time. So if you've deployed Hippo before having the correct settings for MySQL, you might have an old workspace.xml in your directory, which results in the H2 db being used.

The first article you link to contains a section called "Make the repository use this configuration file". This is very important if you want to use your own configuration and not the built-in configuration which leverages the H2 database. If you do not provide this system property the build in configuration will be used.

Additional question. How to check what is in the database? There are no tables like "Book" "Author" "Shop". But in server Hippo have all this data which I can edit.

Persistence in Jackrabbit is a bit complicated, it makes sense to read the configuration overview documentation and persistence manager documentation first. The persistence of content and data is handled by an internal Jackrabbit component that handles the persistent storage of content nodes and properties. Property values are also stored in the persistence manager, with the exception of large binary values (usually stored inside the datastore).



来源:https://stackoverflow.com/questions/28339871/hippo-cms-and-mysql-on-glassfish

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!