camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dean Thompson (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CAMEL-494) CamelBeanPostProcessor.camelContext cannot be injected if SpringCamelContext is proxied (e.g. AOP)
Date Tue, 10 Jun 2008 14:29:00 GMT

    [ https://issues.apache.org/activemq/browse/CAMEL-494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43382#action_43382
] 

Dean Thompson commented on CAMEL-494:
-------------------------------------

Claus, I think I should take the next step on this end.  If you are able to help me get unstuck
and take it,
that would be great.  But in any case, I need to reproduce my problem on a small test case.

Since I was unable to compile the project in maven (as I reported above), I decided to try
to use maven to generate an IntelliJ IDEA project.  That failed too:

Downloading: http://people.apache.org/repo/m2-incubating-repository/org/apache/camel/maven-html-to-pdf/1.4-SNAPSHOT/maven-html-to-pdf-1.4-SNAPSHOT.jar
Downloading: http://people.apache.org/repo/m2-snapshot-repository/org/apache/camel/maven-html-to-pdf/1.4-SNAPSHOT/maven-html-to-pdf-1.4-SNAPSHOT.jar
Downloading: http://download.java.net/maven/2/org/apache/camel/maven-html-to-pdf/1.4-SNAPSHOT/maven-html-to-pdf-1.4-SNAPSHOT.jar
Downloading: http://repository.codehaus.org//org/apache/camel/maven-html-to-pdf/1.4-SNAPSHOT/maven-html-to-pdf-1.4-SNAPSHOT.jar
Downloading: http://repo.open.iona.com/maven2/org/apache/camel/maven-html-to-pdf/1.4-SNAPSHOT/maven-html-to-pdf-1.4-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] A required plugin was not found: Plugin could not be found - check that the goal name
is correct: Unable to download the artifact from any repository

Try downloading the file manually from the project website.

Then, install it using the command: 
    mvn install:install-file -DgroupId=org.apache.camel -DartifactId=maven-html-to-pdf -Dversion=1.4-SNAPSHOT
-Dpackaging=maven-plugin -Dfile=/path/to/file

Alternatively, if you host your own repository you can deploy the file there: 
    mvn deploy:deploy-file -DgroupId=org.apache.camel -DartifactId=maven-html-to-pdf -Dversion=1.4-SNAPSHOT
-Dpackaging=maven-plugin -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]


  org.apache.camel:maven-html-to-pdf:maven-plugin:1.4-SNAPSHOT

from the specified remote repositories:
  apache.snapshots (http://people.apache.org/repo/m2-snapshot-repository),
  codehaus.repo (http://repository.codehaus.org/),
  open.iona.m2 (http://repo.open.iona.com/maven2),
  apache.incubating.releases (http://people.apache.org/repo/m2-incubating-repository),
  maven2-repository.dev.java.net (http://download.java.net/maven/2),
  central (http://repo1.maven.org/maven2)

  org.apache.camel:maven-html-to-pdf:maven-plugin:1.4-SNAPSHOT

from the specified remote repositories:
  apache.snapshots (http://people.apache.org/repo/m2-snapshot-repository),
  codehaus.repo (http://repository.codehaus.org/),
  open.iona.m2 (http://repo.open.iona.com/maven2),
  apache.incubating.releases (http://people.apache.org/repo/m2-incubating-repository),
  maven2-repository.dev.java.net (http://download.java.net/maven/2),
  central (http://repo1.maven.org/maven2)

If you are able to help with either a native Maven compile or a Maven -> Idea conversion,
that would be great.  Otherwise, I'll try porting your test case to ant to see it it works
or breaks for me.

> CamelBeanPostProcessor.camelContext cannot be injected if SpringCamelContext is proxied
(e.g. AOP)
> --------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-494
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-494
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-spring
>    Affects Versions: 1.3.0
>            Reporter: Dean Thompson
>            Assignee: Claus Ibsen
>             Fix For: 1.4.0
>
>         Attachments: iris-framework.xml, spring-magic.xml
>
>
> Because CamelBeanPostProcessor.setCamelContext(SpringCamelContext) takes the class SpringCamelContext
as its parameter, bean initialization fails if SpringCamelContext is proxied.  The error is
as follows:
> {code}
> org.springframework.beans.factory.BeanCreationException: Error creating bean with name
'camelContext:beanPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException:
Failed to convert property value of type [$Proxy61] to required type [org.apache.camel.spring.SpringCamelContext]
for property 'camelContext'; nested exception is java.lang.IllegalArgumentException: Cannot
convert value of type [$Proxy61] to required type [org.apache.camel.spring.SpringCamelContext]
for property 'camelContext': no matching editors or conversion strategy found
> {code}
> In my project's Spring conf, we declare <aop:aspectj-autoproxy/>, which causes
all Spring beans to be proxied.  This triggers the problem shown above.  The problem should
be reproducible by adding <aop:aspectj-autoproxy/> to any Spring config that uses <camel:camelContext>.
> The fix will be to separate the interface and class for SpringCamelContext, and use the
interface where appropriate.

-- 
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