InterPSS-Project / ipss-plugin

InterPSS plugin projects
8 stars 11 forks source link

Build errors while importing ipss.plugin.sample #31

Closed thakars closed 4 years ago

thakars commented 4 years ago

Hello everyone,

I was trying to run InterPSS. I added ipss-common to the workspace. I am able to run a power flow from ipss.tutorial>src>org.interpss.tutorial.ch2_intro>SampleLoadFlow.java However, when I add ipss-plugin.sample, there are some (8) build path errors:

Project 'ipss.sample' is missing required Java project: 'ipss.plugin.base' Project 'ipss.sample' is missing required Java project: 'ipss.plugin.core' Project 'ipss.sample' is missing required Java project: 'ipss.plugin.dc' Project 'ipss.sample' is missing required Java project: 'ipss.plugin.dstab' Project 'ipss.sample' is missing required Java project: 'ipss.plugin.multiNet' Project 'ipss.sample' is missing required Java project: 'ipss.plugin.opf' Project 'ipss.sample' is missing required Java project: 'ipss.pssl' The project cannot be built until build path errors are resolved

When I import those projects, I get more (53) build path errors (see attached text files)

If I manually remove the entries to these from the .classpath file for ipss.plugin.sample, i.e. remove following lines and add eclipse emf and hazelnut jars manually to the build path then it compiles and runs the power flow successfully but gives an error in line 64 "loadflowWithAdjustment(msg);" (although these two issues may or may not be related):

<classpathentry combineaccessrules="false" kind="src" path="/ipss.plugin.base"/>
<classpathentry combineaccessrules="false" kind="src" path="/ipss.plugin.core"/>
<classpathentry combineaccessrules="false" kind="src" path="/ipss.plugin.dc"/>
<classpathentry combineaccessrules="false" kind="src" path="/ipss.plugin.dstab"/>
<classpathentry combineaccessrules="false" kind="src" path="/ipss.plugin.multiNet"/>
<classpathentry combineaccessrules="false" kind="src" path="/ipss.plugin.opf"/>
<classpathentry combineaccessrules="false" kind="src" path="/ipss.pssl"/>

Thanks! ipss.plugin.sample_build_errors_2.txt

jinjingfarm commented 4 years ago

The ipss-plugin/ipss.sample .classpath has been updated. Please give another try.

thakars commented 4 years ago

Thank you for the quick reply. With the new .classpath, I had following experiences:

On a new workspace, I imported ipss-common and new ipss.sample. I had the following errors:

The project was not built since its build path is incomplete. Cannot find the class file for org.eclipse.emf.common.util.EList. Fix the build path then try building this project The type org.eclipse.emf.common.util.EList cannot be resolved. It is indirectly referenced from required .class files

after adding emf jar files to path, this was resolved. There were no mode build errors. Then when I ran 'simpleLoadflow.java' from 'org.interpss.sample.aclf' package of ipss.sample, following error was seen on the console:

Error: Unable to initialize main class org.interpss.sample.aclf.SampleLoadflow Caused by: java.lang.NoClassDefFoundError: com/hazelcast/nio/serialization/DataSerializable

So I added the hazelcast jars also from ipss.lib.3rdPty/lib/cache

When I ran 'simpleLoadFlow.java' again,

Exception in thread "main" java.lang.NoClassDefFoundError: com/interpss/core/aclf/impl/AclfFactoryImpl at com.interpss.core.aclf.AclfFactory.(AclfFactory.java:26) at com.interpss.CoreObjectFactory.createAclfNetwork(CoreObjectFactory.java:363) at org.interpss.sample.aclf.SampleLoadflow.simpleLoadflow(SampleLoadflow.java:69) at org.interpss.sample.aclf.SampleLoadflow.main(SampleLoadflow.java:60) Caused by: java.lang.ClassNotFoundException: com.interpss.core.aclf.impl.AclfFactoryImpl at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:604) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ... 4 more

So I added ipss.lib/lib/ipss/ipss_core.impl.jar

And then in the main function of 'simpleLoadFlow.java', functions 'simpleLoadflow' and 'simpleLoadflowPSSL' work and show output on the console. 'loadflowWithAdjustment' still gives the following error (same as yesterday, I don't know if this is a separate issue):

com.interpss.common.exp.InterpssException: The bus for createFunctionLoad is not a ZIP load bus at com.interpss.CoreObjectFactory.createFunctionLoad(CoreObjectFactory.java:741) at org.interpss.sample.aclf.SampleLoadflow.loadflowWithAdjustment(SampleLoadflow.java:182) at org.interpss.sample.aclf.SampleLoadflow.main(SampleLoadflow.java:64)

Thank you!!

jinjingfarm commented 4 years ago

Thank you for the feedback. A new Wiki page has been added to guide you to set up your dev env.

https://github.com/InterPSS-Project/ipss-common/wiki/Env-Configuration

Hopefully, it will help.

jinjingfarm commented 4 years ago

Also, ipss.core.impl.jar has been removed. Now all you need is the ipss.core.jar file.

thakars commented 4 years ago

Hello,

Sorry for the late reply. With the new ipss-common and ipss-plugin, and using the above wiki page, I am able to run the sample load flow file. The function 'loadflowWithAdjustment' still gives error but that would probably be a separate issue (I am not using that feature so it is fine for me for now but let me know if you want me to open it as a separate issue on github). If you want, you can close this issue, thank you!

jinjingfarm commented 4 years ago

thakars, please open a separate issue for the "The bus for createFunctionLoad is not a ZIP load bus" issue. Thanks.