Glassfish上的Hippo cms和mysql [英] Hippo cms and mysql on Glassfish

查看:189
本文介绍了Glassfish上的Hippo cms和mysql的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在添加一个MySQL数据库到Glassfish时遇到了一个很大的问题。我在这里完成了所有步骤 http:// www.onehippo.org/library/deployment/configuring/configuring-hippo-7-for-mysql.html



当我使用

  $ mvn clean install 
$ mvn -P cargo.run

这看起来很好,因为在我的workspace.xml中有:

 < FileSystem class =org.apache.jackrabbit.core.fs.db.DbFileSystem> 
< param name =urlvalue =java:comp / env / jdbc / repositoryDS/>
< param name =drivervalue =javax.naming.InitialContext/>
< param name =schemaObjectPrefixvalue =$ {wsp.name} _/>
< param name =schemavalue =mysql/>
< / FileSystem>

接下来我使用

  $ mvn clean install 
$ mvn -P dist

并部署创建cms.war和site.war到glassfish服务器(以前,我复制了所有的库和一切工作,受到启发 https://blogs.oracle.com/geertjan/entry/hippo_tip_deploying_hippo_to )。所有的项目工作正常。



问题在于数据库。在glassfish的新workspace.xml文件中(/opt/glassfish4/glassfish/domains/domain1/applications/cms/WEB-INF/storage/workspaces/default/workspace.xml)我有:

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

< PersistenceManager class =org.apache.jackrabbit.core.persistence.pool.H2PersistenceManager>
< param name =urlvalue =jdbc:h2:file:$ {wsp.home} / db/>
< param name =schemaObjectPrefixvalue =$ {wsp.name} _/>
< param name =minBlobSizevalue =4194304/>
< / PersistenceManager>

和服务器在storage / workspace / default中创建了db.h2.db文件,但我需要一个基础在MySQL中。我能做什么错?

其他问题。如何检查数据库中的内容?在MySQL的河马创建这样的事情:

  + ----------------- --- + 
| 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 |
+ -------------------- +

没有像BookAuthorShop这样的表格。但在服务器Hippo有我可以编辑的所有这些数据。



感谢您的阅读。

解决方案

你的MySQL配置似乎没问题。您必须记住,最重要的是所有配置在 repository.xml 文件中都必须是正确的。一旦存储库第一次初始化, workspace.xml 就会从repository.xml文件中生成/提取出来。因此,如果您在正确设置MySQL之前部署了Hippo,那么您的目录中可能会有一个旧的workspace.xml,这会导致使用H2数据库。



您链接到的第一篇文章包含一个名为使存储库使用此配置文件的部分。如果您想使用自己的配置,而不是使用H2数据库的内置配置,这一点非常重要。如果您不提供此系统属性,则将使用内置配置。


其他问题。如何检查数据库中的内容?有
没有像书作者商店表。但在服务器Hippo中,所有
都可以编辑这些数据。

持久性Jackrabbit有点复杂,它使得有意识地阅读配置概述文档 persistence manager文档。内容和数据的持久性由处理内容节点和属性持久存储的内部 Jackrabbit组件处理。属性值也存储在持久性管理器中,除了大的二进制值(通常存储在数据存储区内)之外。

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.

解决方案

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).

这篇关于Glassfish上的Hippo cms和mysql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆