users@jersey.java.net

[Jersey] Re: turn on tracing from within mule

From: Mathews, Benjamin L <benjamin.mathews_at_optum.com>
Date: Thu, 30 Jun 2011 15:38:29 -0500

I ended up grabbing the Jersey source and hard coding the tracing on.
That got me to the actual exception being thrown.

    private void skipPreamble() {

        while(true) {
            if (!eof) {
                fillBuf();
            }
            int start = match(buf, 0, len); // matches boundary
            if (start == -1) {
                // No boundary is found
                if (eof) {
Exception>>> throw new MIMEParsingException("Missing start
boundary");
                } else {
                    adjustBuf(len-bl+1, bl-1);
                    continue;
                }
            }

Apparently, the message is getting mangled somewhere. Is it Mule that
is doing this, or Jersey? How do I check?

org.jvnet.mimepull.MIMEParser.skipPreamble() line: 313
org.jvnet.mimepull.MIMEParser.access$300(org.jvnet.mimepull.MIMEParser)
line: 67
org.jvnet.mimepull.MIMEParser$MIMEEventIterator.next() line: 143
org.jvnet.mimepull.MIMEParser$MIMEEventIterator.next() line: 128
org.jvnet.mimepull.MIMEMessage.makeProgress() line: 198
org.jvnet.mimepull.MIMEMessage.parseAll() line: 181
org.jvnet.mimepull.MIMEMessage.getAttachments() line: 106
com.sun.jersey.multipart.impl.MultiPartReaderServerSide(com.sun.jersey.m
ultipart.impl.MultiPartReaderClientSide).readMultiPart(java.lang.Class<c
om.sun.jersey.multipart.MultiPart>, java.lang.reflect.Type,
java.lang.annotation.Annotation[], javax.ws.rs.core.MediaType,
javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String>,
java.io.InputStream) line: 177
com.sun.jersey.multipart.impl.MultiPartReaderServerSide.readMultiPart(ja
va.lang.Class<com.sun.jersey.multipart.MultiPart>,
java.lang.reflect.Type, java.lang.annotation.Annotation[],
javax.ws.rs.core.MediaType,
javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String>,
java.io.InputStream) line: 80
com.sun.jersey.multipart.impl.MultiPartReaderServerSide(com.sun.jersey.m
ultipart.impl.MultiPartReaderClientSide).readFrom(java.lang.Class<com.su
n.jersey.multipart.MultiPart>, java.lang.reflect.Type,
java.lang.annotation.Annotation[], javax.ws.rs.core.MediaType,
javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String>,
java.io.InputStream) line: 139
com.sun.jersey.multipart.impl.MultiPartReaderServerSide(com.sun.jersey.m
ultipart.impl.MultiPartReaderClientSide).readFrom(java.lang.Class,
java.lang.reflect.Type, java.lang.annotation.Annotation[],
javax.ws.rs.core.MediaType, javax.ws.rs.core.MultivaluedMap,
java.io.InputStream) line: 77
com.sun.jersey.spi.container.ContainerRequest.getEntity(java.lang.Class<
T>, java.lang.reflect.Type, java.lang.annotation.Annotation[]) line: 470

com.sun.jersey.spi.container.ContainerRequest.getEntity(java.lang.Class<
T>) line: 534
com.sun.jersey.multipart.impl.FormDataMultiPartDispatchProvider$FormData
InjectableValuesProvider.getInjectableValues(com.sun.jersey.api.core.Htt
pContext) line: 122
com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodD
ispatchProvider$ResponseOutInvoker(com.sun.jersey.server.impl.model.meth
od.dispatch.AbstractResourceMethodDispatchProvider$EntityParamInInvoker)
.getParams(com.sun.jersey.api.core.HttpContext) line: 153
com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodD
ispatchProvider$ResponseOutInvoker._dispatch(java.lang.Object,
com.sun.jersey.api.core.HttpContext) line: 203
com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodD
ispatchProvider$ResponseOutInvoker(com.sun.jersey.server.impl.model.meth
od.dispatch.ResourceJavaMethodDispatcher).dispatch(java.lang.Object,
com.sun.jersey.api.core.HttpContext) line: 75
com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(java.lang.Cha
rSequence, java.lang.Object,
com.sun.jersey.spi.uri.rules.UriRuleContext) line: 288
com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(java.lang.
CharSequence, java.lang.Object,
com.sun.jersey.spi.uri.rules.UriRuleContext) line: 147
com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(java.lang.
CharSequence, java.lang.Object,
com.sun.jersey.spi.uri.rules.UriRuleContext) line: 108
com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(java.lang.
CharSequence, java.lang.Object,
com.sun.jersey.spi.uri.rules.UriRuleContext) line: 147
com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(java
.lang.CharSequence, java.lang.Object,
com.sun.jersey.spi.uri.rules.UriRuleContext) line: 84
com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest
(com.sun.jersey.server.impl.application.WebApplicationContext,
com.sun.jersey.spi.container.ContainerRequest) line: 1468
com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest
(com.sun.jersey.server.impl.application.WebApplicationContext,
com.sun.jersey.spi.container.ContainerRequest,
com.sun.jersey.spi.container.ContainerResponse) line: 1399
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(
com.sun.jersey.spi.container.ContainerRequest,
com.sun.jersey.spi.container.ContainerResponse) line: 1348


Ben Mathews

-----Original Message-----
From: Jakub Podlesak [mailto:jakub.podlesak_at_oracle.com]
Sent: Thursday, June 30, 2011 1:19 AM
To: users_at_jersey.java.net
Subject: [Jersey] Re: turn on tracing from within mule

Hi Benjamin,

Does Mule allow you to customize the default resource configuration
somehow?
You should be able to add the feature there. Could you please try to ask
Mule guys about that? What version of Mule are you using?

~Jakub


On 06/29/2011 01:01 AM, benjamin.mathews_at_ingenix.com wrote:
> I'm using jersey from within Mule. I'd like to turn on tracing as
> described in http://blogs.oracle.com/sandoz/entry/tracing_in_jersey.
> ou should
>
> <init-param>
> <param-name>com.sun.jersey.config.feature.Trace</param-name>
> <param-value>true</param-value>
> </init-param>
>
> But, there isn't a web.xml to put these parameter configuration
> statements in.
>
> Mule is initializing the Jersey DefaultResourceConfig with the below
> stack trace. I can't figure out how to set the Trace string to true
> in this context.
>
> Does anyone have any ideas how to do this?
>
>
com.sun.jersey.api.core.DefaultResourceConfig.<init>(java.util.Set<java
> .lang.Class<?>>) line: 94
> org.mule.module.jersey.JerseyResourcesComponent.createConfiguration(ja
> v
> a.util.Set<java.lang.Class<?>>) line: 92
> org.mule.module.jersey.JerseyResourcesComponent.doInitialise() line:
> 84
>
> org.mule.component.AbstractComponent$1.onTransition(java.lang.String,
> org.mule.api.component.Component) line: 247
> org.mule.component.AbstractComponent$1.onTransition(java.lang.String,
> java.lang.Object) line: 220
> org.mule.component.ComponentLifecycleManager(org.mule.lifecycle.Abstra
> c tLifecycleManager<O>).invokePhase(java.lang.String,
> java.lang.Object,
> org.mule.api.lifecycle.LifecycleCallback) line: 141
> org.mule.component.ComponentLifecycleManager.fireInitialisePhase(org.m
> u
> le.api.lifecycle.LifecycleCallback<org.mule.api.component.Component>)
> line: 54
>
org.mule.module.jersey.JerseyResourcesComponent(org.mule.component.Abst
> ractComponent).initialise() line: 219
> org.mule.processor.chain.InterceptingChainLifecycleWrapper(org.mule.pr
> o
> cessor.chain.AbstractMessageProcessorChain).initialise() line: 103
>
> org.mule.construct.SimpleFlowConstruct(org.mule.construct.AbstractFlow
> C
> onstruct).initialiseIfInitialisable(java.lang.Object) line: 354
>
org.mule.construct.AbstractFlowConstruct$1.onTransition(java.lang.Strin
> g, org.mule.api.construct.FlowConstruct) line: 116
>
org.mule.construct.AbstractFlowConstruct$1.onTransition(java.lang.Strin
> g, java.lang.Object) line: 95
> org.mule.construct.FlowConstructLifecycleManager(org.mule.lifecycle.Ab
> s tractLifecycleManager<O>).invokePhase(java.lang.String,
> java.lang.Object, org.mule.api.lifecycle.LifecycleCallback) line: 141
>
> org.mule.construct.FlowConstructLifecycleManager.fireInitialisePhase(o
> r
> g.mule.api.lifecycle.LifecycleCallback<org.mule.api.construct.FlowCons
> t
> ruct>) line: 81
> org.mule.construct.SimpleFlowConstruct(org.mule.construct.AbstractFlow
> C
> onstruct).initialise() line: 94
> sun.reflect.NativeMethodAccessorImpl.invoke0(java.lang.reflect.Method,
> java.lang.Object, java.lang.Object[]) line: not available [native
> method] sun.reflect.NativeMethodAccessorImpl.invoke(java.lang.Object,
> java.lang.Object[]) line: 57
> sun.reflect.DelegatingMethodAccessorImpl.invoke(java.lang.Object,
> java.lang.Object[]) line: 43
> java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object...)
> line: 616
> org.springframework.beans.factory.support.DefaultListableBeanFactory(o
> r
> g.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
> t ory).invokeCustomInitMethod(java.lang.String, java.lang.Object,
> org.springframework.beans.factory.support.RootBeanDefinition) line:
> 1536
> org.springframework.beans.factory.support.DefaultListableBeanFactory(o
> r
> g.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
> t ory).invokeInitMethods(java.lang.String, java.lang.Object,
> org.springframework.beans.factory.support.RootBeanDefinition) line:
> 1477
> org.springframework.beans.factory.support.DefaultListableBeanFactory(o
> r
> g.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
> t ory).initializeBean(java.lang.String, java.lang.Object,
> org.springframework.beans.factory.support.RootBeanDefinition) line:
> 1409
> org.springframework.beans.factory.support.DefaultListableBeanFactory(o
> r
> g.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
> t
> ory).doCreateBean(java.lang.String,
> org.springframework.beans.factory.support.RootBeanDefinition,
> java.lang.Object[]) line: 519
> org.springframework.beans.factory.support.DefaultListableBeanFactory(o
> r
> g.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
> t
> ory).createBean(java.lang.String,
> org.springframework.beans.factory.support.RootBeanDefinition,
> java.lang.Object[]) line: 456
>
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObje
> ct() line: 291
> org.springframework.beans.factory.support.DefaultListableBeanFactory(o
> r
> g.springframework.beans.factory.support.DefaultSingletonBeanRegistry).
> g
> etSingleton(java.lang.String,
> org.springframework.beans.factory.ObjectFactory) line: 222
> org.springframework.beans.factory.support.DefaultListableBeanFactory(o
> r
> g.springframework.beans.factory.support.AbstractBeanFactory).doGetBean
> ( java.lang.String, java.lang.Class<T>, java.lang.Object[], boolean)
> line: 288
> org.springframework.beans.factory.support.DefaultListableBeanFactory(o
> r
> g.springframework.beans.factory.support.AbstractBeanFactory).getBean(j
> a
> va.lang.String) line: 190
>
org.springframework.beans.factory.support.DefaultListableBeanFactory.pr
> eInstantiateSingletons() line: 574
> org.mule.config.spring.MuleApplicationContext(org.springframework.cont
> e
> xt.support.AbstractApplicationContext).finishBeanFactoryInitialization
> (
>
org.springframework.beans.factory.config.ConfigurableListableBeanFactor
> y) line: 895
>
org.mule.config.spring.MuleApplicationContext(org.springframework.conte
> xt.support.AbstractApplicationContext).refresh() line: 425
> org.mule.config.spring.SpringRegistry.doInitialise() line: 89
>
org.mule.config.spring.SpringRegistry(org.mule.registry.AbstractRegistr
> y).initialise() line: 107
> org.mule.config.spring.SpringXmlConfigurationBuilder.createSpringRegis
> t
> ry(org.mule.api.MuleContext,
> org.springframework.context.ApplicationContext) line: 116
>
org.mule.config.spring.SpringXmlConfigurationBuilder.doConfigure(org.mu
> le.api.MuleContext) line: 73
> org.mule.config.spring.SpringXmlConfigurationBuilder(org.mule.config.b
> u
>
ilders.AbstractConfigurationBuilder).configure(org.mule.api.MuleContext
> ) line: 47
> org.mule.config.spring.SpringXmlConfigurationBuilder(org.mule.config.b
> u
>
ilders.AbstractResourceConfigurationBuilder).configure(org.mule.api.Mul
> eContext) line: 78
>
org.mule.config.builders.AutoConfigurationBuilder.autoConfigure(org.mul
> e.api.MuleContext, org.mule.config.ConfigResource[]) line: 101
>
org.mule.config.builders.AutoConfigurationBuilder.doConfigure(org.mule.
> api.MuleContext) line: 57
> org.mule.config.builders.AutoConfigurationBuilder(org.mule.config.buil
> d
> ers.AbstractConfigurationBuilder).configure(org.mule.api.MuleContext)
> line: 47
> org.mule.config.builders.AutoConfigurationBuilder(org.mule.config.buil
> d
> ers.AbstractResourceConfigurationBuilder).configure(org.mule.api.MuleC
> o
> ntext) line: 78
> org.mule.context.DefaultMuleContextFactory.createMuleContext(org.mule.
> a pi.config.ConfigurationBuilder, java.util.Properties,
> org.mule.api.config.MuleConfiguration) line: 198
> org.mule.MuleServer.initialize() line: 391
> org.mule.MuleServer.run() line: 277
> org.mule.MuleServer.start(boolean, boolean) line: 264
> org.mule.MuleServer.main(java.lang.String[]) line: 134
>
> Ben Mathews
>


This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity
to which it is addressed. If the reader of this e-mail is not the intended
recipient or his or her authorized agent, the reader is hereby notified
that any dissemination, distribution or copying of this e-mail is
prohibited. If you have received this e-mail in error, please notify the
sender by replying to this message and delete this e-mail immediately.