0

我在主题中部署时事通讯 Portlet 时遇到问题,发生的错误是java.net.UnknownHostException: mime。将感谢您的任何帮助:)

mime的问题解决了。我必须为 gmail 进行 smtp 和 pop3 设置。

但现在我面临另一个问题,它无法获取 liferay 的数据库,因此无法创建它的表。

这是 liferay-persistence.xml 文件:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xmlns:p="http://www.springframework.org/schema/p"

       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
          http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
          http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">

    <!-- liferay database connection -->
    <bean id="liferayDataSource" class="org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy">
        <property name="targetDataSource">
            <bean class="com.liferay.portal.kernel.util.InfrastructureUtil" factory-method="getDataSource" />
        </property>
    </bean>

    <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
        <property name="dataSource" ref="liferayDataSource" />
        <property name="schemaUpdate" value="true" />
        <property name="packagesToScan" value="com.rcs.newsletter.core.model" />
        <property name="hibernateProperties">
            <props>
                <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>                <prop key="hibernate.show_sql">false</prop>
            </props>
        </property>
    </bean>
    
    <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
        <property name="sessionFactory" ref="sessionFactory" />
    </bean>
    
    <bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate" p:sessionFactory-ref="sessionFactory" /> 
    
    <tx:annotation-driven /> 
</beans>

终于解决了这个问题,在portal-ext.properties文件中对数据库集成进行了更改,以更改 Liferay 使用的默认数据库,仅此而已。它解决了这个问题。

portal-ext.propertie当我使用 MySQL 数据库时,我在s 文件中添加了以下代码行:

jdbc.default.driverClassName=com.mysql.jdbc.Driver

jdbc.default.url=jdbc:mysql://localhost/liferay?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false

jdbc.default.username=root

jdbc.default.password=root

4

0 回答 0