It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

previously initiated loading for a different type with name "javax/servlet/http/HttpServletRequest"

Brian Hodge Jul 01, 2016

I'm having a problem trying to get URL data using 

HttpServletRequest servReq = ServletActionContext.getRequest();
String test = servReq.getParameter("param");

Now i know that the first line "getRequest()" works fine, it is a problem with the "servReq.getParameter("param")".

I get the error stated in the title.

"Error rendering macro 'myMacro' : loader constraint violation: loader (instance of org/apache/felix/framework/BundleWiringImpl$BundleClassLoaderJava5) previously initiated loading for a different type with name "javax/servlet/http/HttpServletRequest"

Have no idea what this means really, i've been trying to figure it out for a while and still no luck.

This is the dependency in the POM

<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>servlet-api</artifactId>
    <version>2.4</version>
    <scope>provided</scope>
</dependency>

No i've tried to change somethings in the POM such as version and scope but nothing seems to stop the error.

Anyone know whats up with it or how to solve it?

If you you need any other information please comment.

Thanks.

1 answer

1 vote
Petar Petrov Jul 01, 2016

This looks like a dependency conflict - the bundle class loader for your add-on has erroneously loaded the HttpServletRequest class. This means that this class is somehow packaged in your add-on. Your dependency scope seems correct, so there must be something else wrong with your pom. Do mvn clean install and open the produced jar file - do you see classes from javax.* packages inside? If yes - you need to figure out why this happens. If not, try running confluence again, maybe you did not run a clean build after your experiments with the pom?

Alok Sep 10, 2018

Thanks

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Posted in United States

Topic Tuesday: Agile

Another week, another Topic Tuesday!  Agile has been on my mind a lot lately because I've seen good implementations and bad implementations, but now as a Jira admin it matters more to me whether...

14 views 0 0
View post

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you