You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Scott Parkerson (JIRA)" <ji...@apache.org> on 2009/07/02 23:10:06 UTC
[jira] Created: (CAMEL-1788) camel-flatpack does not work inside of
an OSGi bundle in ServiceMix 4
camel-flatpack does not work inside of an OSGi bundle in ServiceMix 4
---------------------------------------------------------------------
Key: CAMEL-1788
URL: https://issues.apache.org/activemq/browse/CAMEL-1788
Project: Apache Camel
Issue Type: Bug
Components: camel-flatpack
Affects Versions: 1.6.0
Environment: Flatpack 3.1.1
Fuse ESB 4.1.0.0 (Apache Servicemix)
Camel 1.6.0.0-fuse
Reporter: Scott Parkerson
The following code will not work under Servicemix, but works fine in standalone Camel:
{code:java}
FlatpackDataFormat fpdf = new FlatpackDataFormat();
fpdf.setDefinition(new ClassPathResource("dataspecs/mypzmap.xml"));
fpdf.setFixed(false);
fpdf.setDelimiter('|');
fpdf.setIgnoreFirstRecord(false);
from("activemq:" + incomingQueueName).convertBodyTo(String.class).unmarshal(fpdf).to("activemq:input_to_call");
{code}
This NPEs when attempting to unmarshal under SMX 4, but works fine in Camel 1.6.x. I've traced down the problem to this code in Flatpack:
{code:title=net/sf/flatpack/util/ParseUtils.java}
public static Properties loadConvertProperties() throws IOException {
final Properties pzConvertProps = new Properties();
final URL url = ParserUtils.class.getClassLoader().getResource("fpconvert.properties");
pzConvertProps.load(url.openStream());
return pzConvertProps;
}
{code}
The classloader under SMX is the bundle's classloader, which (of course) cannot find fpconvert.properties, which makes url null, and then causes pzConvertProps.load(...) to raise an NPE.
I know that this isn't strictly a bug in Camel or SMX, but I thought I'd file it here as an action item to either change upstream flatpack or note a possible workaround on the wiki.
I suspect that this is a problem with all versions of Camel + SMX including the latest version.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (CAMEL-1788) camel-flatpack does not work inside
of an OSGi bundle in ServiceMix 4
Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-1788?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen resolved CAMEL-1788.
--------------------------------
Resolution: Incomplete
Closing this as reported is providing details and the problem is the flatpack library and not Camel
> camel-flatpack does not work inside of an OSGi bundle in ServiceMix 4
> ---------------------------------------------------------------------
>
> Key: CAMEL-1788
> URL: https://issues.apache.org/activemq/browse/CAMEL-1788
> Project: Apache Camel
> Issue Type: Bug
> Components: camel-flatpack
> Affects Versions: 1.6.0
> Environment: Flatpack 3.1.1
> Fuse ESB 4.1.0.0 (Apache Servicemix)
> Camel 1.6.0.0-fuse
> Reporter: Scott Parkerson
> Assignee: Willem Jiang
>
> The following code will not work under Servicemix, but works fine in standalone Camel:
> {code:java}
> FlatpackDataFormat fpdf = new FlatpackDataFormat();
> fpdf.setDefinition(new ClassPathResource("dataspecs/mypzmap.xml"));
> fpdf.setFixed(false);
> fpdf.setDelimiter('|');
> fpdf.setIgnoreFirstRecord(false);
> from("activemq:" + incomingQueueName).convertBodyTo(String.class).unmarshal(fpdf).to("activemq:input_to_call");
> {code}
> This NPEs when attempting to unmarshal under SMX 4, but works fine in Camel 1.6.x. I've traced down the problem to this code in Flatpack:
> {code:title=net/sf/flatpack/util/ParseUtils.java}
> public static Properties loadConvertProperties() throws IOException {
> final Properties pzConvertProps = new Properties();
> final URL url = ParserUtils.class.getClassLoader().getResource("fpconvert.properties");
> pzConvertProps.load(url.openStream());
> return pzConvertProps;
> }
> {code}
> The classloader under SMX is the bundle's classloader, which (of course) cannot find fpconvert.properties, which makes url null, and then causes pzConvertProps.load(...) to raise an NPE.
> I know that this isn't strictly a bug in Camel or SMX, but I thought I'd file it here as an action item to either change upstream flatpack or note a possible workaround on the wiki.
> I suspect that this is a problem with all versions of Camel + SMX including the latest version.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CAMEL-1788) camel-flatpack does not work inside
of an OSGi bundle in ServiceMix 4
Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-1788?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=55053#action_55053 ]
Willem Jiang commented on CAMEL-1788:
-------------------------------------
I think We should change to use the thread context loader to load the fpconvert.properties from the user bundle.
> camel-flatpack does not work inside of an OSGi bundle in ServiceMix 4
> ---------------------------------------------------------------------
>
> Key: CAMEL-1788
> URL: https://issues.apache.org/activemq/browse/CAMEL-1788
> Project: Apache Camel
> Issue Type: Bug
> Components: camel-flatpack
> Affects Versions: 1.6.0
> Environment: Flatpack 3.1.1
> Fuse ESB 4.1.0.0 (Apache Servicemix)
> Camel 1.6.0.0-fuse
> Reporter: Scott Parkerson
>
> The following code will not work under Servicemix, but works fine in standalone Camel:
> {code:java}
> FlatpackDataFormat fpdf = new FlatpackDataFormat();
> fpdf.setDefinition(new ClassPathResource("dataspecs/mypzmap.xml"));
> fpdf.setFixed(false);
> fpdf.setDelimiter('|');
> fpdf.setIgnoreFirstRecord(false);
> from("activemq:" + incomingQueueName).convertBodyTo(String.class).unmarshal(fpdf).to("activemq:input_to_call");
> {code}
> This NPEs when attempting to unmarshal under SMX 4, but works fine in Camel 1.6.x. I've traced down the problem to this code in Flatpack:
> {code:title=net/sf/flatpack/util/ParseUtils.java}
> public static Properties loadConvertProperties() throws IOException {
> final Properties pzConvertProps = new Properties();
> final URL url = ParserUtils.class.getClassLoader().getResource("fpconvert.properties");
> pzConvertProps.load(url.openStream());
> return pzConvertProps;
> }
> {code}
> The classloader under SMX is the bundle's classloader, which (of course) cannot find fpconvert.properties, which makes url null, and then causes pzConvertProps.load(...) to raise an NPE.
> I know that this isn't strictly a bug in Camel or SMX, but I thought I'd file it here as an action item to either change upstream flatpack or note a possible workaround on the wiki.
> I suspect that this is a problem with all versions of Camel + SMX including the latest version.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Issue Comment Edited: (CAMEL-1788) camel-flatpack does not
work inside of an OSGi bundle in ServiceMix 4
Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-1788?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=55053#action_55053 ]
Willem Jiang edited comment on CAMEL-1788 at 10/28/09 5:27 AM:
---------------------------------------------------------------
I think We should change to use the thread context loader to load the fpconvert.properties from the user bundle.
BTW, it is a servicemix-bundle issue, I will try to create a patch for it.
was (Author: njiang):
I think We should change to use the thread context loader to load the fpconvert.properties from the user bundle.
> camel-flatpack does not work inside of an OSGi bundle in ServiceMix 4
> ---------------------------------------------------------------------
>
> Key: CAMEL-1788
> URL: https://issues.apache.org/activemq/browse/CAMEL-1788
> Project: Apache Camel
> Issue Type: Bug
> Components: camel-flatpack
> Affects Versions: 1.6.0
> Environment: Flatpack 3.1.1
> Fuse ESB 4.1.0.0 (Apache Servicemix)
> Camel 1.6.0.0-fuse
> Reporter: Scott Parkerson
>
> The following code will not work under Servicemix, but works fine in standalone Camel:
> {code:java}
> FlatpackDataFormat fpdf = new FlatpackDataFormat();
> fpdf.setDefinition(new ClassPathResource("dataspecs/mypzmap.xml"));
> fpdf.setFixed(false);
> fpdf.setDelimiter('|');
> fpdf.setIgnoreFirstRecord(false);
> from("activemq:" + incomingQueueName).convertBodyTo(String.class).unmarshal(fpdf).to("activemq:input_to_call");
> {code}
> This NPEs when attempting to unmarshal under SMX 4, but works fine in Camel 1.6.x. I've traced down the problem to this code in Flatpack:
> {code:title=net/sf/flatpack/util/ParseUtils.java}
> public static Properties loadConvertProperties() throws IOException {
> final Properties pzConvertProps = new Properties();
> final URL url = ParserUtils.class.getClassLoader().getResource("fpconvert.properties");
> pzConvertProps.load(url.openStream());
> return pzConvertProps;
> }
> {code}
> The classloader under SMX is the bundle's classloader, which (of course) cannot find fpconvert.properties, which makes url null, and then causes pzConvertProps.load(...) to raise an NPE.
> I know that this isn't strictly a bug in Camel or SMX, but I thought I'd file it here as an action item to either change upstream flatpack or note a possible workaround on the wiki.
> I suspect that this is a problem with all versions of Camel + SMX including the latest version.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CAMEL-1788) camel-flatpack does not work inside
of an OSGi bundle in ServiceMix 4
Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-1788?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=54366#action_54366 ]
Claus Ibsen commented on CAMEL-1788:
------------------------------------
Have you raised this issue at Flatpack as well?
> camel-flatpack does not work inside of an OSGi bundle in ServiceMix 4
> ---------------------------------------------------------------------
>
> Key: CAMEL-1788
> URL: https://issues.apache.org/activemq/browse/CAMEL-1788
> Project: Apache Camel
> Issue Type: Bug
> Components: camel-flatpack
> Affects Versions: 1.6.0
> Environment: Flatpack 3.1.1
> Fuse ESB 4.1.0.0 (Apache Servicemix)
> Camel 1.6.0.0-fuse
> Reporter: Scott Parkerson
>
> The following code will not work under Servicemix, but works fine in standalone Camel:
> {code:java}
> FlatpackDataFormat fpdf = new FlatpackDataFormat();
> fpdf.setDefinition(new ClassPathResource("dataspecs/mypzmap.xml"));
> fpdf.setFixed(false);
> fpdf.setDelimiter('|');
> fpdf.setIgnoreFirstRecord(false);
> from("activemq:" + incomingQueueName).convertBodyTo(String.class).unmarshal(fpdf).to("activemq:input_to_call");
> {code}
> This NPEs when attempting to unmarshal under SMX 4, but works fine in Camel 1.6.x. I've traced down the problem to this code in Flatpack:
> {code:title=net/sf/flatpack/util/ParseUtils.java}
> public static Properties loadConvertProperties() throws IOException {
> final Properties pzConvertProps = new Properties();
> final URL url = ParserUtils.class.getClassLoader().getResource("fpconvert.properties");
> pzConvertProps.load(url.openStream());
> return pzConvertProps;
> }
> {code}
> The classloader under SMX is the bundle's classloader, which (of course) cannot find fpconvert.properties, which makes url null, and then causes pzConvertProps.load(...) to raise an NPE.
> I know that this isn't strictly a bug in Camel or SMX, but I thought I'd file it here as an action item to either change upstream flatpack or note a possible workaround on the wiki.
> I suspect that this is a problem with all versions of Camel + SMX including the latest version.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (CAMEL-1788) camel-flatpack does not work inside
of an OSGi bundle in ServiceMix 4
Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-1788?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Willem Jiang reassigned CAMEL-1788:
-----------------------------------
Assignee: Willem Jiang
> camel-flatpack does not work inside of an OSGi bundle in ServiceMix 4
> ---------------------------------------------------------------------
>
> Key: CAMEL-1788
> URL: https://issues.apache.org/activemq/browse/CAMEL-1788
> Project: Apache Camel
> Issue Type: Bug
> Components: camel-flatpack
> Affects Versions: 1.6.0
> Environment: Flatpack 3.1.1
> Fuse ESB 4.1.0.0 (Apache Servicemix)
> Camel 1.6.0.0-fuse
> Reporter: Scott Parkerson
> Assignee: Willem Jiang
>
> The following code will not work under Servicemix, but works fine in standalone Camel:
> {code:java}
> FlatpackDataFormat fpdf = new FlatpackDataFormat();
> fpdf.setDefinition(new ClassPathResource("dataspecs/mypzmap.xml"));
> fpdf.setFixed(false);
> fpdf.setDelimiter('|');
> fpdf.setIgnoreFirstRecord(false);
> from("activemq:" + incomingQueueName).convertBodyTo(String.class).unmarshal(fpdf).to("activemq:input_to_call");
> {code}
> This NPEs when attempting to unmarshal under SMX 4, but works fine in Camel 1.6.x. I've traced down the problem to this code in Flatpack:
> {code:title=net/sf/flatpack/util/ParseUtils.java}
> public static Properties loadConvertProperties() throws IOException {
> final Properties pzConvertProps = new Properties();
> final URL url = ParserUtils.class.getClassLoader().getResource("fpconvert.properties");
> pzConvertProps.load(url.openStream());
> return pzConvertProps;
> }
> {code}
> The classloader under SMX is the bundle's classloader, which (of course) cannot find fpconvert.properties, which makes url null, and then causes pzConvertProps.load(...) to raise an NPE.
> I know that this isn't strictly a bug in Camel or SMX, but I thought I'd file it here as an action item to either change upstream flatpack or note a possible workaround on the wiki.
> I suspect that this is a problem with all versions of Camel + SMX including the latest version.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CAMEL-1788) camel-flatpack does not work inside
of an OSGi bundle in ServiceMix 4
Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-1788?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=55054#action_55054 ]
Willem Jiang commented on CAMEL-1788:
-------------------------------------
@Scott,
Can you submit a small test case which use the "fpconvert.properties" file?
It will be helpful for me to verify my change on the flatpack bundle.
> camel-flatpack does not work inside of an OSGi bundle in ServiceMix 4
> ---------------------------------------------------------------------
>
> Key: CAMEL-1788
> URL: https://issues.apache.org/activemq/browse/CAMEL-1788
> Project: Apache Camel
> Issue Type: Bug
> Components: camel-flatpack
> Affects Versions: 1.6.0
> Environment: Flatpack 3.1.1
> Fuse ESB 4.1.0.0 (Apache Servicemix)
> Camel 1.6.0.0-fuse
> Reporter: Scott Parkerson
> Assignee: Willem Jiang
>
> The following code will not work under Servicemix, but works fine in standalone Camel:
> {code:java}
> FlatpackDataFormat fpdf = new FlatpackDataFormat();
> fpdf.setDefinition(new ClassPathResource("dataspecs/mypzmap.xml"));
> fpdf.setFixed(false);
> fpdf.setDelimiter('|');
> fpdf.setIgnoreFirstRecord(false);
> from("activemq:" + incomingQueueName).convertBodyTo(String.class).unmarshal(fpdf).to("activemq:input_to_call");
> {code}
> This NPEs when attempting to unmarshal under SMX 4, but works fine in Camel 1.6.x. I've traced down the problem to this code in Flatpack:
> {code:title=net/sf/flatpack/util/ParseUtils.java}
> public static Properties loadConvertProperties() throws IOException {
> final Properties pzConvertProps = new Properties();
> final URL url = ParserUtils.class.getClassLoader().getResource("fpconvert.properties");
> pzConvertProps.load(url.openStream());
> return pzConvertProps;
> }
> {code}
> The classloader under SMX is the bundle's classloader, which (of course) cannot find fpconvert.properties, which makes url null, and then causes pzConvertProps.load(...) to raise an NPE.
> I know that this isn't strictly a bug in Camel or SMX, but I thought I'd file it here as an action item to either change upstream flatpack or note a possible workaround on the wiki.
> I suspect that this is a problem with all versions of Camel + SMX including the latest version.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.