dezynetechnologies / alfresco-pdf-toolkit

Automatically exported from code.google.com/p/alfresco-pdf-toolkit
Other
0 stars 0 forks source link

PdfToolkit 4.2.e java.lang.IllegalArgumentException: The ServiceRegistry must be supplied. #31

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Use the javascript console and runt the code attached. Make sure the document 
object is set (start the javascript console from right click of pdf in document 
library or assign by adding code).

What is the expected output? What do you see instead?
Text 'Example stamp text' stamped to document
Instead
Caused by: java.lang.IllegalArgumentException: The ServiceRegistry must be 
supplied.
    at org.alfresco.repo.template.TemplateNode.<init>(TemplateNode.java:127)
See attached error.log

What version of the product are you using? On what operating system?
4.2.e, MacOs (my dev environment)
PDFToolkit 1.1.1. bet download from here, custom build version with pom changed 
to use 4.2.e. Same result.

Please provide any additional information below.

Original issue reported on code.google.com by pe...@loftux.se on 30 Oct 2013 at 1:11

Attachments:

GoogleCodeExporter commented 9 years ago
I also tested the variant
var watermarkAction = actions.create("pdf-watermark");
but the error is the same.

Original comment by pe...@loftux.se on 30 Oct 2013 at 1:53

GoogleCodeExporter commented 9 years ago
I've now tested to runt the example js code attached to the issue using action 
execute. I did this by saving the script in Data Dictionary/Scripts and then 
executed the script in Alfresco Explorer as an action.

In this case it works.

The issue remains using Javascript console and using javascript behaviour. I'll 
get back in that, but it looks like it is not a pdftoolkit issue.

Original comment by pe...@loftux.se on 30 Oct 2013 at 2:18

GoogleCodeExporter commented 9 years ago
I was missing the serviceRegistry property in the bean
See below. With that, the issue can be closed. Not sure how to fix the 
javascript console, I have an older version installed, it might be fixed there.

            <bean class="org.alfresco.repo.jscript.ScriptBehaviour" parent="scriptBehaviour">
                <property name="notificationFrequency">
                    <value>TRANSACTION_COMMIT</value>
                </property>
                <property name="location">
                    <bean class="org.alfresco.repo.jscript.ClasspathScriptLocation">
                        <constructor-arg>
                            <value>alfresco/module/client/context/scripts/examplepath.js</value>
                        </constructor-arg>
                    </bean>
                </property>
                <property name="serviceRegistry">
                    <ref bean="ServiceRegistry" />
                </property>
            </bean>

Original comment by pe...@loftux.se on 30 Oct 2013 at 2:29