Errors connecting to solrcloud using CloudSolrClient - java

I'm trying to connect to solrCloud using solrj CloudSolrClient, but am getting errors.
Used to directly call a single solr node, now switching to solrcloud. I have tried various different url formats as specified from documentation online.
SolrClient solrClient = new CloudSolrClient.Builder(zkUrl).build();
SolrQuery solrQuery = new SolrQuery();
solrQuery.setRequestHandler(FIELD_LIST_HANDLER);
QueryRequest req = new QueryRequest(solrQuery);
req.setBasicAuthCredentials(zkUser, zkPassword);
QueryResponse response = req.process(solrClient, core);
When using the following zkHost strings I get the various errors.
host:2181
2019-08-21 15:53:17 - ERROR o.a.c.c.C.[.[.[.[.a.d.n.s.JerseyConfiguration] [http-nio-8080-exec-1] Servlet.service() for servlet [com.att.dplr.nextgen.search.JerseyConfiguration] in context with path [] threw exception [java.lang.RuntimeException: Couldn't init
ialize a HttpClusterStateProvider (is/are the Solr server(s), [host:2181], down?)] with root cause
org.apache.http.client.ClientProtocolException: URI does not specify a valid host name: host:2181/admin/collections?action=CLUSTERSTATUS&wt=javabin&version=2
http://host:2181
2019-08-21 15:55:53 - ERROR o.a.c.c.C.[.[.[.[.a.d.n.s.JerseyConfiguration] [http-nio-8080-exec-1] Servlet.service() for servlet [com.att.dplr.nextgen.search.JerseyConfiguration] in context with path [] threw exception [java.lang.RuntimeException: Couldn't init
ialize a HttpClusterStateProvider (is/are the Solr server(s), [http://host:2181], down?)] with root cause
org.apache.http.NoHttpResponseException: host:2181 failed to respond
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:141)
host:2181/solr
2019-08-21 16:00:11 - ERROR o.a.c.c.C.[.[.[.[.a.d.n.s.JerseyConfiguration] [http-nio-8080-exec-1] Servlet.service() for servlet [com.att.dplr.nextgen.search.JerseyConfiguration] in context with path [] threw exception [java.lang.RuntimeException: Couldn't init
ialize a HttpClusterStateProvider (is/are the Solr server(s), [host:2181/solr], down?)] with root cause
org.apache.http.client.ClientProtocolException: URI does not specify a valid host name: host:2181/solr/admin/collections?action=CLUSTERSTATUS&wt=javabin&version=2
at org.apache.http.impl.client.CloseableHttpClient.determineTarget(CloseableHttpClient.java:95)
http://host:2181/solr
2019-08-21 15:57:23 - ERROR o.a.c.c.C.[.[.[.[.a.d.n.s.JerseyConfiguration] [http-nio-8080-exec-1] Servlet.service() for servlet [com.att.dplr.nextgen.search.JerseyConfiguration] in context with path [] threw exception [java.lang.RuntimeException: Couldn't init
ialize a HttpClusterStateProvider (is/are the Solr server(s), [http://host:2181/solr], down?)] with root cause
org.apache.http.NoHttpResponseException: host:2181 failed to respond
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:141)
What do I need to change to successfully query solr through zookeeper using solrj CloudSolrClient?
I have successfully communicated with the zookeeper instance from terminal.
$ echo stat | nc host 2181
Zookeeper version: 3.4.14-4c25d480e66aadd371de8bd2fd8da255ac140bcf, built on 03/06/2019 16:18 GMT
Clients:
/130.10.31.81:60381[0](queued=0,recved=1,sent=0)
/135.40.74.31:48984[1](queued=0,recved=817933,sent=817933)
Latency min/avg/max: 0/0/80
Received: 1893410
Sent: 1893706
Connections: 2
Outstanding: 0
Zxid: 0xa00000636
Mode: follower
Node count: 214

It turns out that both solrurls and zkurls can be provided to the CloudSolrClient.Builder. I was able to get past the previous issue by using the SolrClient solrClient = new CloudSolrClient.Builder(hosts, Optional.empty()).build();which accepts zkUrls whereas CloudSolrClient.Builder(hosts).build() accepts solr Urls

I also got this ClientProtocolException when the configuration itme clusterprops.json was not available in zookeeper /
Contents:
{"urlScheme":"https"}

Related

FileSizeLimitExceededException leads to error 500 instead of 413

I got an exception like
2018-11-01 21:05:49.122 ERROR 31446 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.web.multipart.MaxUploadSizeExceededException: Maximum upload size exceeded; nested exception is java.lang.IllegalStateException: org.apache.tomcat.util.http.fileupload.FileUploadBase$FileSizeLimitExceededException: The field file exceeds its maximum permitted size of 1024 bytes.] with root cause
org.apache.tomcat.util.http.fileupload.FileUploadBase$FileSizeLimitExceededException: The field file exceeds its maximum permitted size of 1024 bytes.
why 413 http error wasn't raised automatically?
You have to define maximum file size for a file upload.
Add below properties in application.properties
spring.http.multipart.max-file-size=128KB
spring.http.multipart.max-request-size=128KB
For spring boot 2.
spring.servlet.multipart.max-file-size=128MB
spring.servlet.multipart.max-request-size=128MB
spring.servlet.multipart.enabled=true
Refer this

Kinesis worker error: Caught exception when initializing LeaseCoordinator

I am trying to execute the sample producer and consumer code on the Kinesis Streams website: http://docs.aws.amazon.com/streams/latest/dev/learning-kinesis-module-one-download.html
I've downloaded the source, and I am using Eclipse to run it. I've included the necessary jar files, so I would think that everything would be setup to run.
When I run the processor code that consumes the records from Kinesis, however, I get this error:
Aug 02, 2016 8:35:14 PM com.amazonaws.services.kinesis.clientlibrary.lib.worker.Worker initialize SEVERE: Caught exception when initializing LeaseCoordinator
Does anyone think they could tell me what is causing this error?
EDIT: Here is the full stack trace from the error on Eclipse:
Aug 02, 2016 9:02:27 PM com.amazonaws.services.kinesis.clientlibrary.lib.worker.Worker initialize
SEVERE: Caught exception when initializing LeaseCoordinator
com.amazonaws.services.kinesis.leases.exceptions.DependencyException: com.amazonaws.services.dynamodbv2.model.AmazonDynamoDBException: User: arn:aws:sts::500238854089:assumed-role/NORD-NONPROD-a0121-Team/AEXM is not authorized to perform: dynamodb:CreateTable on resource: arn:aws:dynamodb:us-west-2:500238854089:table/amazon-kinesis-learning (Service: AmazonDynamoDBv2; Status Code: 400; Error Code: AccessDeniedException; Request ID: BGME094FRUAEK2KFCPQIAM5U8VVV4KQNSO5AEMVJF66Q9ASUAAJG)
at com.amazonaws.services.kinesis.leases.impl.LeaseManager.createLeaseTableIfNotExists(LeaseManager.java:124)
at com.amazonaws.services.kinesis.clientlibrary.lib.worker.KinesisClientLibLeaseCoordinator.initialize(KinesisClientLibLeaseCoordinator.java:172)
at com.amazonaws.services.kinesis.clientlibrary.lib.worker.Worker.initialize(Worker.java:380)
at com.amazonaws.services.kinesis.clientlibrary.lib.worker.Worker.run(Worker.java:324)
at com.amazonaws.services.kinesis.samples.stocktrades.processor.StockTradesProcessor.main(StockTradesProcessor.java:96)
Caused by: com.amazonaws.services.dynamodbv2.model.AmazonDynamoDBException: User: arn:aws:sts::500238854089:assumed-role/NORD-NONPROD-a0121-Team/AEXM is not authorized to perform: dynamodb:CreateTable on resource: arn:aws:dynamodb:us-west-2:500238854089:table/amazon-kinesis-learning (Service: AmazonDynamoDBv2; Status Code: 400; Error Code: AccessDeniedException; Request ID: BGME094FRUAEK2KFCPQIAM5U8VVV4KQNSO5AEMVJF66Q9ASUAAJG)
at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:1401)
at com.amazonaws.http.AmazonHttpClient.executeOneRequest(AmazonHttpClient.java:945)
at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:723)
at com.amazonaws.http.AmazonHttpClient.doExecute(AmazonHttpClient.java:475)
at com.amazonaws.http.AmazonHttpClient.executeWithTimer(AmazonHttpClient.java:437)
at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:386)
at com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient.doInvoke(AmazonDynamoDBClient.java:2074)
at com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient.invoke(AmazonDynamoDBClient.java:2044)
at com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient.createTable(AmazonDynamoDBClient.java:899)
at com.amazonaws.services.kinesis.leases.impl.LeaseManager.createLeaseTableIfNotExists(LeaseManager.java:117)
... 4 more
Your stack trace is telling you exactly what the problem is:
User: arn:aws:sts::500238854089:assumed-role/NORD-NONPROD-a0121-Team/AEXM is not authorized to perform: dynamodb:CreateTable on resource: arn:aws:dynamodb:us-west-2:500238854089:table/amazon-kinesis-learning
Make sure you've provided credentials to the DynamoDBClient that has CreateTable permissions - LeaseCoordinator attempts to create the leasing table in Dynamo.
It is actually possible to configure logging for Scala Kinesis Enrich by running the jar file like this:
java -jar -Dorg.slf4j.simpleLogger.defaultLogLevel=debug snowplow-kinesis-enrich-0.5.0 --config enrich.conf --resolver resolver.json
This should print all debug messages from the Kinesis Client Library. (Watch out because the output will become very verbose.) Could you try rerunning with this change to logging? Hopefully that will provide more clues about what's going wrong.

Error while applying OWSM policies on Web service created from Jdeveloper 11g (SEVERE: java.io.FileNotFoundException: .\config\jps-config.xml)

I created sample class Testws with one simple method sayHi(String name) that simply showing welcome message. The target is to create web service application for this class and applying OWSM policies.
All the needed file is generated from Jdeveloper 11.1.1.7 and I added the oracle/wss_username_token_client_policy to the client side in TestwsPortClient. Problem is that when I run the main method from TestwsPortClient I got the following error:
SEVERE: java.io.FileNotFoundException: .\config\jps-config.xml (The system cannot find the path specified)
Although I tried (But it did not work) to set the system propriety to find the missing file as follow:
System.setProperty("oracle.security.jps.config",
"C:\\Users\\user\\AppData\\Roaming\\JDeveloper\\system11.1.1.7.40.64.93\\DefaultDomain\\config\\fmwconfig\\jps-config.xml");
Here is the Client Class TestwsPortClient:
public static void main(String[] args) {
testwsService = new TestwsService();
SecurityPoliciesFeature securityFeatures =
new SecurityPoliciesFeature(new String[] { "oracle/wss_username_token_client_policy" });
Testws testws = testwsService.getTestwsPort(securityFeatures);
// Add your code to call the desired methods.
System.setProperty("oracle.security.jps.config",
"C:\\Users\\user\\AppData\\Roaming\\JDeveloper\\system11.1.1.7.40.64.93\\DefaultDomain\\config\\fmwconfig\\jps-config.xml");
List<CredentialProvider> credProviders =new ArrayList<CredentialProvider>();
String username = "weblogic";
String password = "weblogic1";
CredentialProvider cp =new ClientUNTCredentialProvider(username.getBytes(), password.getBytes());
credProviders.add(cp);
Map<String, Object> rc = ((BindingProvider)testws).getRequestContext();
rc.put(WSSecurityContext.CREDENTIAL_PROVIDER_LIST, credProviders);
testws.sayHi("Salman");
}
Here the exception stack trace:
Note: the stack trace is too long this is just part of it where I think it will gives an idea about the error
SEVERE: java.io.FileNotFoundException: .\config\jps-config.xml (The system cannot find the path specified)
SEVERE: java.io.FileNotFoundException: .\config\jps-config.xml (The system cannot find the path specified)
INFO: WSM-09004 Component auditing cannot be initialized.
INFO: Recipient Alias property not configured in the policy. Defaulting to encrypting with signers certificate.
WARNING: JPS-00065 Jps platform factory creation failed. Reason: java.lang.ClassNotFoundException: oracle.security.jps.se.JpsSEPlatformFactory.
WARNING: JPS-00065 Jps platform factory creation failed. Reason: {0}.
......
at $Proxy34.sayHi(Unknown Source)
at test.TestwsPortClient.main(TestwsPortClient.java:44)
Caused by: oracle.security.jps.JpsException: JPS-00065: Jps platform factory creation failed. Reason: java.lang.ClassNotFoundException: oracle.security.jps.se.JpsSEPlatformFactory.
at oracle.security.jps.ee.JpsPlatformFactory$2.run(JpsPlatformFactory.java:197)
at oracle.security.jps.ee.JpsPlatformFactory$2.run(JpsPlatformFactory.java:190)
........

Jsp to my sql connection error.

This error please help:
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 14 in the jsp file: /select.jsp
localhost cannot be resolved
14: connection = DriverManager.getConnection(localhost, "root", "apurva");
;
you need to pass database connection url, instead of just localhost, like jdbc:mysql://localhost:3306/
here's a good example

Log viewer in Glassfish 2 throws Exception

When I click certain records in the log viewer of a Glassfish 2 server running on 64-bit Ubuntu the error report opens a new popup but instead of the actual error I get a server exception:
HTTP Status 500 - type Exception reportmessagedescriptionThe server encountered an internal error () that prevented it from fulfilling this request.exception javax.servlet.ServletException: Expression '$property{list}' did not resolve to a List! Found: 'java.lang.String'root cause java.lang.IllegalArgumentException: Expression '$property{list}' did not resolve to a List! Found: 'java.lang.String'note The full stack traces of the exception and its root causes are available in the Sun Java System Application Server 9.1_01 logs.Sun Java System Application Server 9.1_01
The stack trace in the server log is:
[#|2011-07-15T11:58:52.561+0000|INFO|sun-appserver9.1|com.sun.jsftemplating|_ThreadID=35;_ThreadName=httpWorkerThread-4848-1;|JSFT0003: VariableResolver was unable to find key (logEntryDetail) in ResourceBundle (help).|#]
[#|2011-07-15T11:58:52.586+0000|WARNING|sun-appserver9.1|javax.enterprise.resource.webcontainer.jsf.lifecycle|_ThreadID=35;_ThreadName=httpWorkerThread-4848-1;_RequestID=aa6c0f08-ce0f-4a10-bdc5-b835658db2bc;|executePhase(RENDER_RESPONSE 6,com.sun.faces.context.FacesContextImpl#955e041) threw exception java.lang.IllegalArgumentException: Expression '$property{list}' did not resolve to a List! Found: 'java.lang.String'
at com.sun.jsftemplating.layout.descriptors.LayoutForEach.getList(LayoutForEach.java:119)
at com.sun.jsftemplating.layout.descriptors.LayoutForEach.encode(LayoutForEach.java:168)
at com.sun.jsftemplating.layout.descriptors.LayoutElementBase.encode(LayoutElementBase.java:271)
at com.sun.jsftemplating.layout.descriptors.LayoutDefinition.encode(LayoutDefinition.java:232)
at com.sun.jsftemplating.renderer.TemplateRenderer.encodeEnd(TemplateRenderer.java:139)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:836)
at com.sun.webui.jsf.util.RenderingUtilities.renderComponent(RenderingUtilities.java:99)
at com.sun.webui.jsf.renderkit.html.PropertyRenderer.renderPropertyComponents(PropertyRenderer.java:200)
at com.sun.webui.jsf.renderkit.html.PropertyRenderer.encodeEnd(PropertyRenderer.java:161)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:836)
at com.sun.webui.jsf.util.RenderingUtilities.renderComponent(RenderingUtilities.java:99)
at com.sun.webui.jsf.renderkit.html.PropertySheetSectionRenderer.renderProperties(PropertySheetSectionRenderer.java:192)
at com.sun.webui.jsf.renderkit.html.PropertySheetSectionRenderer.renderPropertySheetSection(PropertySheetSectionRenderer.java:152)
at com.sun.webui.jsf.renderkit.html.PropertySheetSectionRenderer.encodeEnd(PropertySheetSectionRenderer.java:95)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:836)
at com.sun.webui.jsf.util.RenderingUtilities.renderComponent(RenderingUtilities.java:99)
at com.sun.webui.jsf.renderkit.html.PropertySheetRenderer.renderPropertySheetSections(PropertySheetRenderer.java:172)
at com.sun.webui.jsf.renderkit.html.PropertySheetRenderer.encodeEnd(PropertySheetRenderer.java:122)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:836)
at com.sun.jsftemplating.layout.descriptors.LayoutElementBase.encodeChild(LayoutElementBase.java:480)
at com.sun.jsftemplating.layout.descriptors.LayoutElementBase.encodeChild(LayoutElementBase.java:477)
at com.sun.jsftemplating.layout.descriptors.LayoutElementBase.encodeChild(LayoutElementBase.java:477)
at com.sun.jsftemplating.layout.descriptors.LayoutElementBase.encodeChild(LayoutElementBase.java:477)
at com.sun.jsftemplating.layout.descriptors.LayoutElementBase.encodeChild(LayoutElementBase.java:477)
at com.sun.jsftemplating.layout.descriptors.LayoutComponent.encode(LayoutComponent.java:226)
at com.sun.jsftemplating.layout.descriptors.LayoutElementBase.encode(LayoutElementBase.java:271)
at com.sun.jsftemplating.layout.descriptors.LayoutDefinition.encode(LayoutDefinition.java:225)
at com.sun.jsftemplating.layout.LayoutViewHandler.renderView(LayoutViewHandler.java:484)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
at com.sun.faces.extensions.avatar.lifecycle.PartialTraversalLifecycle.render(PartialTraversalLifecycle.java:92)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
at com.sun.enterprise.tools.admingui.servlet.DelayedInitFacesServlet.service(DelayedInitFacesServlet.java:89)
at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
at com.sun.webui.jsf.util.UploadFilter.doFilter(UploadFilter.java:240)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:288)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
at com.sun.enterprise.web.connector.grizzly.WorkerThreadImpl.run(WorkerThreadImpl.java:116)|#]
Google came up with these two questions but with no real solution:
1. http://www.java.net/node/703568
2. http://www.java.net/node/682666
Does anybody have the same error or know the solution?

Categories