You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "David S Hunter (Jira)" <ji...@apache.org> on 2021/07/20 06:51:00 UTC

[jira] [Comment Edited] (OFBIZ-12286) Changes in dtds or parsers coused ofbiz build to crash

    [ https://issues.apache.org/jira/browse/OFBIZ-12286?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17383815#comment-17383815 ] 

David S Hunter edited comment on OFBIZ-12286 at 7/20/21, 6:50 AM:
------------------------------------------------------------------

Hello, I had the same problem yesterday. I went through the code and I found out that the location for the URL  had an extra string at the beginning.  The string was "file:" . When I removed those characters from the beginning of the string, the program was able to parse the xml document. 

The program was not looking in the correct location. Here is an where the program was looking for entityengine.xml: 

[file:C:/Users/david/Documents/apache-ofbiz-17.12.07/build/resources/main/entityengine.xml|file:///C:/Users/david/Documents/apache-ofbiz-17.12.07/build/resources/main/entityengine.xml]

 

Here is where the program should have been looking: 

C:/Users/david/Documents/apache-ofbiz-17.12.07/build/resources/main/entityengine.xml

 

I put the following line on on line 471 of UtilXml.java:

 

docDescription.replace("file:", "");

 

I am not 100% sure if this was the same issue or if I need to create a new ticket. I am not that great at programming so I am not sure if this is a good fix to do. 

 

Can anyone let me know if they had a similar issue or if this works? 

 

Thanks, and good luck

 

 

 

 


was (Author: dshunter107):
Hello, I had the same problem a few days ago. I went through the code and I found out that the location for the URL  had an extra string at the beginning.  The string was "file:" . When I removed those characters from the beginning of the string, the program was able to parse the xml document. 

The program was not looking in the correct location. Here is an where the program was looking for entityengine.xml: 

file:C:/Users/david/Documents/apache-ofbiz-17.12.07/build/resources/main/entityengine.xml

 

Here is where the program should have been looking: 

C:/Users/david/Documents/apache-ofbiz-17.12.07/build/resources/main/entityengine.xml

 

I put the following line on on line 471 of UtilXml.java:

 

docDescription.replace("file:", "");

 

I am not 100% sure if this was the same issue or if I need to create a new ticket. I am not that great at programming so I am not sure if this is a good fix to do. 

 

Can anyone let me know if they had a similar issue or if this works? 

 

Thanks, and good luck

 

 

 

 

> Changes in dtds or parsers coused ofbiz build to crash
> ------------------------------------------------------
>
>                 Key: OFBIZ-12286
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-12286
>             Project: OFBiz
>          Issue Type: Bug
>          Components: base
>    Affects Versions: 17.12.04
>         Environment: Centos Linux 8
> PostgreSQL
> openjdk version "11.0.9" 2020-10-20 LTS
>            Reporter: Alexander Tzvetanov
>            Assignee: Jacques Le Roux
>            Priority: Blocker
>
> Without any changes Ofbiz build became broken.
> I suppose something has changed in dtds or sax parser. Tests started failing.
> In order to see what is wrong I ran Ofbiz with tests excluded. And I found that XML Sax Parser started crashing:
> 2021-07-19 13:45:07,904 |kJoinPool-1-worker-3 |EntityEcaUtil |E| null
> org.apache.ofbiz.base.config.GenericConfigException: Error reading ComponentResourceHandler from XML file [content] with loaderName [main] and location [entitydef/eecas.xml] (Premature end of file.)
>  at org.apache.ofbiz.base.component.ComponentResourceHandler.getDocument(ComponentResourceHandler.java:74) ~[ofbiz.jar:?]
>  at org.apache.ofbiz.entityext.eca.EntityEcaUtil.getEcaDefinitions(EntityEcaUtil.java:138) [ofbiz.jar:?]
>  at org.apache.ofbiz.entityext.eca.EntityEcaUtil.access$000(EntityEcaUtil.java:48) [ofbiz.jar:?]
>  at org.apache.ofbiz.entityext.eca.EntityEcaUtil$1.call(EntityEcaUtil.java:157) [ofbiz.jar:?]
>  at org.apache.ofbiz.entityext.eca.EntityEcaUtil$1.call(EntityEcaUtil.java:155) [ofbiz.jar:?]
>  at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1448) [?:?]
>  at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290) [?:?]
>  at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020) [?:?]
>  at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656) [?:?]
>  at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594) [?:?]
>  at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183) [?:?]
> Caused by: org.xml.sax.SAXParseException: Premature end of file.
>  at org.apache.xerces.parsers.DOMParser.parse(Unknown Source) ~[xercesImpl-2.9.1.jar:?]
>  at org.apache.ofbiz.base.util.UtilXml.readXmlDocument(UtilXml.java:581) ~[ofbiz.jar:?]
>  at org.apache.ofbiz.base.util.UtilXml.readXmlDocument(UtilXml.java:420) ~[ofbiz.jar:?]
>  at org.apache.ofbiz.base.component.ComponentResourceHandler.getDocument(ComponentResourceHandler.java:72) ~[ofbiz.jar:?]
>  ... 10 more
> The obvious build crash is the following:
> > Task :test
> WARNING: An illegal reflective access operation has occurred
> WARNING: Illegal reflective access by com.thoughtworks.xstream.core.util.Fields (file:/home/midax/.gradle/caches/modules-2/files-2.1/com.thoughtworks.xstream/xstream/1.4.11.1/6c120c45a8c480bb2fea5b56502e3993ddd74fd2/xstream-1.4.11.1.jar) to field java.util.TreeMap.comparator
> WARNING: Please consider reporting this to the maintainers of com.thoughtworks.xstream.core.util.Fields
> WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
> WARNING: All illegal access operations will be denied in a future release
> org.apache.ofbiz.entity.util.EntitySaxReaderTests > parse FAILED
>  java.lang.IllegalStateException at EntitySaxReaderTests.java:82
> org.apache.ofbiz.entity.DelegatorUnitTests > delegatorCreationUsingConstructorFailsIfConfigurationIsMissing FAILED
>  java.lang.AssertionError
> org.apache.ofbiz.entity.DelegatorUnitTests > delegatorCreationUsingFactoryGetDelegator FAILED
>  java.lang.AssertionError at DelegatorUnitTests.java:87
> org.apache.ofbiz.entity.DelegatorUnitTests > delegatorCreationUsingFactoryGetInstance FAILED
>  java.lang.AssertionError at DelegatorUnitTests.java:75
> org.apache.ofbiz.entity.DelegatorUnitTests > delegatorCreationUsingConstructor FAILED
>  org.apache.ofbiz.entity.GenericEntityConfException at DelegatorUnitTests.java:63
> 30 tests completed, 5 failed
> > Task :test FAILED
> FAILURE: Build failed with an exception.
> In my environment I use patched gradle version that has been supplied in issue OFBIZ-12100



--
This message was sent by Atlassian Jira
(v8.3.4#803005)