• Post Reply Bookmark Topic Watch Topic
  • New Topic

glassfish-web.xml servlet mappings  RSS feed

 
Koen Demonie
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to creat a REST api using jersey and glassfish.
I generated a dynamic web project using eclipse.

Now i have a glassfish-web.xml in my WEB-INF folder,



In a normal web.xml i get no errors, yet here i do on:

<glassfish-web-app> :

The content of element type "glassfish-web-app" must match "(context-root?,security-role-
mapping*,servlet*,idempotent-url-pattern*,session-config?,ejb-ref*,resource-ref*,resource-env-ref*,service-
ref*,message-destination-ref*,cache?,class-loader?,jsp-config?,locale-charset-info?,parameter-
encoding?,property*,valve*,message-destination*,webservice-description*,keep-state?,version-identifier?)".

<servlet> :

The content of element type "servlet" must match "(servlet-name,principal-name?,webservice-endpoint*)".

What am i doing wrong ?
 
K. Tsang
Bartender
Posts: 3648
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

The servlet and servlet-mapping stuff you have in the glassfish-web.xml should actually be in the application's web.xml file. The glassfish-web.xml should have the context-root and default tags.

If the context-root is the same as your app name then the glassfish-web.xml file doesn't need to exist.


 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!