简体   繁体   English

glassfish群集Web应用程序部署

[英]glassfish cluster web app deployment

I have create 2 java web application, one using mysql and another using oracle. 我创建了2个Java Web应用程序,一个使用mysql,另一个使用oracle。 i deploy those application in glassfish 4.0 server and work fine. 我将这些应用程序部署在glassfish 4.0服务器中并正常工作。 then i create cluster in the server with 1 instance in local node and 1 instance from remote node. 然后我在服务器中创建群集,在本地节点中有1个实例,在远程节点中有1个实例。 that cluster and the instances run successfully. 该群集和实例成功运行。

then i deploy app to the cluster, when i run web in browser problem happen, 然后我将应用程序部署到群集,当我在浏览器中运行Web时发生问题,
app using mysql show error "Class name is wrong or classpath is not set for : com.mysql.jdbc.jdbc2.optional.MysqlDataSource" , 使用mysql的应用程序显示错误“类名错误或未为com.mysql.jdbc.jdbc2.optional.MysqlDataSource设置类路径”,
app using oracle show error "org.apache.jasper.JasperException: java.lang.NullPointerException" oracle的应用程序显示错误“ org.apache.jasper.JasperException:java.lang.NullPointerException”

I bet the cause in this matter is connectivity. 我敢打赌这件事的原因是连通性。 i have put mysql connector and ojdbc driver in \\GlassFish 4.0\\glassfish\\domains\\domain1\\lib folder. 我已经将mysql连接器和ojdbc驱动程序放在\\ GlassFish 4.0 \\ glassfish \\ domains \\ domain1 \\ lib文件夹中。 i have change both jdbc resource target to the cluster. 我将两个jdbc资源目标都更改为集群。 i can ping both connection pool too. 我也可以ping通两个连接池。
where do i do wrong? 我在哪里做错了? any help appreciated. 任何帮助表示赞赏。 thanks 谢谢

mysql_connector_java.jar file mean missing in GlassFish GlassFish中缺少mysql_connector_java.jar文件

you can download this address 你可以下载这个地址

for maven 为行家

<dependency>
     <groupId>mysql</groupId>
     <artifactId>mysql-connector-java</artifactId>
     <version>5.1.35</version>
 </dependency>

Copy the file that you have downloaded GlassFish_Home/glassfish/domains/domain1/lib/ext/ 复制您下载的文件GlassFish_Home / glassfish / domains / domain1 / lib / ext /

and GlassFish restart for oncomplete. 然后GlassFish重新启动以完成操作。

reference 参考

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM