You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2019/04/10 08:16:49 UTC

[Bug 63332] New: Issue related to ClassCastException which we are facing while using poi-4.0.1 along with java 11.

https://bz.apache.org/bugzilla/show_bug.cgi?id=63332

            Bug ID: 63332
           Summary: Issue related to ClassCastException which we are
                    facing while using poi-4.0.1 along with java 11.
           Product: POI
           Version: unspecified
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HPSF
          Assignee: dev@poi.apache.org
          Reporter: snag@opentext.com
  Target Milestone: ---

hi,

We are using poi-4.0.1 to extract office properties. However, we are getting
the below ClassCastException while performing the extraction. Could you please
help ?

Caused by: java.lang.ClassCastException: class java.lang.String cannot be cast
to class org.apache.poi.hpsf.CustomProperty (java.lang.String is in module
java.base of loader 'bootstrap'; org.apache.poi.hpsf.CustomProperty is in
unnamed module of loader org.apache.catalina.loader.ParallelWebappClassLoader
@71092212)
        at
com.emc.o2.api.config.modules.attribute.extract.O2ExtractOffice2003.getAttributesFromFile(O2ExtractOffice2003.java:97)

Regards,
Sushmita

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 63332] Issue related to ClassCastException which we are facing while using poi-4.0.1 along with java 11.

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63332

--- Comment #3 from Sushmita Nag <sn...@opentext.com> ---
Code causing classcastexception: 

CustomProperty property = (CustomProperty) e.getValue();

            CustomProperties newCustomProperties = dsi.getCustomProperties();
            Iterator iterator = customProperties.entrySet().iterator();
            while (iterator.hasNext())
            {
                Map.Entry e = (Map.Entry) iterator.next();
                CustomProperty property = (CustomProperty) e.getValue();
                String name = property.getName();
                Object oldValue = property.getValue();
            }

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 63332] Issue related to ClassCastException which we are facing while using poi-4.0.1 along with java 11.

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63332

Andreas Beeker <ki...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All
             Status|NEW                         |NEEDINFO

--- Comment #1 from Andreas Beeker <ki...@apache.org> ---
Hi Sushmita,

please also upload your example file otherwise we can't validate/fix this
issue.

Andi

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 63332] Issue related to ClassCastException which we are facing while using poi-4.0.1 along with java 11.

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63332

--- Comment #5 from PJ Fanning <fa...@yahoo.com> ---
Sushmita - where does the code from your comment of 2019-04-10 09:43:14 UTC
come from?

If it is your code, then you shouldn't be doing a class cast. You should check
if the value is an instanceof CustomProperty before casting it.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 63332] Issue related to ClassCastException which we are facing while using poi-4.0.1 along with java 11.

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63332

--- Comment #2 from Sushmita Nag <sn...@opentext.com> ---
Created attachment 36517
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36517&action=edit
Issue related to ClassCastException which we are facing while using poi-4.0.1
along with java 11

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 63332] Issue related to ClassCastException which we are facing while using poi-4.0.1 along with java 11.

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63332

Andreas Beeker <ki...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|NEW                         |RESOLVED

--- Comment #6 from Andreas Beeker <ki...@apache.org> ---
From the JavaDoc of CustomProperties:

While this class is roughly HashMap<Long,CustomProperty>, that's the
internal representation. To external calls, it should appear as
HashMap<String,Object> mapping between Names and Custom Property Values.


I think, this is enough explaining the error - I'm closing this now as
"invalid".

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 63332] Issue related to ClassCastException which we are facing while using poi-4.0.1 along with java 11.

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63332

Sushmita Nag <sn...@opentext.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 63332] Issue related to ClassCastException which we are facing while using poi-4.0.1 along with java 11.

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63332

--- Comment #4 from Sushmita Nag <sn...@opentext.com> ---
hi Andrea,

Could you please provide us information on the same ?

Regards,
Sushmita

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org