Skip to Main Content

Application Development Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Custom Component to check the file content/mime type

Sanjeev-OFMJul 30 2019 — edited Aug 5 2019

Hello Experts,

I write a custom component to check the file content-type/Mime-Type and file extension to restrict user to upload exe and other files in WCC.

It's working till file extension and able to restrict the document upload according to my logic successfully but when I added the functionality to check the filecontent type as well so that user won't be able to add the unnecessary file via renaming the file.

I'm getting the below error. Kindly suggest how I can over come of that.

I'va used Apache Tika 1.7. (tika-app-1.21.jar) for using the Apache Tika class in my code. The Logic to identify the file MimeType is working fine in individual Java Class but in WCC it start giving error.

Error:

java.lang.LinkageError: loader constraint violation: when resolving method

"javax.xml.parsers.SAXParser.parse(Ljava/io/InputStream;Lorg/xml/sax/helpers/DefaultHandler;)V"

java.lang.LinkageError: loader constraint violation: the class loader (instance of intradoc/loader/IdcClassLoader) of the current class, org/apache/tika/mime/MimeTypesReader,

and the class loader (instance of <bootloader>) for the method's defining class, javax/xml/parsers/SAXParser,

have different Class objects for the type org/xml/sax/helpers/DefaultHandler used in the signature

         

Thanks

Sanjeev

Comments
Post Details
Added on Jul 30 2019
14 comments
453 views