I'm trying to insert data to my local DB using a XML file. Actually I did it using postman client in chrome, I put the XML definition and I gave my service URL send it by POST and in work fine.
Now I'm trying to do it with curl commandline, this is the line that I'm using:
curl -F "file=#/Users/Jonathan/Documents;filename=variable.xml" 127.0,0.1:8080/WU-BDP-MetadataManagement/v1/variables
Where file# is the path to my XML file and variable.xml is my file name next to my service URL but this is not working.
Some advice of what im doing wrong?
Regards!
You are using the whole directory instead of file /Users/Jonathan/Documents and it should be something like /Users/Jonathan/Documents/variable.xml
So your overall command will be
curl -F "file=#/Users/Jonathan/Documents/variable.xml;filename=variable.xml" 127.0,0.1:8080/WU-BDP-MetadataManagement/v1/variables
Related
I have a lot of SVG files that needed to be converted into PDF files. When I call Batik from console, I get the following error;
~\batik-1.10>java -jar batik-rasterizer-1.10.jar -d "D:/PDF" -m application/pdf
-dpi 1200 -w 9921 -h 14031 "D:/SVG/topic*.svg"
> About to transcode 1 SVG file(s)
> Converting d:/SVG/topic*.svg to D:\PDF\topic*.pdf ... ... error (SVGConverter.error.cannot.open.source)
> org.apache.batik.apps.rasterizer.SVGConverterException: Error: cannot open source topic*.svg java.io.IOException: Unable to make sense of URL for connection
at org.apache.batik.apps.rasterizer.SVGConverter.transcode(SVGConverter.java:968)
at org.apache.batik.apps.rasterizer.SVGConverter.execute(SVGConverter.java:717)
at org.apache.batik.apps.rasterizer.Main.execute(Main.java:937)
at org.apache.batik.apps.rasterizer.Main.main(Main.java:990)
What is the problem here?
I was able to recreate your problem (getting the IOException with message "Unable to make sense of URL for connection"), using your command as listed.
I think in this case, the easiest thing to do would be to eliminate the use of quotes on your source directory path, and execute the following:
java -jar batik-rasterizer-1.10.jar -d "D:/PDF" -m application/pdf -dpi 1200 -w 9921 -h 14031 D:/SVG/topic*.svg
I tried running the example command on Mac from the command line, but it fails to run. I'm wondering what file is not found. My desktop directory does, in fact, exist. Am I missing some configuration or something?
I just downloaded all the dcm4che-5.12.0 code and sample scripts and executed the command from the example when using the --help option.
The example command is what I tried, and is shown in the attached screenshot. I'm not sure what is missing, and it's not exactly clear.
Any guidance will be appreciated, thanks!
According to the documentation, you have to provide a file and not a directory name to the --dicomdir option (with two "-" by the way):
--dicomdir <file> specify path to a DICOMDIR file of
a DICOM File-set into which
received objects are stored and
from which requested objects are
retrieved
Actually, the example from the documentation reads as follows:
Example: dcmqrscp -b DCMQRSCP:11112 --dicomdir /media/cdrom/DICOMDIR
=> Starts server listening on port 11112, accepting association requests
with DCMQRSCP as called AE title.
I am trying a very basic http request with jmeter, but it seems to always get the error below. I have tried a simple get against google which is fine but the internal servers are not :
java.net.NoRouteToHostException: No route to host (Host unreachable)
I can curl the same url successfully with a 200 response, so not sure if its jmeter or java? The only thing that is unique is that our internal servers are resolving with ipv6, but I would not think that would be the problem?
Try adding the next line to system.properties file (lives in "bin" folder of your JMeter installation)
java.net.preferIPv6Addresses=true
Or pass the aforementioned property via -D command-line argument like:
jmeter -Djava.net.preferIPv6Addresses=true -n -t test.jmx -l result.jtl
References:
Java: Networking Properties
Configuring JMeter
Apache JMeter Properties Customization Guide
Overriding Properties Via The Command Line
I'm trying to write a Java application that uses the JournalParser to extract authors, citations, etc. from journal articles. The documentation for the GrobidJournalParser gives instructions for the command line app and for TikaServer. I need to point to Grobid running somewhere other than localhost:8080. I have a GrobidExtractor.properties file containing the correct URL on my classpath, but it doesn't seem to get found - I get an error because it's trying to access Grobid on localhost:8080.
WARNING: Interceptor for {http://localhost:8080/processHeaderDocument}WebClient has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: No message body writer has been found for class org.apache.cxf.jaxrs.ext.multipart.MultipartBody, ContentType: multipart/form-data
at org.apache.cxf.jaxrs.client.WebClient$BodyWriter.doWriteBody(WebClient.java:1220)
Is there some other way to tell Tika or the JournalParser where to find Grobid? The Javadocs were not helpful in this regard.
As explained in the documentation on using GROBID with Tika, if you want to configure Tika to use an alternate GROBID server you do so with a file named org/apache/tika/parser/journal/GrobidExtractor.properties
You have only called yours GrobidExtractor.properties, which is why it isn't being picked up. The full path is required
Assuming you're using Linux, using the Tika app, and with the GROBID properties in the current directory, you'd need to fix it with something like:
mkdir -p org/apache/tika/parser/journal
mv GrobidExtractor.properties org/apache/tika/parser/journal/
java -classpath .:tika-app-1.13.jar org.apache.tika.cli.TikaCLI --metadata journal.pdf
I'm trying to install JavaBridge as I want to make connections between my php files and Java files.
I need my php request a GET method to Java file, and Java file will get the ID and run some script and return with an ARRAY.
I tried to install JavaBridge, but I get errors while trying to excess to localhost:8080/JavaBridge
javax.servlet.ServletException: php.java.bridge.http.FCGIConnectException: Could not connect to server
php.java.bridge.http.FCGIConnectException: Could not connect to server
java.io.IOException: File \\.\pipe\C:\apache-tomcat-7.0.39\temp\JavaBridge939398813756155712.socket not writable
java.io.IOException: PHP not found. Please install php-cgi. PHP test command was: [php-cgi, -v]
I didn't show out all the errors here, I showed only the first line of each root cause.
I will give more details in my setup.
I'm using XAMPP all the time, with PHP, MySQL in the XAMPP.
Then I just installed Tomcat inorder to install JavaBridge.
I copied JavaBridge.war into c:/tomcats/webapps, copied JavaBridge.jar and php-servlet.jar into c:/tomcats/lib
I assume the problems should lies with the PHP, but I don't know how to fix it as well.
Install PHP again? but I'm not sure too.
Whats the problem with my setup?
Or is there others way to make connections between PHP and Java as what I stated above?
Thank you.
Have you enabled php-cgi?
Here's how u can do it. Go to: xampp\apache\conf\extra\httpd-xampp.conf and uncomment this:
<FilesMatch "\.php$">
SetHandler application/x-httpd-php-cgi
</FilesMatch>
<IfModule actions_module>
Action application/x-httpd-php-cgi "/php-cgi/php-cgi.exe"
</IfModule>
Restart Apache & Tomcat.