Skip to main content

Failed deployment on GF 3.0.1- same url pattern error

Please note these forums are being decommissioned and use the new and improved forums at
5 replies [Last post]
Joined: 2010-12-14

I am getting an error deploying a WAR file to Glassfish 3.0.1b22 that I don't remember seeing when I was deploying the same WAR file to Glassfish 2.1 in the past. Specifically, I am seeing this error:
Exception while deploying the app : java.lang.IllegalStateException: Servlet [pointcloudservice] and Servlet [PointCloudDeliveryService] have the same url pattern: [/PointCloudDeliveryService]at org.glassfish.apf.AnnotationInfo@a0d20b9
I've done quite a bit of searching on Google and in this forum and all of the suggestions I've seen do not seem to be either relevant to my development environment (I don't have an autodeploy to Glassfish Eclipse plugin) or they don't seem to suggest anything that actually helped (checking sun-jaxws.xml for duplication and/or removing it altogether from the WAR).
The WAR file is being built by Maven inside Eclipse (which is the same way it was being built when deploying on GF 2.1) and is being manually deployed to Glassfish using the web based admin console.
Here are the relevant lines from the web.xml file:

<servlet><br />
        <servlet-name>pointcloudservice</servlet-name><br />
        <servlet-class></servlet-class><br />
        <load-on-startup>1</load-on-startup><br />
    </servlet><br />
    <servlet-mapping><br />
        <servlet-name>pointcloudservice</servlet-name><br />
        <url-pattern>/PointCloudDeliveryService</url-pattern><br />

Am I missing something, or is this an issue with Glassfish 3.0.1?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2006-01-18

the problem ("..have the same url pattern...") is because some library is deployed more than once.
Check that your dependencies are not repeated.

Daniel :)

Joined: 2013-05-15

danielkard wrote:
the problem ("..have the same url pattern...") is because some library is deployed more than once.
Check that your dependencies are not repeated.

Daniel :)

Thanks for that tip. It pointed me in the right direction.
In my project I have dependencies to other own projects which I include via Maven pom. I had to insert true for each dependency in my included projects. After that the GlassFish error was gone.

For example an excerpt out of the pom of one dependency of my main project:

Joined: 2010-12-14

So It looks like the solution to the problem was to set the metadata-complete attribute to true for the web-app tag:
<web-app xmlns="" xmlns:xsi="" xsi:schemaLocation=" <a href=""" title=""">"</a> version="2.5" metadata-complete="true">

Joined: 2010-12-16


I am using glassfish and postgresql and I have created a web services when I am testing it is giving me error

Source code for web services is:-
* To change this template, choose Tools | Templates
* and open the template in the editor.

package p;

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.PersistenceUnit;
import javax.persistence.Query;

* @author 288949
public class DemoWebServices {
private EntityManagerFactory emf;
private EntityManager getEntityManager() {
return emf.createEntityManager();


public EntityManagerFactory getEmf() {
return emf;

public void setEmf(EntityManagerFactory emf) {
this.emf = emf;

* Web service operation
@WebMethod(operationName = "Fetch")
public String Fetch(@WebParam(name = "EmailId")
String EmailId) {

Metadatatable objMetadatatable=new Metadatatable();
EntityManager em = getEntityManager();

// Query query1 = em.createNamedQuery("Metadatatable.findByEmailid").setParameter("emailid", "");
Query query = em.createQuery("select e.creatatorname from Metadatatable e where e.emailid=(:emailid) ").setParameter("emailid", "");
String iecode= (String) query.getSingleResult();

// Query query = em.createNamedQuery(EmailId, null)
// String iecode= (String) query.getSingleResult();
// System.out.print(iecode);
// System.out.print("MA");

return iecode;


Exceptions details : null
java.lang.NullPointerException at at org.glassfish.webservices.monitoring.WebServiceTesterServlet.initializePort( at org.glassfish.webservices.monitoring.WebServiceTesterServlet.doGet( at org.glassfish.webservices.monitoring.WebServiceTesterServlet.invoke( at org.glassfish.webservices.JAXWSServlet.doGet( at javax.servlet.http.HttpServlet.service( at javax.servlet.http.HttpServlet.service( at org.apache.catalina.core.StandardWrapper.service( at org.apache.catalina.core.StandardWrapperValve.invoke( at org.apache.catalina.core.StandardContextValve.invoke( at org.apache.catalina.core.StandardPipeline.invoke( at com.sun.enterprise.web.WebPipeline.invoke( at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke( at org.apache.catalina.core.StandardHostValve.invoke( at org.apache.catalina.connector.CoyoteAdapter.doService( at org.apache.catalina.connector.CoyoteAdapter.service( at at com.sun.grizzly.http.ProcessorTask.invokeAdapter( at com.sun.grizzly.http.ProcessorTask.doProcess( at com.sun.grizzly.http.ProcessorTask.process( at com.sun.grizzly.http.DefaultProtocolFilter.execute( at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter( at com.sun.grizzly.DefaultProtocolChain.execute( at com.sun.grizzly.DefaultProtocolChain.execute( at com.sun.grizzly.http.HttpProtocolChain.execute( at com.sun.grizzly.ProtocolChainContextTask.doCall( at at at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork( at com.sun.grizzly.util.AbstractThreadPool$ at

The contents of this e-mail and any attachment(s) may contain confidential or privileged information for the intended recipient(s). Unintended recipients are prohibited from taking action on the basis of information in this e-mail and using or disseminating the information, and must notify the sender and delete it from their system. L&T Infotech will not accept responsibility or liability for the accuracy or completeness of, or the presence of any virus or disabling code in this e-mail"


cinhtau Guest
Joined: 2010-12-17

Manish Mishra-2 wrote:
> public class DemoWebServices {
> @PersistenceUnit
> private EntityManagerFactory emf;
> private EntityManager getEntityManager() {
> return emf.createEntityManager();
> }
> }

Usually you let the container handle the PersistenceUnit, i.e.


Glassfish will inject it for you. Your code above is useless, because you
create an entity manager manually. You use that only outside Glassfish. Post
your persistence.xml please for further help.