Return-Path: X-Original-To: apmail-cxf-issues-archive@www.apache.org Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1D74BF81E for ; Thu, 4 Apr 2013 16:11:20 +0000 (UTC) Received: (qmail 7540 invoked by uid 500); 4 Apr 2013 16:11:19 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 7414 invoked by uid 500); 4 Apr 2013 16:11:19 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 7156 invoked by uid 99); 4 Apr 2013 16:11:18 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Apr 2013 16:11:18 +0000 Date: Thu, 4 Apr 2013 16:11:18 +0000 (UTC) From: "Rex Wang (JIRA)" To: issues@cxf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CXF-4947) Potential problems with the JAXBContext being null MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CXF-4947?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Rex Wang updated CXF-4947: -------------------------- Description: I post a mail to mail list to describe this. And Daniel fixed it very quickly. I still open this JIRA to record this issue, so that I can get a numbered patch merging to my runtime. Thanks. -- hi devs, I found some intermittent NullpointerException, and it is very hard to reproduce but I did have met a lot of times, and it is thrown from different places from runtime: Stack Dump = java.lang.NullPointerException at org.apache.cxf.common.jaxb.JAXBUtils.generateJaxbSchemas(JAXBUtils.java:765) at org.apache.cxf.jaxb.JAXBDataBinding.generateJaxbSchemas(JAXBDataBinding.java:440) at org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:363) at org.apache.cxf.service.factory.AbstractServiceFactoryBean.initializeDataBindings(AbstractServiceFactoryBean.java:86) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:469) at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.buildServiceFromClass(JaxWsServiceFactoryBean.java:690) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:531) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:247) After checking the codes, they are all about the jaxbcontext is null. >From the JAXBContextCache.CachedContextAndSchemas, I notice this line: private WeakReference context; IMHO, WeakReference is not a good choice to do cache, it could be gc in any time. For example, JAXBContextCache.getCachedContextAndSchemas(..) ctx = cachedContextAndSchemas.getContext() <-- then the ctx will be null here So I guess this is the root cause of the intermittent issue. was: I post a mail to mail list to describe this. And Daniel fixed it very quickly. I still open this JIRA to record this issue, so that I can get a numbered patch merging to my runtime. Thanks. ---- hi devs, I found some intermittent NullpointerException, and it is very hard to reproduce but I did have met a lot of times, and it is thrown from different places from runtime: Stack Dump = java.lang.NullPointerException at org.apache.cxf.common.jaxb.JAXBUtils.generateJaxbSchemas(JAXBUtils.java:765) at org.apache.cxf.jaxb.JAXBDataBinding.generateJaxbSchemas(JAXBDataBinding.java:440) at org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:363) at org.apache.cxf.service.factory.AbstractServiceFactoryBean.initializeDataBindings(AbstractServiceFactoryBean.java:86) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:469) at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.buildServiceFromClass(JaxWsServiceFactoryBean.java:690) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:531) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:247) After checking the codes, they are all about the jaxbcontext is null. >From the JAXBContextCache.CachedContextAndSchemas, I notice this line: private WeakReference context; IMHO, WeakReference is not a good choice to do cache, it could be gc in any time. For example, JAXBContextCache.getCachedContextAndSchemas(..) ctx = cachedContextAndSchemas.getContext() <-- then the ctx will be null here So I guess this is the root cause of the intermittent issue. > Potential problems with the JAXBContext being null > -------------------------------------------------- > > Key: CXF-4947 > URL: https://issues.apache.org/jira/browse/CXF-4947 > Project: CXF > Issue Type: Bug > Components: JAXB Databinding > Affects Versions: 2.7.4, 2.6.7 > Reporter: Rex Wang > Fix For: 2.6.8, 2.7.5 > > Attachments: r1464133_for_trunk.diff, r1464141_for_br2.6.x.diff, r1464185_for_br2.6.x.diff > > > I post a mail to mail list to describe this. And Daniel fixed it very quickly. I still open this JIRA to record this issue, so that I can get a numbered patch merging to my runtime. Thanks. > -- > hi devs, > I found some intermittent NullpointerException, and it is very hard to reproduce but I did have met a lot of times, and it is thrown from different places from runtime: > Stack Dump = java.lang.NullPointerException > at org.apache.cxf.common.jaxb.JAXBUtils.generateJaxbSchemas(JAXBUtils.java:765) > at org.apache.cxf.jaxb.JAXBDataBinding.generateJaxbSchemas(JAXBDataBinding.java:440) > at org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:363) > at org.apache.cxf.service.factory.AbstractServiceFactoryBean.initializeDataBindings(AbstractServiceFactoryBean.java:86) > at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:469) > at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.buildServiceFromClass(JaxWsServiceFactoryBean.java:690) > at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:531) > at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:247) > After checking the codes, they are all about the jaxbcontext is null. > From the JAXBContextCache.CachedContextAndSchemas, I notice this line: > private WeakReference context; > IMHO, WeakReference is not a good choice to do cache, it could be gc in any time. For example, > JAXBContextCache.getCachedContextAndSchemas(..) > > ctx = cachedContextAndSchemas.getContext() <-- then the ctx will be null here > So I guess this is the root cause of the intermittent issue. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira