Looks like you are connecting to Tomcat's AJP port, not the HTTP one. Connect to the Tomcat HTTP port and I suspect you'll have greater success.
Upayavira On Wed, 26 Jan 2011 22:45 -0800, "Darniz" <rnizamud...@edmunds.com> wrote: > > Hello, > i uploaded solr.war file on my hosting provider and added security > constraint in web.xml file on my solr war so that only specific user with > a > certain role can issue get and post request. When i open browser and type > www.maydomainname.com/solr i get a dialog box to enter userid and > password. > No issues until now. > > Now the issue is that i have one more app on the same tomcat container > which will index document into solr. In order for this app to issue post > request it has to configure the http client credentials. I checked with > my > hosting service and they told me at tomcat is running on port 8834 since > apache is sitting in the front, the below is the code snipped i use to > set > http credentials. > > CommonsHttpSolrServer server = new > CommonsHttpSolrServer("http://localhost:8834/solr"); > Credentials defaultcreds = new > UsernamePasswordCredentials("solr","solr"); > server.getHttpClient().getState().setCredentials(new > AuthScope("localhost",8834,AuthScope.ANY_REALM), > defaultcreds); > > i am getting the following error, any help will be appreciated. > ERROR TP-Processor9 org.apache.jk.common.MsgAjp - BAD packet signature > 20559 > ERROR TP-Processor9 org.apache.jk.common.ChannelSocket - Error, > processing > connection > java.lang.IndexOutOfBoundsException > at java.io.BufferedInputStream.read(BufferedInputStream.java:310) > at > org.apache.jk.common.ChannelSocket.read(ChannelSocket.java:621) > at > org.apache.jk.common.ChannelSocket.receive(ChannelSocket.java:578) > at > org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:686) > at > org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:891) > at > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690) > at java.lang.Thread.run(Thread.java:619) > ERROR TP-Processor9 org.apache.jk.common.MsgAjp - BAD packet signature > 20559 > ERROR TP-Processor9 org.apache.jk.common.ChannelSocket - Error, > processing > connection > java.lang.IndexOutOfBoundsException > at java.io.BufferedInputStream.read(BufferedInputStream.java:310) > at > org.apache.jk.common.ChannelSocket.read(ChannelSocket.java:621) > at > org.apache.jk.common.ChannelSocket.receive(ChannelSocket.java:578) > at > org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:686) > at > org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:891) > at > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690) > at java.lang.Thread.run(Thread.java:619) > > > -- > View this message in context: > http://lucene.472066.n3.nabble.com/configure-httpclient-to-access-solr-with-user-credential-on-third-party-host-tp2360364p2360364.html > Sent from the Solr - User mailing list archive at Nabble.com. > --- Enterprise Search Consultant at Sourcesense UK, Making Sense of Open Source