JIRA - Adding Servlet Filter to web.xml

Deleted user June 26, 2013

Hi, we are using JIRA 5.1 and trying to add new java servlet filter into web.xml, once i restart my JIRA service, server does not start, any suggestions to fix it? Thanks

2 answers

0 votes
Deleted user June 30, 2013

I have installed a JAR file as plugin and getting below error in logs:

2013-07-01 14:06:49,180 http-80-4 INFO kashif.inam@thomsonreuters.com 846x1407x1 1qb3y6x 127.0.0.1 /rest/plugins/1.0/com.atlassian.customjirablockfilter-key [atlassian.plugin.manager.DefaultPluginManager] Found dependent enabled plugins for uninstalled plugin 'com.atlassian.customjirablockfilter': []. Disabling...

Please see attached atlassian-plugin.xml

Please advise

<atlassian-plugin name="Block REST API Filter" key="com.atlassian.customjirablockfilter" plugins-version="2">
    <plugin-info>
        <description>A Servlet filter to block REST API!</description>
        <vendor name="Atlassian Software Systems" url="http://www.atlassian.com"/>
        <version>1.0</version>
    </plugin-info>
 
    <servlet-filter name="ServiceBlockServlet" key="jiraBlockServlet" class="com.atlassian.JiraBlockFilter" location="after-encoding" weight="200">
        <description>Block JIRA REST Services</description>
        <url-pattern>/*/rest/api/*</url-pattern>
        
        <dispatcher>REQUEST</dispatcher>
        
    </servlet-filter>
</atlassian-plugin>

0 votes
Timothy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 26, 2013

any suggestions to fix it?

Remove the changes that you made?

Jira has a plugin module for Servlet Filters (https://developer.atlassian.com/display/JIRADEV/Servlet+Filter+Plugin+Module). Use this instead.

Deleted user June 26, 2013

I see above URL and found example referring "atlassian-plugin.xml" and "com.example.myplugins.helloworld.HelloWorldFilter", I want to understand its development and deployment.

Can I see full working example or related documentation?

Thanks

Timothy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 26, 2013
<servlet-filter name="Hello World Servlet" key="helloWorld" class="com.example.myplugins.helloworld.HelloWorldFilter" location="before-dispatch" weight="200">
        <description>Says Hello World, Australia or your name.</description>
        <url-pattern>/helloworld</url-pattern>
        <init-param>
            <param-name>defaultName</param-name>
            <param-value>Australia</param-value>
        </init-param>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
    </servlet-filter>

You then hit this URL (http://yourserver/jira/helloworld). The class is a normal servlet.

Deleted user June 26, 2013

Where i need to copy this "atlassian-plugin.xml" into JIRA code?

Timothy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 26, 2013
Deleted user June 30, 2013

I have installed a JAR file as plugin and getting below error, but on administration site, I still see this as installed and active:

846x1407x1 1qb3y6x 127.0.0.1 /rest/plugins/1.0/com.atlassian.customjirablockfilter-key [atlassian.plugin.manager.DefaultPluginManager] Found dependent enabled plugins for uninstalled plugin 'com.atlassian.customjirablockfilter': []. Disabling...

846x1407x1 1qb3y6x 127.0.0.1 /rest/plugins/1.0/com.atlassian.customjirablockfilter-key [atlassian.plugin.manager.DefaultPluginManager] Disabling com.atlassian.customjirablockfilter

846x1407x1 1qb3y6x 127.0.0.1 /rest/plugins/1.0/com.atlassian.customjirablockfilter-key [atlassian.plugin.loaders.ScanningPluginLoader] Removed plugin com.atlassian.customjirablockfilter

Please see atlassian-plugin.xmlas below:
<atlassian-plugin name="Block REST API Filter" key="com.atlassian.customjirablockfilter" plugins-version="2">
<plugin-info>
<description>A Servlet filter to block REST API!</description>
<vendor name="Atlassian Software Systems" url="http://www.atlassian.com"/>
<version>1.0</version>
</plugin-info>
<servlet-filter name="ServiceBlockServlet" key="jiraBlockServlet" class="com.atlassian.JiraBlockFilter" location="after-encoding" weight="200">
<description>Block JIRA REST Services</description>
<url-pattern>/*/rest/api/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
</servlet-filter>
</atlassian-plugin>

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events