Hi

short answer is no, API changed and there is no compatibility between
both normally.

That said:
- TomEE 1.7.2-SNAPSHOT uses 2.6.16 so maybe it is fixed
- TomEE 2 already uses CXF 3

If you want to patch it yourself you can need to modify
openejb-cxf-transport/opeenjb-cxf-/openejb-cxf-rs (looks a lot but
changes are very localized so it is "possible").




Romain Manni-Bucau
@rmannibucau
http://www.tomitribe.com
http://rmannibucau.wordpress.com
https://github.com/rmannibucau


2014-12-17 10:14 GMT+01:00 DonatasCiuksys <[email protected]>:
> I'm currently on TomEE 1.7.1 PLUS (CXF 2.6.14). CXF has a bug - it cannot
> handle File attachments if file name contains single quote symbol ("):
>
> -----------------------------------------------------------------------
> java.lang.StringIndexOutOfBoundsException: String index out of range: -1
>                            at java.lang.String.substring(String.java:1954)
> ~[na:1.8.0_25]
>                            at
> org.apache.cxf.attachment.AttachmentUtil.createAttachment(AttachmentUtil.java:315)
> ~[cxf-api-2.6.14.jar:2.6.14]
>                            at
> org.apache.cxf.attachment.AttachmentDeserializer.createAttachment(AttachmentDeserializer.java:289)
> ~[cxf-api-2.6.14.jar:2.6.14]
>                            at
> org.apache.cxf.attachment.AttachmentDeserializer.readNext(AttachmentDeserializer.java:192)
> ~[cxf-api-2.6.14.jar:2.6.14]
>                            at
> org.apache.cxf.attachment.LazyAttachmentCollection$1.hasNext(LazyAttachmentCollection.java:95)
> ~[cxf-api-2.6.14.jar:2.6.14]
>                            at
> org.apache.cxf.attachment.LazyDataSource.load(LazyDataSource.java:51)
> ~[cxf-api-2.6.14.jar:2.6.14]
>                            at
> org.apache.cxf.attachment.LazyDataSource.getInputStream(LazyDataSource.java:88)
> ~[cxf-api-2.6.14.jar:2.6.14]
>                            at
> javax.activation.DataHandler.getInputStream(DataHandler.java:238)
> ~[na:1.8.0_25]
> -----------------------------------------------------------------------
>
> CXF source (org.apache.cxf.attachment.AttachmentUtil.java):
>
> if (fileName.indexOf("\"") > 0) {
>     fileName = fileName.substring(fileName.indexOf("\"") + 1,
> fileName.lastIndexOf("\""));
>
> This is WRONG: if fileName contains single quote symbol, begin index becomes
> larger than end index, and String.substring() blows up (as seen above). I
> cannot control file names - files are external to my system.
>
> This bug seems to be fixed in CXF 2.7. Can I (and how) upgrade CXF in TomEE
> PLUS?
>
>
>
>
> --
> View this message in context: 
> http://tomee-openejb.979440.n4.nabble.com/How-to-upgrade-CXF-to-2-7-tp4673228.html
> Sent from the TomEE Users mailing list archive at Nabble.com.

Reply via email to