You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by Eduardo Eduardo <ed...@gmail.com> on 2019/10/16 15:42:47 UTC

Compiling ooxml-schemas-1.1.jar in a different namespace

Hi,

I have to support both ooxml-schemas-1.1 and ooxml.schemas1.4 in my application at the same time as I have to support different POI versions (for legacy purposes). For POI, I used the jarjar utility ( https://github.com/shevek/jarjar ) to repackage the legacy POI org.apache.poi into org.repackage.org.apache.poi. So the new POI will use org.apache.poi and the legacy POI will use org.repackage.org.apache.poi. 
So far so good.

The problem arrives with the legacy ooxml-schemas-1.1.jar. If I use jarjar to repackage it, I get a ClassCastException. 
I read that this is because of namespace collisions, so I have to recompile ooxml-schemas-1.1.jar with a new namespace that doesn't collide with the ooxml-schemas.1.4.jar namespace. 

In the FAQs I read the following:
"you can run the ant task "compile-ooxml-xsds" to have the OOXML schemas downloaded and compiled for you".
What would you recommend to change the namespace before compiling them? What would I have to change and do you have any recommendations for this? 

Best regards,
Edu

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Re: Compiling ooxml-schemas-1.1.jar in a different namespace

Posted by PJ Fanning <fa...@yahoo.com.INVALID>.
 How about writing 2 microservices, 1 for each POI version? Then you won't need to repackage any of the jars.
    On Wednesday 16 October 2019, 22:38:02 GMT+1, Eduardo Eduardo <ed...@gmail.com> wrote:  
 
 Hi,

I have to support both ooxml-schemas-1.1 and ooxml.schemas1.4 in my application at the same time as I have to support different POI versions (for legacy purposes). For POI, I used the jarjar utility ( https://github.com/shevek/jarjar ) to repackage the legacy POI org.apache.poi into org.repackage.org.apache.poi. So the new POI will use org.apache.poi and the legacy POI will use org.repackage.org.apache.poi. 
So far so good.

The problem arrives with the legacy ooxml-schemas-1.1.jar. If I use jarjar to repackage it, I get a ClassCastException. 
I read that this is because of namespace collisions, so I have to recompile ooxml-schemas-1.1.jar with a new namespace that doesn't collide with the ooxml-schemas.1.4.jar namespace. 

In the FAQs I read the following:
"you can run the ant task "compile-ooxml-xsds" to have the OOXML schemas downloaded and compiled for you".
What would you recommend to change the namespace before compiling them? What would I have to change and do you have any recommendations for this? 

Best regards,
Edu

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org