12.07.2015 Views

Beginning Java EE 6 with GlassFish 3, Second Edition

Beginning Java EE 6 with GlassFish 3, Second Edition

Beginning Java EE 6 with GlassFish 3, Second Edition

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 15 ■ RESTFUL WEB SERVICESjavax.ws.rsjsr311-api1.1providedorg.glassfishjavax.ejb3.0.1providedorg.eclipse.persistencejavax.persistence2.0.0providedorg.apache.maven.pluginsmaven-compiler-plugintrue1.61.6To compile and package the classes, open a DOS command line in the root directory containing thepom.xml file and enter the following Maven command:mvn packageGo to the target directory, look for a file named chapter15-resource-2.0.war, and open it. Noticethat Book.class, ApplicationConfig.class and BookResource.class are under the WEB-INF\classesdirectory. The persistence.xml file is also packaged in the war.Deploying on <strong>GlassFish</strong>Once the code is packaged, make sure <strong>GlassFish</strong> and Derby are up and running and deploy the war fileby issuing the asadmin command-line interface. Open a DOS console, go to the target directory wherethe chapter15-resource-2.0.war file is located, and enter:482

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!