cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Beryozkin (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (CXF-1871) I tried to configure <jaxrs:serviceFactory> that ends in a java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 during the jaxrs initialazion.
Date Mon, 09 Nov 2009 21:08:34 GMT

     [ https://issues.apache.org/jira/browse/CXF-1871?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Sergey Beryozkin resolved CXF-1871.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 2.3
                   2.2.5
         Assignee: Sergey Beryozkin

Please use jaxrs:dataBinding or explicitly set marshallProperties on JAXBElementPtovider 


> I tried to configure <jaxrs:serviceFactory> that ends in a java.lang.IndexOutOfBoundsException:
Index: 0, Size: 0 during the jaxrs initialazion.
> ------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-1871
>                 URL: https://issues.apache.org/jira/browse/CXF-1871
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.1.3
>         Environment: apache cxf 2.1.3-SNAPSHOT 
> maven 2 based build
> apache tomcat 6.0.18
> jdk 1.6
>            Reporter: Frank Ittermann
>            Assignee: Sergey Beryozkin
>             Fix For: 2.2.5, 2.3
>
>
> I want to register my own jaxb com.sun.xml.bind.namespacePrefixMapper implementation
for jaxrs. For jaxws it works great.
> My jaxrs config look something like this:
> <jaxrs:server name="xml" id="xmlserviceserver" address="/xml/2008-10-06">
> 		<jaxrs:serviceBeans>
> 			...
> 		</jaxrs:serviceBeans>
> 		<jaxrs:serviceFactory>
> 			<bean class="org.apache.cxf.jaxrs.JAXRSServiceFactoryBean">
> 				<property name="dataBinding">
> 			
> 					<bean class="org.apache.cxf.jaxb.JAXBDataBinding">
> 						<property name="marshallerProperties">
> 							<map>
> 								<entry>
> 									<key>
> 										<value>com.sun.xml.bind.namespacePrefixMapper</value>
> 									</key>
> 									<ref bean="NamespacePrefixMapper" />
> 								</entry>
> 							</map>
> 						</property>
> 					</bean>
> 				</property>
> 			</bean>
> 		</jaxrs:serviceFactory>
> 	</jaxrs:server>
> The following exception is thrown.
> org.springframework.beans.factory.BeanCreationException: Error creating bean with name
'xmlserviceserver': Invocation of init method failed; nested exception is java.lang.IndexOutOfBoundsException:
Index: 0, Size: 0
> Caused by: 
> java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
> 	at java.util.ArrayList.RangeCheck(ArrayList.java:547)
> 	at java.util.ArrayList.get(ArrayList.java:322)
> 	at org.apache.cxf.jaxrs.JAXRSServiceImpl.getName(JAXRSServiceImpl.java:60)
> 	at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.createEndpointInfo(JAXRSServerFactoryBean.java:198)
> 	at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.createEndpoint(JAXRSServerFactoryBean.java:146)
> 	at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:88)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1242)
> 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1208)
> 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1172)
> 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:427)
> 	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)
> 	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)
> 	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246)
> 	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
> 	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:291)
> 	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
> 	at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)
> 	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:189)
> 	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
> 	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
> 	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
> 	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
> 	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
> 	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
> 	at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:830)
> 	at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:719)
> 	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
> 	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
> 	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
> 	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
> 	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
> 	at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
> 	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
> 	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
> 	at org.apache.catalina.core.StandardService.start(StandardService.java:516)
> 	at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
> 	at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
> 	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
> If i uncomment the <jaxrs:serviceFactory> tag than it works.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message