# Transact SDK svc-helpdoc NullPointer exception

1
0
-1

Hi,

I have set up a new project in my IDE (IntelliJ IDEA) and created a service and a collaboration job.

However, when I try to package the services there is an error at the svc-helpdoc task with NullPointer exception.

The console shows "path\to\my\controller\null (The system cannot find the file specified)".

The controller service only has two files, the job-definition.json and the service-def.json, so I don't know which file is missing to cause the above error.

Any ideas of how to overcome this issue?

Thanks

Mark

1. Mark Murray

The Ant Build console has output that suggests there is an error in the class: com.avoka.transact.doc.ServiceDoc.execute(ServiceDoc.groovy:103)

I have examined that class, but there is too much obfuscation to be able to work out clearly what the error may be.

At some point the code tries to read a file, but fails because the file does not exist.

However, I can't determine which file is the offender, or why the code does not skip a non-existant file. There is no clear indication of the name of the missing file.

If anyone can shed some more light on this it would be appreciated.

Thanks

Mark

2. Julio Berrueco

Hi Mark,

That's a funny error.

Can you find the string "path\to\my\controller" in your project?

Try to search all files all project. May help to find where that configuration is missing.

Julio.

3. Mark Murray

Hi Julio,

thanks for the comment.

Yes the path exists in my project. When I scaffold the service I choose type = Job Controller. The Ant task creates the folder 'project/path/etc/controller/ and creates two files in the folder - job-definition.json, and service-def.json.

However, when I run the task svc-helpdoc I receive the error mentioned.

It seems that the task is looking for a file named 'null'. But clearly that does not make sense.

Not sure where to go from here.

Thanks

Mark

4. Julio Berrueco

Hi Mark,

It's really odd. To me it looks like the ant task is missing the controller name some where, so when the task is run is trying to find a fill which name is null / or non defined.

What's you SDK version? I'll base my example in SDK TM5 ie:

I'm having a look on the ant task, there's an argument called "service.code", I believe that's the missed one.

Check new-services.properties file, is "service.code= " having any value like:

# - service.code is a short code used for the source directory, the archive file name, build file project name etc...# Note: It must unique in the project, contain no spaces and use a hyphen for logical separation. E.g.# instantid-idv# pca-addresssearchservice.code=welcome

When a new service is built, also a new ant built-servcieName.xml is created. The help task on it should be working.

Please, let me know if it useful, or if you use higher SDK version, to carry on finding the issue.

Kind regards,

Julio.

5. Mark Murray

Hi Julio,

Yes, this is odd.

This project is using Transact SDK 17.10.0.

So, there is no new-service.properties file. In this case the Ant task to create a new service is svc-scaffold. That task asks for input to collect service name (name) package name (packageName) and service template (template).

It does seem like the Ant task cannot find the correct file name, so is using 'null'.

Thanks

Mark

6. Julio Berrueco

Hi Mark,

OK, TM 17 is different, Build Properties is introduce as well as the new tasks.

Do you remember how you build the controller? Did you select Onboarding, Review? Does service name contain any space or weird character?

And the last not the least, the build.xml, is it from you brand new project?   svc-helpdoc is also slightly different in TM17 and I'm not sure now whether you can see it as a tasks or not.

Cheers,

Julio.

7. Mark Murray

Hi Julio,

I built the controller as a two step review.

I checked the service-def for the controller and found there was a space in the name - it was "Add Signatory", so I changed that to "AddSignatory". However, when I run the svc-helpdoc task again it still has the same error.

Yes, build.xml is from the brand new project. It has all the new tasks. Yes, all the task are visible in the Ant Build tab in IDEA.

Thanks

Mark

1.
1
0
-1

Hi Mark,

I found the issue.

Everything you have done is good, there's no problem.

The issue with the null is because help-doc is meant to be use only with services containing groovyScript parameter.

A job controller will call different functions but it's not a groovy script but a json file. So in your service definition you have "name": "jobDefinition", parameter but not "name": "groovyScript". The doc is created from some tags in the script.

What I'm investigating now is what's the proper place to locate the controller to avoid that error or of this is a bug  on the task.

I'll come back to you soon with the answer to that last thought.

Kind regards,

Julio.

1. Julio Berrueco

It seems like there's a known issue on that task. I'm raising a ticket to solve it. In the meantime you can try to comment the task to build the package. Or maybe add the controller afterwards in TM...

2. Mark Murray

Hi Julio,

thanks for the investigation and the information. That's good to know that I am on the right track.

It will be good to hear about the bug fix.

Thanks

Mark