Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Error in creating a DCR
Pavan
Hi,
I am calling an inline command from my DCT as follows:
<item name="topic">
<select required="t">
<inline command="c:\test.cmd"/>
</select>
</item>
test.cmd is executing a Java program to access a list of 'Topics' from database. After retrieving it from database, I format the response XML, which looks as follows:
<?xml version="1.0" encoding="UTF-8">
<substitution>
<option value="Lead" label="Lead"/>
<option value="Tin" label="Tin"/>
</substitution>
This XML is in the same format as described in examples also.
But, when I try to create a new DCR based on that DCT, it gives me the following error:
The markup in the document preceding the root element must be well-formed.
Line 2, Column 1, PublicID null, SystemID null
2002-10-07 05:08:25 - Ctx( /iw/webdesk ): Exception in: R( /iw/webdesk + /templating/templatingErrorPage.jsp + null) - java.lang.NullPointerException
at com.interwoven.templating.DCRDocumentBean.getRuleset(DCRDocumentBean.java:184)
at com.interwoven.templating.DCRDocumentBean.getScriptTags(DCRDocumentBean.java:174)
at com.interwoven.templating.DatacaptureServlet.setScriptTag(DatacaptureServlet.java:1696)
at com.interwoven.templating.DatacaptureServlet.doCreateNewDCRForm(DatacaptureServlet.java:954)
at com.interwoven.templating.DatacaptureServlet.doGet(DatacaptureServlet.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at com.interwoven.framework.base.FrameworkServlet.service(FrameworkServlet.java:66)
at com.interwoven.framework.auth.AuthServlet.service(AuthServlet.java:105)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
at org.apache.tomcat.core.Handler.service(Handler.java:287)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:423)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
at java.lang.Thread.run(Thread.java:484)
Find more posts tagged with
Comments
Migrateduser
just a thought, but what is "c:\test.cmd"? Is this some sort of batch file? If so you may need to pass it throught the windows command interpreter (cmd.exe) for it to run. The inline will get run prior to the xml of the dct is sent to the xml parser. The error indicates that the inline command is either not returning valid xml or there is something other that is being returned by the inline.
When you run "c:\test.cmd" from the command line what do you get back? If "c:\test.cmd" is a java program I would seriously suggest you think about choosing another language. the startup time for a small java application to just print out some xml is enormous. you could get the same output from a small perl program with a whole lot less overhead. Take a look at iw-home/examples/Templating/config/example_server_side_inline_callout.ipl
to see how just about the same thing is done. remember that you really don't want an inline to have to take any time if at all to complete running. each time someone opens a dct that calls this inline you will pay a penalty in performance waiting for the inline to complete. it is in your best interest to make the inline as streamlined as possible (things like if you need to get data from a database you may want to build an interface that builds a static file on the server that can be just printed out when needed rather than making a db call each time a dct is opened).
Adam Stoller
Don't know if this was a typo in just the post - but ...
-----------------------------------
test.cmd is executing a Java program to access a list of 'Topics' from database. After retrieving it from database, I format the response XML, which looks as follows:
<?xml version="1.0" encoding="UTF-8">
<substitution>
<option value="Lead" label="Lead"/>
<option value="Tin" label="Tin"/>
</substitution>
---------------------------------
The first line begins with '<?' should also end with '?>' not just '>'
--fish
(Interwoven, Curriculum Development)
Pavan
Here is the contents of test.cmd file.
cd c:\
java -cp c:\ tester
tester is a java program which interacts with database and returns a list and generates XML in the required format and sends to std. output.
If I run test.cmd on a command prompt then I get the proper XML.
Pavan
This is just a typo error in my post.
it is
<?xml version="1.0" encoding="UTF-8"?>
Thanks
Pavan
james1
As nacks said, you need to specify cmd.exe in the <inline> command.
Yes, if you run "test.cmd" it works from your command line. Also, if you type "foo.doc", then Microsoft Word will open the document "foo.doc". This is due to Windows file associations. However, the inline command (as well as workflow external tasks) do not work with Windows file associations; they must be given actual executable programs.
-- James
--
James H Koh
Interwoven Engineering
Pavan
That didn't help either.
Thanks
Pavan
Migrateduser
If you tried to use cmd.exe in the inline can you show us the exact line you have in your dct now?
is it something like:
<inline command="c:\WINNT\System32\cmd.exe c:\test.cmd"/>
If not, please try the above.
Another thing to try... in your test.cmd try echoing some text to an output file to see if it is even being run. Better yet, output the system env variables to a file in test.cmd and see what you get.
Adam Stoller
I think that should be:
command="c:\WINNT\System32\cmd.exe
/c
c:\test.cmd"
--fish
(Interwoven, Curriculum Development)
Migrateduser
yeah... sorry, Ghoti is correct. not really a windows guy
.
I would still suggest that you really think about skipping using the batch script with the embedded java command. it is really the one of the least efficient ways of writing an inline in the first place.