OpenJWeb在Eclipse EE下的配置要领
OpenJWeb在Eclipse EE下的配置要点
有不少开发人员在Eclipse Mars EE下配置OpenJWeb失败,主要原因为以下几点:
(1) 没有配置内存相关的参数,导致启动时出现内存不足的问题。
(2)Tomcat设置问题。
(3)Conext设置问题:
第一个问题,内存设置的方式:找到
Run---RunConfigurations.. 菜单,打开Arguments标签:
在JVM arguments末尾增加:
-Xms1280m -Xmx1280m -XX:PermSize=300m -XX:MaxNewSize=256m
-XX:MaxPermSize=300m -XX:SurvivorRatio=7
开发人员可根据自己的机器进行适当调整,PerSize的值不要设置太小。
第二个问题:Tomcat Server的属性设置:
参考下面的界面:
第三个问题:server.xml中的Context配置:
在</Host>前增加:
<Context path="/portal" docBase="d:/project/openjweb/webapps" workDir="/temp" debug="1"
reloadable="true" crossContext="true" >
<Resource name="jdbc/mysql" auth="Container" type="javax.sql.DataSource"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3333/erp"
username="root" password="mysql" schema="erp" maxActive="200" maxIdle="20"
<Resource name="jdbc/mysql" auth="Container" type="javax.sql.DataSource"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3333/erp"
username="root" password="mysql" schema="erp" maxActive="200" maxIdle="20"
maxWait="10000"/>
<resource-ref>
<descrtiption>jdbc/mysql</descrtiption>
<res-ref-name>jdbc/mysql</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<Resource name="jdbc/ds10" auth="Container" type="javax.sql.DataSource"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3333/erp"
username="root" password="mysql" schema="erp" maxActive="200" maxIdle="20" maxWait="10000"/>
<resource-ref>
<descrtiption>jdbc/ds10</descrtiption>
<res-ref-name>jdbc/ds10</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
< /Context>
<resource-ref>
<descrtiption>jdbc/mysql</descrtiption>
<res-ref-name>jdbc/mysql</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<Resource name="jdbc/ds10" auth="Container" type="javax.sql.DataSource"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3333/erp"
username="root" password="mysql" schema="erp" maxActive="200" maxIdle="20" maxWait="10000"/>
<resource-ref>
<descrtiption>jdbc/ds10</descrtiption>
<res-ref-name>jdbc/ds10</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
< /Context>
删除D:\project\apache-tomcat-7.0.57-win64\conf\Catalina\localhost\portal.xml
去OpenJWeb官方网址 看看。
版权声明:本文为博主原创文章,未经博主允许不得转载。