cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wim Verreycken (JIRA)" <>
Subject [jira] Commented: (CXF-1502) String ambigeous after import org.apache.cxf.jaxws.javaee.String
Date Sun, 06 Apr 2008 05:41:24 GMT


Wim Verreycken commented on CXF-1502:

<jaxws:endpoint/> uses a org.apache.cxf.service.factory.ReflectionServiceFactoryBean.
(but where is that ns declared? there's no and 
couldn't find it in any of the classpath xml files either)
This calls a  org.apache.cxf.jaxws.JaxWsSererFactoryBean.

This imports a lot of things, which in turn import a lot
of other things. In the end, org.apache.cxf.jaxws.javaee.PortComponentType
is imported.

This is where things go wrong, imho.
line 91 :
@XmlElement(name = "port-component-name", required = true)
    protected org.apache.cxf.jaxws.javaee.String portComponentName;

org.apache.cxf.jaxws.javaee.String get imported when this gets constructed
(actually, i think more because this is constructed, but were dealing with reflection here
forgive me if i'm not clear on this)

After the call returns, of maybe straight away (...), this results in String being ambigous
so it always has to be specified using the package name.

But Spring ioc/di uses reflection and
mostly uses Class.forName(String forName) to obtain a refference to the class.

And that is Class.forName(String forName) and not Class.forName(java.lang.String forName).

To make thing worse, but unavoidable, org.apache.cxf.jaxws.javaee.String also extends
java.lang.Object which defines 

public String toString() {
	return getClass().getName() + "@" + Integer.toHexString(hashCode());

Again. String and not java.lang.String.

So whenver org.apache.cxf.jaxws.javaee.String get's loaded String becomes ambigious
and reflection (and half the jdk) become useless unless every String is updated to
java.lang.String in the code.

I'd suggest renaming org.apache.cxf.jaxws.javaee.String to
org.apache.cxf.jaxws.javaee.CString  (Complex String, what it is). Otherwise imho,
you can expect more problelms.

> String ambigeous after import org.apache.cxf.jaxws.javaee.String
> ----------------------------------------------------------------
>                 Key: CXF-1502
>                 URL:
>             Project: CXF
>          Issue Type: Bug
>          Components: Core, Integration, JAX-WS Runtime, JAXB Databinding, Service Model
>    Affects Versions: 2.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5, 2.1, 2.0.6, 2.1.1
>         Environment: all os, all platform, cxf 2.0.0 or higher
>            Reporter: Wim Verreycken
>            Priority: Critical
>   Original Estimate: 4h
>  Remaining Estimate: 4h
> Spring and CFX can't work together. Everything ends with a :
> Unsatisfied dependency expressed through constructor argument with
> dex 2 of type [java.lang.String]: Ambiguous constructor argument types - did you specify
the correct bean references as constructor arguments?

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

View raw message