Win a copy of React Cookbook: Recipes for Mastering the React Framework this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

JAXB/reflection exceptions (unable to inject)

 
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have an application which has recently been producing exception traces in my log file regarding JAXB binding. I can't catch these exceptions with a catch block around the line where the exception is happening, perhaps the log messages are coming from the web server itself (SJWS7) which is just printing the exceptions and swallowing them. The exceptions I see look like the below, and they are happening when I hit a line of code in which I am getting a new instance of a JAXBContext.

Any clues as to why this is happening would be really appreciated, it doesn't make sense to me. Thanks in advance!


--James



Unable to inject com/sun/scn/cs/domain/data/DomainInfo$JaxbAccessorM_getDomainName_setDomainName_java_lang_String
java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.sun.xml.bind.v2.runtime.reflect.opt.Injector.inject(Injector.java:125)
at com.sun.xml.bind.v2.runtime.reflect.opt.Injector.inject(Injector.java:48)
at com.sun.xml.bind.v2.runtime.reflect.opt.AccessorInjector.prepare(AccessorInjector.java:51)
at com.sun.xml.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory.get(OptimizedAccessorFactory.java:77)
at com.sun.xml.bind.v2.runtime.reflect.Accessor$GetterSetterReflection.optimize(Accessor.java:308)
at com.sun.xml.bind.v2.runtime.property.SingleElementLeafProperty.<init>(SingleElementLeafProperty.java:45)
at sun.reflect.GeneratedConstructorAccessor6.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at com.sun.xml.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:88)
at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:135)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:404)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:246)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:76)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:55)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:124)
at sun.reflect.GeneratedMethodAccessor40.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:132)
at javax.xml.bind.ContextFinder.find(ContextFinder.java:286)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:372)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:337)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:244)
at com.sun.scn.cs.accountmgmt.dao.DomainInfoDAO.<init>(DomainInfoDAO.java:53)
at com.sun.scn.cs.accountmgmt.rest.GetDomain.<init>(GetDomain.java:37)
at com.sun.scn.cs.accountmgmt.DomainMgmtService.invoke(DomainMgmtService.java:104)
at com.sun.scn.cs.accountmgmt.DomainMgmtService.invoke(DomainMgmtService.java:34)
at com.sun.xml.ws.server.provider.ProviderPeptTie._invoke(ProviderPeptTie.java:65)
at com.sun.xml.ws.protocol.xml.server.XMLMessageDispatcher.invokeEndpoint(XMLMessageDispatcher.java:162)
at com.sun.xml.ws.protocol.xml.server.XMLMessageDispatcher.access$400(XMLMessageDispatcher.java:67)
at com.sun.xml.ws.protocol.xml.server.XMLMessageDispatcher$XmlInvoker.invoke(XMLMessageDispatcher.java:470)
at com.sun.xml.ws.protocol.xml.server.XMLMessageDispatcher.receive(XMLMessageDispatcher.java:110)
at com.sun.xml.ws.server.Tie.handle(Tie.java:90)
at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.handle(WSServletDelegate.java:335)
at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doGet(WSServletDelegate.java:193)
at com.sun.xml.ws.transport.http.servlet.WSServlet.doGet(WSServlet.java:88)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:796)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:917)
at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:391)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:272)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:241)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:182)
at org.apache.catalina.core.StandardPipeline.in
[29/May/2007:12:04:28] fine (26125) ja-z1: for host 172.20.28.163 trying to GET /accountmgmt/domain, service-j2ee reports: Unable to inject com/sun/scn/cs/domain/data/DomainInfo$JaxbAccessorM_getDomainName_setDomainName_java_lang_String
java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.sun.xml.bind.v2.runtime.reflect.opt.Injector.inject(Injector.java:125)
at com.sun.xml.bind.v2.runtime.reflect.opt.Injector.inject(Injector.java:48)
at com.sun.xml.bind.v2.runtime.reflect.opt.AccessorInjector.prepare(AccessorInjector.java:51)
at com.sun.xml.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory.get(OptimizedAccessorFactory.java:77)
at com.sun.xml.bind.v2.runtime.reflect.Accessor$GetterSetterReflection.optimize(Accessor.java:308)
at com.sun.xml.bind.v2.runtime.reflect.TransducedAccessor$CompositeTransducedAccessorImpl.<init>(TransducedAccessor.java:193)
at com.sun.xml.bind.v2.runtime.reflect.TransducedAccessor.get(TransducedAccessor.java:135)
at com.sun.xml.bind.v2.runtime.property.SingleElementLeafProperty.<init>(SingleElementLeafProperty.java:47)
at sun.reflect.GeneratedConstructorAccessor6.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at com.sun.xml.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:88)
at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:135)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:404)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:246)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:76)
 
James Adams
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It turns out that my problem was having a wrong prefix name in the package-info.java for my data package. Once I used the correct prefix name and rebuilt the JAR then my troubles went away.

The line in question in the package-info.java where the error was located:

@javax.xml.bind.annotation.XmlNs(prefix =
 
James Adams
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It seems that the incorrect prefix was not the problem after all -- any suggestions/ideas are very welcome!

--James
 
If you like strawberry rhubarb pie, try blueberry rhubarb (bluebarb) pie. And try this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic