Skip to main content

RESTFul web service on Glassfish server does not work when I have composite primary keys in mysql database?

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
No replies
ramibatal
Offline
Joined: 2012-06-07

I wonder if someone has a solution for this problem (bug?) in Glassfish server.

I am using netbeans to create a RestFul web service that has to populate a mysql database. In my database designe I have some tables that has composite primary key (which include foreign key from other tables). Everything looks fine, and netbeans succeeded to build the RESTFul web service, but I can't test it on Glassfish. I can deploy it only, but when I choose "Test RESTFul Web Services" I have a pop up error message in my bowser "Cannot access WADL: Please restart your RESTful application, and refresh this page."

When I look to the server log file I find the following errors related to the tables (entities) that include composite primary keys:

[#|2012-06-07T09:25:58.750+0100|SEVERE|glassfish3.1.2|com.sun.jersey.spi.inject.Errors|_ThreadID=22;_ThreadName=Thread-4;|The following errors and warnings have been detected with resource and/or provider classes:
SEVERE: Missing dependency for method public entity.CaptureSession service.CaptureSessionFacadeREST.find(entity.CaptureSessionPK) at parameter at index 0
SEVERE: Method, public entity.CaptureSession service.CaptureSessionFacadeREST.find(entity.CaptureSessionPK), annotated with GET of resource, class service.CaptureSessionFacadeREST, is not recognized as valid resource method.
SEVERE: Missing dependency for method public void service.CaptureSessionFacadeREST.remove(entity.CaptureSessionPK) at parameter at index 0
SEVERE: Method, public void service.CaptureSessionFacadeREST.remove(entity.CaptureSessionPK), annotated with DELETE of resource, class service.CaptureSessionFacadeREST, is not recognized as valid resource method.
SEVERE: Missing dependency for method public entity.CaptureMoment service.CaptureMomentFacadeREST.find(entity.CaptureMomentPK) at parameter at index 0
SEVERE: Method, public entity.CaptureMoment service.CaptureMomentFacadeREST.find(entity.CaptureMomentPK), annotated with GET of resource, class service.CaptureMomentFacadeREST, is not recognized as valid resource method.
SEVERE: Missing dependency for method public void service.CaptureMomentFacadeREST.remove(entity.CaptureMomentPK) at parameter at index 0
SEVERE: Method, public void service.CaptureMomentFacadeREST.remove(entity.CaptureMomentPK), annotated with DELETE of resource, class service.CaptureMomentFacadeREST, is not recognized as valid resource method.
SEVERE: Missing dependency for method public entity.AccelerometerData service.AccelerometerDataFacadeREST.find(entity.AccelerometerDataPK) at parameter at index 0
SEVERE: Method, public entity.AccelerometerData service.AccelerometerDataFacadeREST.find(entity.AccelerometerDataPK), annotated with GET of resource, class service.AccelerometerDataFacadeREST, is not recognized as valid resource method.
SEVERE: Missing dependency for method public void service.AccelerometerDataFacadeREST.remove(entity.AccelerometerDataPK) at parameter at index 0
SEVERE: Method, public void service.AccelerometerDataFacadeREST.remove(entity.AccelerometerDataPK), annotated with DELETE of resource, class service.AccelerometerDataFacadeREST, is not recognized as valid resource method.

Does anyone can propose a way to prevent this problem?

Thank you very much

Rami