[jira] [Commented] (OFBIZ-6783) Refactor the start component

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OFBIZ-6783) Refactor the start component

Nicolas Malin (Jira)

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

Jacques Le Roux commented on OFBIZ-6783:
----------------------------------------

Maybe not a big deal, but at the end of running
bq. java -jar ofbiz.jar --test component=minilang --test suitename=MinilangTests
I got
{code}
2016-05-25 10:33:55,357 |0.0.0.0-startStop-1  |ServiceDispatcher             |I| De-Registering dispatcher: scrum
2016-05-25 10:33:56,082 |dExecutor-6-thread-1 |CoreContainer                 |E| Error creating core [solrdefault]: This CoreContainer has been close
java.lang.IllegalStateException: This CoreContainer has been close
        at org.apache.solr.core.CoreContainer.registerCore(CoreContainer.java:658) ~[solr-core-5.3.1.jar:5.3.1 1703449 - noble - 2015-09-17 01:48:15]
        at org.apache.solr.core.CoreContainer.create(CoreContainer.java:731) [solr-core-5.3.1.jar:5.3.1 1703449 - noble - 2015-09-17 01:48:15]
        at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:443) [solr-core-5.3.1.jar:5.3.1 1703449 - noble - 2015-09-17 01:48:15]
        at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:434) [solr-core-5.3.1.jar:5.3.1 1703449 - noble - 2015-09-17 01:48:15]
        at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_91]
        at org.apache.solr.common.util.ExecutorUtil$MDCAwareThreadPoolExecutor$1.run(ExecutorUtil.java:210) [solr-solrj-5.3.1.jar:5.3.1 1703449 - noble - 2015-09-17 01:48:17]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_91]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_91]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_91]
2016-05-25 10:33:56,082 |kExecutor-2-thread-1 |CoreContainer                 |E| Error waiting for SolrCore to be created
java.util.concurrent.ExecutionException: org.apache.solr.common.SolrException: Unable to create core [solrdefault]
        at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.8.0_91]
        at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_91]
        at org.apache.solr.core.CoreContainer$2.run(CoreContainer.java:472) [solr-core-5.3.1.jar:5.3.1 1703449 - noble - 2015-09-17 01:48:15]
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_91]
        at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_91]
        at org.apache.solr.common.util.ExecutorUtil$MDCAwareThreadPoolExecutor$1.run(ExecutorUtil.java:210) [solr-solrj-5.3.1.jar:5.3.1 1703449 - noble - 2015-09-17 01:48:17]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_91]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_91]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_91]
Caused by: org.apache.solr.common.SolrException: Unable to create core [solrdefault]
        at org.apache.solr.core.CoreContainer.create(CoreContainer.java:737) ~[solr-core-5.3.1.jar:5.3.1 1703449 - noble - 2015-09-17 01:48:15]
        at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:443) ~[solr-core-5.3.1.jar:5.3.1 1703449 - noble - 2015-09-17 01:48:15]
        at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:434) ~[solr-core-5.3.1.jar:5.3.1 1703449 - noble - 2015-09-17 01:48:15]
        ... 5 more
Caused by: java.lang.IllegalStateException: This CoreContainer has been close
        at org.apache.solr.core.CoreContainer.registerCore(CoreContainer.java:658) ~[solr-core-5.3.1.jar:5.3.1 1703449 - noble - 2015-09-17 01:48:15]
        at org.apache.solr.core.CoreContainer.create(CoreContainer.java:731) ~[solr-core-5.3.1.jar:5.3.1 1703449 - noble - 2015-09-17 01:48:15]
        at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:443) ~[solr-core-5.3.1.jar:5.3.1 1703449 - noble - 2015-09-17 01:48:15]
        at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:434) ~[solr-core-5.3.1.jar:5.3.1 1703449 - noble - 2015-09-17 01:48:15]
        ... 5 more
2016-05-25 10:33:56,085 |0.0.0.0-startStop-1  |ServiceContainer              |I| Removing from cache dispatcher: solr
2016-05-25 10:33:56,085 |0.0.0.0-startStop-1  |ServiceDispatcher             |I| De-Registering dispatcher: solr
2016-05-25 10:33:56,089 |0.0.0.0-startStop-1  |ServiceContainer              |I| Removing from cache dispatcher: projectmgr
2016-05-25 10:33:56,089 |0.0.0.0-startStop-1  |ServiceDispatcher             |I| De-Registering dispatcher: projectmgr
{code}

I expect to review the whole commit soon...

> Refactor the start component
> ----------------------------
>
>                 Key: OFBIZ-6783
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-6783
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: Upcoming Branch
>            Reporter: Taher Alkhateeb
>            Assignee: Taher Alkhateeb
>              Labels: framework, main, refactoring, start
>         Attachments: OFBIZ-6783.patch, OFBIZ-6783.patch, OFBIZ-6783.patch, OFBIZ-6783.patch, OFBIZ-6783.patch, OFBIZ-6783.patch, OFBIZ-6783.patch, OFBIZ-6783.patch, OFBIZ-6783.patch, OFBIZ-6783.patch, OFBIZ-6783.patch, OFBIZ-6783.patch, OFBIZ-6783.patch, StartCommandUtil.java
>
>
> Looking at the main method and design of Start.java and the start component overall looks ugly. The things I would like to fix so far are:
> - the files are too long
> - some variables are not even needed (loaderArgs?)
> - the level of abstraction is wrong
> - main throws an exception!
> - the arguments processing logic is terrible, need to move it to commons-cli
> It's just so messy and ugly to look at. So for me refactoring starts at Start! Given that this is an important component, I will provide a patch to be reviewed by the community before committing just to be on the safe side.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)