Java EE 7 GlassFish 4.0 Restful Webservices using and Netbean and deploying on Glassfish 4.0

后端 未结 1 1696
谎友^
谎友^ 2021-01-14 21:49

I have followed this Tutorial to Create simple Java EE 7 Webservices using Netbean 7.3.1. I have Glassfish 4.0 running with Netbeans. I ran project successfully without any

相关标签:
1条回答
  • 2021-01-14 22:25

    To Fix First problem, open your glassfish-resource.xml file from your project, it will look something like this. enter image description here

    if you don't have glassfish-resource.xml in server-configuration folder you can also check the these details by clicking on services tab in netbeans and furhter clicking on connection pools as shown in this screenshot. enter image description here

    Based on the information in it, and using Glassfish 4.0 web interface http://localhost:4848

    Firstly Create new JDBC connection pool by navigating Common Tasks -> Resources -> JDBC -> JDBC Connection Pools. It will look something like this. enter image description here

    enter image description here

    Then Secondly create Connection resource by navigating Common Tasks -> Resources -> JDBC -> JDBC Resources It will look somehting like this. enter image description here

    First Problem is sorted. you can test it using Ping button in connection pools enter image description here

    For Second problem. (if your ping is not successful do following)

    Search mysql-connector-java-5.1.23-bin.jar file in Netbeans installation folder and copy it to Glassfish library folder

    C:\glassfish4\glassfish\lib
    

    After copying stop & start server by running following commands in folder C:\glassfish4\glassfish\bin

    asadmin.bat stop-domain domain1
    asadmin.bat start-domain domain1
    

    After above, deploy the application again and it will successfully deployed and you can access it using test interface http://localhost:8080/CustomerDB/test-resbeans.html exactly the way as in netbeans.

    0 讨论(0)
提交回复
热议问题