RESTEASY003720: path param has not been provided while constructing ResteasyClient - resteasy

I see this error while running my tests when migrating from Resteasy jaxrs 3 to Resteasy client 4: (org.jboss.resteasy.client.jaxrs.ResteasyClient)
RESTEASY003720: path param xxxx has not been provided while constructing
I set the target URL to be "localhost:8080". How this can be fixed?

Seems that target URL must include the scheme; when I change it to http://localhost:8080 the error disappears.

Related

adding document to collection failed in Solr cloud mode

I need to add all documents in a folder to collection and it failed:
Here is my command:
hostname: mysolr
Solr Admin URL: http://mysolr.net:8983/solr/#/
Collection name: collection_indexer
Collection url: http://mysolr.net:8983/solr/#/collection_indexer_shard1_replica1
data folder:
/tmp/solr_data
Running folder:
bash-4.1$ pwd
/opt/cloudera/parcels/CDH/jars
command:
java -Dtype=application/json -Drecursive -Durl="http://mysolr.net:8983/solr/#/collection_indexer_shard1_replica1/update/json/docs" -jar post.jar /tmp/solr_data
Output:
bash-4.1$ java -Dtype=application/json -Drecursive
-Durl="http://mysolr.net:8983/solr/#/collection_indexer_shard1_replica1/update/json/docs"
-jar post.jar /tmp/solr_data SimplePostTool version 1.5 Posting files to base url
http://mysolr.net:8983/solr/#/collection_indexer_shard1_replica1/update/json/docs
using content-type application/json.. Entering recursive mode, max
depth=999, delay=0s Indexing directory /tmp/solr_data (1 files,
depth=0) POSTing file test.json SimplePostTool: WARNING: Solr returned
an error #405 (Method Not Allowed) for url:
http://mysolr.net:8983/solr/#/collection_indexer_shard1_replica1/update/json/docs
SimplePostTool: WARNING: Response: Apache
Tomcat/6.0.45 - Error report
525D76;}--> HTTP Status 405 - HTTP method POST is not supported by this URL
noshade="noshade">type Status reportmessage
HTTP method POST is not supported by this
URLdescription The specified HTTP method is not
allowed for the requested resource.Apache Tomcat/6.0.45
SimplePostTool: WARNING: IOException while reading response:
java.io.IOException: Server returned HTTP response code: 405 for URL:
http://mysolr.net:8983/solr/#/collection_indexer_shard1_replica1/update/json/docs
1 files indexed. COMMITting Solr index changes to
http://mysolr.net:8983/solr/#/collection_indexer_shard1_replica1/update/json/docs..
Time spent: 0:00:00.100
I also tried: http://mysolr.net:8983/solr/#/collection_indexer/update/json/docs as the Durl and got same error message.
Note the end of error message seems to give hint that the error pertains to the url or REST, can you please clarify what is missing here?
Thank you very much.
Update 20180415 7:07am EST:
Following MatsLindh's comment below, I made change to the command and ran again with the new command
java -Dtype=application/json -Drecursive -Durl="http://dsnyr001d01i1d.nam.nsroot.net:8983/solr/collection_indexer_shard1_replica1/update" -jar post.jar /tmp/solr_data
SimplePostTool version 1.5 Posting files to base url
http://mysolr.net:8983/solr/collection_indexer_shard1_replica1/update
using content-type application/json.. Entering recursive mode, max
depth=999, delay=0s Indexing directory /tmp/solr_data (1 files,
depth=0) POSTing file test.json SimplePostTool: WARNING: Solr returned
an error #400 (Bad Request) for url:
http://mysolr.net:8983/solr/collection_indexer_shard1_replica1/update
SimplePostTool: WARNING: Response:
{"responseHeader":{"status":400,"QTime":0},"error":{"metadata":["error-class","org.apache.solr.common.SolrException","root-error-class","org.apache.solr.common.SolrException"],"msg":"Unknown
command: region [9]","code":400}} SimplePostTool: WARNING: IOException
while reading response: java.io.IOException: Server returned HTTP
response code: 400 for URL:
http://mysolr.net:8983/solr/collection_indexer_shard1_replica1/update
1 files indexed. COMMITting Solr index changes to
http://mysolr.net:8983/solr/collection_indexer_shard1_replica1/update..
Time spent: 0:00:00.100
This time it is 400 error.
From Solr Admin I still do not see the new document is added.
Thank you.
Any part after a # in a standard HTTP URL is an anchor, and meant for consumption on the client (usually by scrolling to the element with the anchor as its id). These days it's used more for keeping state for browser applications (in particular before the history state API was introduced).
The important part is that anything behind # is never transmitted to the server - it's only used by the client to either scroll the page or used by javascript in the browser to handle state (in this case - which page you actually were looking at).
Since it's never transmitted to the server you end up making a request to http://mysolr.net:8983/solr/ - which probably isn't the URL you want to query.
Drop the anchor and use the actual collection update URL: http://mysolr.net:8983/solr/collection_indexer/update/json/docs should work.
You should not have to use the direct core URL (i.e. with the shard/replica parameters) if you're running in cloud mode.
Finally sorted it out with the below steps (exceptions showing in the log /var/log/solr):
1. Manually created new schema file specifically for the data format
2. Update the instance and the schema
solrctl instancedir --update
solrctl collection --reload
3. make sure the id for each doc is unique
Thanks lots to MatsLindh for the enlightening. It is much appreciated.

DSpace error with oai import

After configuring my DSpace server, its working correctly but when I look at the OAI identify page (http://repositorio.puce.edu.ec/oai/request?verb=Identify) so we can be harvested, it says that the repository is localhost instead of my URL. I investigated and found out that to update this, I have to run this command: dspace/bin/dspace oai import -c but when I run that command is gives me the following error: Solr server (http://repositorio.puce.edu.ec/solr/oai) is down, turn it on.
I can see the Solr Admin (it can't be seen from the outside because of security reasons) so I don't know what should be turned on or how to do it?
Thanks for the help.
I encountered this error in the past.
Looking at my oai.cfg file, I used localhost for some settings and my public URL for others.
solr.url=http://localhost/solr/oai
# OAI persistent identifier prefix.
# Format - oai:PREFIX:HANDLE
identifier.prefix = repository.library.georgetown.edu
# Base url for bitstreams
bitstream.baseUrl = https://repository.library.georgetown.edu
If you need to make a config change, be sure to clear the cache after restarting service.

Solr 4 Data Import Handler doesn't work

I am deploying Solr 4.3.0 in Tomcat 7.
Everything works fine but DataImportHandler. I can go to the
http://localhost:8080/solr/#/collection1/dataimport//dataimport
screen and see the dataimport options load at the UI.
Still, I can see any of my entities load in the "entity" combo box. Inside the configuration box, at the right side I can see the error below.
Apache Tomcat/7.0.41 - Error
report
525D76;}--> HTTP Status 500 - Filter execution threw an exception
noshade="noshade">type Exception reportmessage
Filter execution threw an exceptiondescription
The server encountered an internal error that prevented it from
fulfilling this request.exception
javax.servlet.ServletException: Filter execution threw an
exception root cause
java.lang.NoClassDefFoundError: org/apache/log4j/spi/LoggingEvent
org.apache.solr.logging.log4j.EventAppender.append(EventAppender.java:35)
org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:251)
org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:66)
org.apache.log4j.Category.callAppenders(Category.java:206)
org.apache.log4j.Category.forcedLog(Category.java:391)
org.apache.log4j.Category.log(Category.java:856)
org.slf4j.impl.Log4jLoggerAdapter.error(Log4jLoggerAdapter.java:498)
org.apache.solr.common.SolrException.log(SolrException.java:119)
org.apache.solr.servlet.ResponseUtils.getErrorInfo(ResponseUtils.java:58)
org.apache.solr.servlet.SolrDispatchFilter.sendError(SolrDispatchFilter.java:691)
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:380)
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:155)
note The full stack trace of the root cause is
available in the Apache Tomcat/7.0.41 logs.Apache Tomcat/7.0.41
Problem is that I have the "log4j-1.2.16.jar" loaded in the classpath (it's on Tomcat lib dir).
Anyone have stepped in this problem?
Try following the steps outlined in Using the example logging setup in containers other than Jetty. I have encountered this same error when running Solr 4.3 until I followed these steps to configure logging.
After changing the directory, did you change the directory path in solrconfig.xml file.
I just want to make sure after the making changes in configuration file, did you restart the tomcat and solr server?
You need to copy the slf4j-log4j12-1.6.6.jar from the ext of Solr into the lib folder.
You also need to put the logging.properties file there.

Tomcat7 breaking request parameter behaviour from Tomcat5.5 and Struts1.1?

I have a link which points to my servlet (Struts 1.1 App).
http://myserver.com/app/preview.do;jsessionid=1234567;p1=test;filename=/page2.htm
All was working fine in Tomcat5.5 and jdk1.6, but now with tomcat7 and jdk7, it does not work anymore. Tomcat now sends 404 error, because
/app/preview.do;jsessionid=1234567;p1=test;filename=/page2.htm" could not be found on server
So it tries to find the file page2.htm in path.
Does anybody know how to configure Tomcat to get it work again?

Getting status information of check_mysql-health command in Nagios Core

Am using the NagiosQL to configure the Nagios core, i have a problem with check_mysql_health plugin it is not returning status information in Nagios core but if run same command in command-line it is gives the proper result. Can anyone suggest me some solution for this?
Thanks
Somesh
Finally i got the solution for my problem, to get the status information in Nagios core we have to set the path of the check_mysql_health plugin in 4 different config files /etc/nagios/command-plugin.cfg - add the plugin path,/etc/nagios/nrpe.cfg - add the plugin path, /etc/nagiosql/commands.cfg - add the plugin path at command definition, /etc/nagios/objects/commands.cfg - define the command for check_mysql_health, and the Additional templates must be a generic templates in service panel of NagiosQL

Resources