Issue 1:
Elasticsearch version: 2.2.0

JVM version:1.8

OS version:Linux Mint 17.2 Cinnamon 64-bit (Cinnamon 2.6.13)

Description of the problem including expected versus actual behavior:

Hi,

i created nativescript in java and create .zip file with (jar and plugin-descriptor.properties) and install it but when i restart or start elasticsearch then it show error

Steps to reproduce:

1.create nativescript in java

2.install nativescript as plugin

3.restart or start elasticsearch

**Provide logs (if relevant):

this is log for successfully install nativescript as plugin in elasticsearch 2.2.0**

-> Installing from file:/home/ajay/Desktop/DEVAJAY/Untitled Folder/CustomScriptFactory1.0.zip...

Trying file:/home/ajay/Desktop/DEVAJAY/Untitled Folder/CustomScriptFactory1.0.zip ...

Downloading .DONE

Verifying file:/home/mindarray/Desktop/DEVAJAY/Untitled Folder/CustomScriptFactory1.0.zip checksums if available ...

NOTE: Unable to verify checksum for downloaded plugin (unable to find .sha1 or .md5 file to verify)

Installed CustomScriptFactory1.0 into /home/mindarray/Desktop/elasticsearch-2.2.0/plugins/CustomScriptFactory1.0

when restart or start the elasticsearch it show error

Exception in thread "main" java.lang.ClassCastException: class org.spacevatican.elasticsearchexample.CustomScriptFactory

at java.lang.Class.asSubclass(Class.java:3404)

at org.elasticsearch.plugins.PluginsService.loadPluginClass(PluginsService.java:463)

at org.elasticsearch.plugins.PluginsService.loadBundles(PluginsService.java:431)

at org.elasticsearch.plugins.PluginsService.(PluginsService.java:129)

at org.elasticsearch.node.Node.(Node.java:146)

at org.elasticsearch.node.Node.(Node.java:128)

at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:145)

at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:178)

at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:285)

at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)

Refer to the log for complete error details.

Describe the feature:

Issue 2:
Elasticsearch version: 2.2

JVM version: 1.8u66

OS version: Win 8.1

Description of the problem including expected versus actual behavior:

When specifying a bogus analyzer (maybe a typo), ES throws an internal NPE in the logs and the request blocks. Instead the exception should be thrown to the user.

Steps to reproduce:

1.

curl -XPOST http://localhost:9200/_analyze -d '{
"analyzer" : "bogus",
"text" : "this is a test"
}'

Provide logs (if relevant):

[2016-03-14 18:17:44,393][ERROR][transport ] [Caleb Alexander] failed to handle exception for action [indices:admin/analyze[s]], handler [org.elasticsearch.action.support.single.shard.TransportSingleShardAction$AsyncSingleAction$1@a566c0]
java.lang.NullPointerException
at org.elasticsearch.action.support.single.shard.TransportSingleShardAction$AsyncSingleAction.perform(TransportSingleShardAction.java:195)
at org.elasticsearch.action.support.single.shard.TransportSingleShardAction$AsyncSingleAction.access$700(TransportSingleShardAction.java:115)
at org.elasticsearch.action.support.single.shard.TransportSingleShardAction$AsyncSingleAction$1.handleException(TransportSingleShardAction.java:174)
at org.elasticsearch.transport.TransportService$DirectResponseChannel.processException(TransportService.java:821)
at org.elasticsearch.transport.TransportService$DirectResponseChannel.sendResponse(TransportService.java:799)
at org.elasticsearch.transport.TransportService$4.onFailure(TransportService.java:361)
at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:39)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)