Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LS Script library not compiled correctly when using LS2J #299

Open
mpradny opened this issue Mar 3, 2022 · 5 comments
Open

LS Script library not compiled correctly when using LS2J #299

mpradny opened this issue Mar 3, 2022 · 5 comments

Comments

@mpradny
Copy link
Contributor

mpradny commented Mar 3, 2022

I have an agent that calls code from a LS library that internally uses LS2J. There seems to be a problem with compilation - no error is reported, but the code does not run. When the reference to LS2J/Java is removed, compilation works just fine.

I suspect that the problem is caused by the import order

importLotusScriptLibraries(importer, database);
importBasicElements(importer, database);

I think we have changed it to compile Shared Actions correctly, so it will be probably necessary to import java libs separately, before importing LotusScript libraries and then the rest of the basic elements.

I'm attaching a simple odp project with the problem. Just try to run TestAgent after compilation.
odp_ls2jtst.zip

I was running the build with 3.8.1 on 12.0.1 in Docker.

@jesse-gallagher
Copy link
Member

Hmm, looking at this, I suspect that the trouble is that it'd need the compileBasicElementLotusScript property in the Maven plugin configuration set to true - I had to make it false by default because the usual case in practice is to dramatically increase build times and to often hit syntax errors in ancient code that don't actually prevent the app from working.

I get an syntax-error problem when running it locally, but it's possible that it's due to a Mac-specific thing: the 12.x macOS client is kind of FUBAR in some ways when it comes to compilation, so that may be the cause.

If you have a chance, could you try compiling with that flag set in the pom.xml?

@mpradny
Copy link
Contributor Author

mpradny commented Mar 16, 2022

I'll try it. I actually started to implement the separation of imports on Friday, but for unknown reasons, I'm not able to build NSFODP anymore - Bundle org.openntf.nsfodp.compiler - Missing Constraint: Import-Package: lotus.domino; version="0.0.0" I wasn't in the mood for fighting with Tycho .. I think it worked before I updated my repo from 3.4.x to the latest, but it's been a while since I tried it.

I pushed my updates to mpradny@daa2704

I'll check the compileBasicElementLotusScript and maybe fix my build later today and let you know.

@mpradny
Copy link
Contributor Author

mpradny commented Mar 16, 2022

I tried the flag and with 3.8.1 it's giving me compilation error

[ERROR] Note ID 314: TestAgent - org.openntf.nsfodp.commons.odp.notesapi.NDominoException: com.darwino.domino.napi.DominoException: LotusScript Error - Syntax Error.

I managed to fix my build - there were 2 issues. For whatever reason, I'm not able to build it with the US you gave me. It gives me the error I've posted above. Second part of my problem was my too naive approach to update the version to 3.8.2-SNAPSHOT. After fixing these, I was able to build the NSF and the agent calling ls2j works. I haven't tried to compile anything more complex so far.

I just merged your latest changes to get to 3.8.2-SNAPSHOT - it's all in https://github.com/mpradny/org.openntf.nsfodp/tree/java_sl_split

@jesse-gallagher
Copy link
Member

Ahhhhh, that makes sense. If that holds together on your end, could you open up a PR for it when you have a chance? I'll test it with my projects - it seems like it should work just fine.

jesse-gallagher added a commit that referenced this issue Mar 16, 2022
#299 Early import of Java Script libraries
@jesse-gallagher
Copy link
Member

That PR is looking good here. I've merged it in - I also had bumped the version to 3.9.0-SNAPSHOT in dev, so it's included in that stream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants