I'm using IntelliJ IDEA as our IDE.
In the last day or two I've started getting the above error when trying to deploy a service.
Some trivial changes have been made to the service; that's when I first saw this error. I rolled back the changes, but still the error occurs.
I tried with other services that have not been edited, yet the same error occurs.
Has anyone seen this error?
Do you have a fix?
Internet search has not provided any great ideas.
Did you change recently your groovy library? What version of groovy do you use?
No, I have not actively changed the Groovy library.
Version is 2.4.7.
Would a Java update impact on the Groovy library?
I expect not, because I downloaded the Groovy library specifically to use with IDEA. That was done a long time ago and has not been actively updated.
Java update should make any change...
What version of Idea do you have? I'm going to try to reproduce the error.
The error was known on groovy versions > 2.4.7 of groovy. I wonder if new version of Idea now solves the issue with groovy versions > 2.4.7 and causes on groovy versions < 2.4.8
IntelliJ IDEA 2018.1 (Community Edition)
Build #IC-181.4203.550, built on March 27, 2018
JRE: 1.8.0_152-release1136-b20 amd64
JVM: OpenJDK 64-bit Server VM by JetBrains s.r.o
IDEA is up to date, and as far as I know has not been updated recently. So, not sure why this error has only just started to appear.
I see there is a later version available as 2018.1.6.
Perhaps I might try that one.
But I'll wait to see if you have any success.
I have not had a chance to do more work on this, but was wondering about:
I'll do some more investigation this afternoon.
Sorry, been busy and couldn't test Groovy 2.4.7 yet with the latest IntelliJ.
My configuration is IntelliJ 2018.1 build 181 (July 11), Java SDK 1.8.0_152, Groovy 2.4.9, Transact API 17.10. Looks like everything is working fine with this config..
Type check is mandatory for any fluent function.
The version of groovy is something you can choose (File → Other Setting → Default Project Libraries: Global Libraries).
I'm almost sure there's an issue with your groovy version, did you have previous configuration or created new for Fluent API 17?
I've made some changes, but still have the same bug.
I updated IDEA to the latest build (181 July 11th) and updated the Groovy library to 2.4.15. However, I still get the error when trying to do type-check task.
I have three projects in my IDE; one is for legacy code that is basically Groovy scripts, the second is services based on Fluent SDK, and the third is based on Transact SDK.
The problem is happening with the second project; the first does not use any ant tasks, because all the services are scripts and not classes. I have not migrated any services to the Transact project as yet (only some test cases), so have not really explored the type-check for that project.
I have Groovy set as a Global library, but I have the Fluent and Transact SDK set as libraries/modules for the specific projects.
So, I'm still working to find a solution to this.
this is starting to become a problem as I can't process any services or deploy them to DEV.
The important project that I am using is for Fluent SDK 5.1.7. It has a Groovy library v 2.4.8. I need to have the Fluent SDK in the project so that it handles the Avoka Fluent functions, but it seems that the Groovy library is an issue.
Any suggestions would be appreciated.
I wasn't able to reproduce it in my environment.
Can you please share a screenshot o your global libraries and intelliJ config like the following:
Is there any groovy lib repeated? Errors or broken links? Ant usually is coming installed in the IDE, but just in case let's check if is the proper plugin configured.
Many thanks, Julio.
thanks for the comment.
I have attached three screenshots for Project Structure, SDK, Libraries.
There are no problems displayed in the Problems tab.
I did have a separate Global Library for Groovy; it was at 2.4.8, then I updated to 2.4.15, then I deleted the Global Library and used the Groovy library that is part of the transact-fluent-api-5.1.7.
None of those scenarios work - the 'BUG' still occurs.
As I mentioned above I have three projects for the various stages of SDK evolution; a simple project that is basically scripts, a 'Fluent SDK' project, and now a 'Transact SDK' project. I set the Modules for each project, so that they don't interfere with each other across the projects.
I haven't made any conscious changes recently, aside from creating the Transact Project. When I created that project all projects were working at some point, then recently this bug appeared. So, I'm not sure what triggered the problem.
ok, let's try to fix one project.
From menu File on IntelliJ, click open and select the SDK TM17.
Then Default Project Structure , Global Libraries, add Groovy 2.4.9,also add it in Modules.
Lastly, new project based on existing files, TM17 folder bin.
Is that new project working?
sorry it's taken a while to get back to this; other problems to deal with.
I've revisited this and removed old projects and done some clean up.
I removed the global Groovy library, and updated the project to use the Transact SDK 17.10.0, which includes Groovy v2.4.12.
Current project structure is:
However, I still get the error when I try to perform type-check.
The console output has this line:
I understand that the 'SecureASTCustomizer' validates the code, but I still can't work out why the NullPointerException occurs.
I reviewed the build.properties and realised that I need to update the sdk dir to point to the transact-sdk as follows:
After doing that I get an error in the service build file that shows:
Could not load definitions from resource org/codehaus/groovy/antlib.xml. It could not be found.
also see screenshot:
Does that help explain the issue?
Yes, I think so. Try right click on you ant Build, select properties, and check this:
Then this other tab:
If both are configured,the missing part could be Global Libraries, make sure you are still pointing to your groovy libraries, like in earlier screenshots.
still no luck.
I downloaded the latest Transact SDK, 17.10.7, and set that as the project library.
However, there are still issues with taskdef, and the error that 'could not load definitions from resource org/codehaus/groovy/antlib.xml'.
In the build file for scaffold there are references to an 'assets' folder as part of the transact.api.dir.
However, I can't see that folder in the transact-sdk-17.10.7.
And I can't find any reference to the codehaus groovy/antlib.xml.
Not sure what's gone wrong here, but this is quite a challenge.
I've taken backups of all my projects, so I can create new projects. But even when I have done that there are still problems. I'm hoping that I can get the Fluent project working, rather than have to clone and rebuild all the services in a Transact SDK project.
Thanks for your help so far, but I still need some ideas to get through this.
I think I have some success.
Instead of trying to fix what I had, I decided to go back to square one and create a new transact api library and a new project template based on Fluent SDK 5.1.7.
I created the new project and created a new service. It seems that I can 'build' that service (at least type-check worked).
So, I may have solved the problem; there is still a lot of work that I need to do to get the old services into the new project and get things 'back to normal'. Bu at least it seems that the BUG! has gone.
I'll give you some updates as I progress. I may not get much done today as there are other priorities. But I do need to get this back on track, so I'll work through it as I can.
At some point I'll need to update the project to use the Transact SDK, instead of Fluent, but given the drama I've had with this, that update may be some time away, and will have to be done very methodically and thoroughly.
Thanks again for your comments and ideas, and patience.
there's still some strange behavior here.
I went back to the original Fluent project and set the project library as transact-fluent-api-5.1.7. And also had the Global Groovy library as 2.4.9.
Then I chose a service to type-check. When type-check first ran it could not resolve a particular class. So, I added the class as a file include in the service-def.json.
When I run type-check after adding the class I get the BUG! error again.
So I'm still not quite sure what's going on.
I'll keep working through this, but any ideas would be appreciated.
My build.xml is pointing to these folders:
<?xml version="1.0" encoding="utf-8"?><project name="Test SDK 17" basedir="."> <taskdef resource="com/avoka/transact/ant/antlib.xml"/> <taskdef resource="com/avoka/transact/doc/antlib.xml"/> <property file="build.properties"/> <property file="transact-auth.properties"/> <target name="clean"> <delete dir="target"/> </target>Are you using the old project build.xml?
I'm pretty sure it's config error. A new project from the latest SDK shouldn't fail. If not we might be safer if we start an installation from the scratch? Then the code from the old services can be added in a new project.
Great!, sorry I didn't read the last comment before I replied.