0 Replies Latest reply: Aug 8, 2012 8:41 AM by 954599 RSS

    Spring jersey-Error at Line:99, token:[CLOSETAGBEGIN]Unbalanced ELEMENT got

    954599
      Hi,

      I am using jersey spring rest service in weblogic application. I see the below Error on server startup, which is happening while trying to register Jersey rest beans.

      Error at Line:99, token:[CLOSETAGBEGIN]Unbalanced ELEMENT got:body expected:p
      at weblogic.xml.babel.baseparser.BaseParser.parseSome(BaseParser.java:374)
      at weblogic.xml.stax.XMLStreamReaderBase.advance(XMLStreamReaderBase.java:195)
      at weblogic.xml.stax.XMLStreamReaderBase.next(XMLStreamReaderBase.java:237)
      at weblogic.xml.domimpl.Loader.load(Loader.java:112)
      at weblogic.xml.domimpl.Loader.load(Loader.java:73)
      at weblogic.xml.domimpl.Loader.load(Loader.java:35)
      at weblogic.wsee.util.dom.DOMParser.getWebLogicDocumentImpl(DOMParser.java:122)
      at weblogic.wsee.util.dom.DOMParser.getDocument(DOMParser.java:65)
      at weblogic.wsee.wsdl.WsdlReader.getDocument(WsdlReader.java:311)
      at weblogic.wsee.wsdl.WsdlReader.getDocument(WsdlReader.java:305)
      at weblogic.wsee.jaxws.spi.WLSProvider.readWSDL(WLSProvider.java:296)
      at weblogic.wsee.jaxws.spi.WLSProvider.createServiceDelegate(WLSProvider.java:77)
      at weblogic.wsee.jaxws.spi.WLSProvider.createServiceDelegate(WLSProvider.java:62)
      at javax.xml.ws.Service.<init>(Service.java:56)
      at javax.xml.ws.Service.create(Service.java:680)
      at org.springframework.remoting.jaxws.LocalJaxWsServiceFactory.createJaxWsService(LocalJaxWsServiceFactory.java:125)
      at org.springframework.remoting.jaxws.JaxWsPortClientInterceptor.prepare(JaxWsPortClientInterceptor.java:334)
      at org.springframework.remoting.jaxws.JaxWsPortClientInterceptor.afterPropertiesSet(JaxWsPortClientInterceptor.java:316)
      at org.springframework.remoting.jaxws.JaxWsPortProxyFactoryBean.afterPropertiesSet(JaxWsPortProxyFactoryBean.java:42)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getTypeForFactoryBean(AbstractBeanFactory.java:1343)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryBean(AbstractAutowireCapableBeanFactory.java:678)
      at org.springframework.beans.factory.support.AbstractBeanFactory.isTypeMatch(AbstractBeanFactory.java:507)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:317)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:296)
      at org.springframework.context.support.AbstractApplicationContext.getBeanNamesForType(AbstractApplicationContext.java:1132)
      at org.springframework.beans.factory.BeanFactoryUtils.beanNamesForTypeIncludingAncestors(BeanFactoryUtils.java:142)
      at org.springframework.beans.factory.BeanFactoryUtils.beanNamesIncludingAncestors(BeanFactoryUtils.java:124)
      at com.sun.jersey.spi.spring.container.SpringComponentProviderFactory.register(SpringComponentProviderFactory.java:87)
      at com.sun.jersey.spi.spring.container.SpringComponentProviderFactory.<init>(SpringComponentProviderFactory.java:83)
      at com.sun.jersey.spi.spring.container.servlet.SpringServlet.initiate(SpringServlet.java:99)
      at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:253)
      at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:521)
      at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:199)
      at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:308)
      at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:471)
      at javax.servlet.GenericServlet.init(GenericServlet.java:241)



      My web.xml configuration is as below -

      <context-param>
      <param-name>contextConfigLocation</param-name>
      <param-value>/WEB-INF/classes/restBean.xml</param-value>
      </context-param>

      <listener>
      <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
      </listener>

      <listener>
      <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
      </listener>

      <servlet>
      <servlet-name>Jersey Spring Web Application</servlet-name>
      <servlet-class>com.sun.jersey.spi.spring.container.servlet.SpringServlet</servlet-class>
      <init-param>
      <param-name>com.sun.ws.rest.config.property.resourceConfigClass</param-name>
      <param-value>com.sun.ws.rest.api.core.PackagesResourceConfig</param-value>
      </init-param>
      <init-param>
      <param-name>com.sun.jersey.config.property.packages</param-name>
      <param-value>com.webex.fin.rest.wo.invoice;com.webex.fin.mbeans.enterprise.billing</param-value>
      </init-param>
      <load-on-startup>1</load-on-startup>
      </servlet>
      <servlet-mapping>
      <servlet-name>Jersey Spring Web Application</servlet-name>
      <url-pattern>/webresources/*</url-pattern>
      </servlet-mapping>




      I have defined my rest bean in restBean.xml as below..

      <beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:context="http://www.springframework.org/schema/context"
      xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
      http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd">
      <context:component-scan base-package="com.webex.fin.rest.wo.invoice"/>
      <bean id="InvoiceRestBean" class="com.webex.fin.rest.wo.invoice.InvoiceRestBean">
      </bean>
      </beans>




      Can some one please help me in resolving this issue?