Unable to integrate struts2-rest-plugin in existing maven structure

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Unable to integrate struts2-rest-plugin in existing maven structure

PATIL Preetam
Hello,


I am trying add struts2-rest-plugin to existing application. tried all possible option but no use.!
I am new to maven related stuff,

Getting below errors.

Caused by: Unable to load bean: type:org.apache.struts2.rest.handler.ContentTypeHandler class:org.apache.struts2.rest.handler.JsonLibHandler - bean - jar:file:/C:/Users/userName/.m2/repository/org/apache/struts/struts2-rest-plugin/2.3.24.1/struts2-rest-plugin-2.3.24.1.jar!/struts-plugin.xml:36:138<file:///C:\Users\userName\.m2\repository\org\apache\struts\struts2-rest-plugin\2.3.24.1\struts2-rest-plugin-2.3.24.1.jar!\struts-plugin.xml:36:138>

Caused by: java.lang.NoClassDefFoundError: net/sf/json/JSONArray

Caused by: java.lang.ClassNotFoundException: net.sf.json.JSONArray


Further details are in below jira link. Which is closed by owner. But details are their.


https://issues.apache.org/jira/browse/WW-4898





Thanks,
Preetam patil

This email and any attachments are intended solely for the use of the individual or entity to whom it is addressed and may be confidential and/or privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email and all attachments,

(iii) Dassault Systemes does not accept or assume any liability or responsibility for any use of or reliance on this email.

For other languages, go to http://www.3ds.com/terms/email-disclaimer
Reply | Threaded
Open this post in threaded view
|

Re: Unable to integrate struts2-rest-plugin in existing maven structure

Lukasz Lenart
2017-12-01 12:26 GMT+01:00 PATIL Preetam <[hidden email]>:

> Hello,
>
> I am trying add struts2-rest-plugin to existing application. tried all possible option but no use.!
> I am new to maven related stuff,
>
> Getting below errors.
>
> Caused by: Unable to load bean: type:org.apache.struts2.rest.handler.ContentTypeHandler class:org.apache.struts2.rest.handler.JsonLibHandler - bean - jar:file:/C:/Users/userName/.m2/repository/org/apache/struts/struts2-rest-plugin/2.3.24.1/struts2-rest-plugin-2.3.24.1.jar!/struts-plugin.xml:36:138<file:///C:\Users\userName\.m2\repository\org\apache\struts\struts2-rest-plugin\2.3.24.1\struts2-rest-plugin-2.3.24.1.jar!\struts-plugin.xml:36:138>
>
> Caused by: java.lang.NoClassDefFoundError: net/sf/json/JSONArray
>
> Caused by: java.lang.ClassNotFoundException: net.sf.json.JSONArray

How did you declare this dependency in your pom.xml? Basically you are
missing json-lib but that should be resolved by Maven.
http://search.maven.org/#artifactdetails%7Cnet.sf.json-lib%7Cjson-lib%7C2.4%7Cjar


Regards
--
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Unable to integrate struts2-rest-plugin in existing maven structure

preetam1910@gmail.com
Yes., in  start i thought same (also in stack overflow everyone suggested same). but even after adding json-lib . getting same error.

my pom.xml contain.

                <dependency>
                        <groupId>org.apache.struts</groupId>
                        <artifactId>struts2-core</artifactId>
                        <version>2.3.24.1</version>
                </dependency>
               
                <!-- https://mvnrepository.com/artifact/org.apache.struts/struts2-rest-plugin -->
                <dependency>
                    <groupId>org.apache.struts</groupId>
                    <artifactId>struts2-rest-plugin</artifactId>
                    <version>2.3.24.1</version>
                </dependency>
       
                <dependency>
                        <groupId>org.apache.struts</groupId>
                        <artifactId>struts2-convention-plugin</artifactId>
                        <version>2.3.24.1</version>
                </dependency>
               
                <dependency>
                        <groupId>net.sf.json-lib</groupId>
                        <artifactId>json-lib</artifactId>
                        <version>2.4</version>
                </dependency>



On 2017-12-01 16:59, Lukasz Lenart <[hidden email]> wrote:

> 2017-12-01 12:26 GMT+01:00 PATIL Preetam <[hidden email]>:
> > Hello,
> >
> > I am trying add struts2-rest-plugin to existing application. tried all possible option but no use.!
> > I am new to maven related stuff,
> >
> > Getting below errors.
> >
> > Caused by: Unable to load bean: type:org.apache.struts2.rest.handler.ContentTypeHandler class:org.apache.struts2.rest.handler.JsonLibHandler - bean - jar:file:/C:/Users/userName/.m2/repository/org/apache/struts/struts2-rest-plugin/2.3.24.1/struts2-rest-plugin-2.3.24.1.jar!/struts-plugin.xml:36:138<file:///C:\Users\userName\.m2\repository\org\apache\struts\struts2-rest-plugin\2.3.24.1\struts2-rest-plugin-2.3.24.1.jar!\struts-plugin.xml:36:138>
> >
> > Caused by: java.lang.NoClassDefFoundError: net/sf/json/JSONArray
> >
> > Caused by: java.lang.ClassNotFoundException: net.sf.json.JSONArray
>
> How did you declare this dependency in your pom.xml? Basically you are
> missing json-lib but that should be resolved by Maven.
> http://search.maven.org/#artifactdetails%7Cnet.sf.json-lib%7Cjson-lib%7C2.4%7Cjar
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: Unable to integrate struts2-rest-plugin in existing maven structure

PATIL Preetam
In reply to this post by Lukasz Lenart
Hello,
In start I though same (issue with json-lib). But even after adding json-lib getting same error.

I am trying to reply from PonyMail. But it not appearing . So again sending as mail.

Pom.xml contain

                <dependency>
                        <groupId>org.apache.struts</groupId>
                        <artifactId>struts2-core</artifactId>
                        <version>2.3.24.1</version>
                </dependency>

                <!-- https://mvnrepository.com/artifact/org.apache.struts/struts2-rest-plugin -->
                <dependency>
                    <groupId>org.apache.struts</groupId>
                    <artifactId>struts2-rest-plugin</artifactId>
                    <version>2.3.24.1</version>
                </dependency>

                <dependency>
                        <groupId>org.apache.struts</groupId>
                        <artifactId>struts2-convention-plugin</artifactId>
                        <version>2.3.24.1</version>
                </dependency>

                <dependency>
                        <groupId>net.sf.json-lib</groupId>
                        <artifactId>json-lib</artifactId>
                        <version>2.4</version>
                </dependency>



-----Original Message-----
From: Lukasz Lenart [mailto:[hidden email]]
Sent: Friday, December 01, 2017 5:00 PM
To: Struts Users Mailing List <[hidden email]>
Subject: Re: Unable to integrate struts2-rest-plugin in existing maven structure

2017-12-01 12:26 GMT+01:00 PATIL Preetam <[hidden email]>:

> Hello,
>
> I am trying add struts2-rest-plugin to existing application. tried all possible option but no use.!
> I am new to maven related stuff,
>
> Getting below errors.
>
> Caused by: Unable to load bean:
> type:org.apache.struts2.rest.handler.ContentTypeHandler
> class:org.apache.struts2.rest.handler.JsonLibHandler - bean -
> jar:file:/C:/Users/userName/.m2/repository/org/apache/struts/struts2-r
> est-plugin/2.3.24.1/struts2-rest-plugin-2.3.24.1.jar!/struts-plugin.xm
> l:36:138<file:///C:\Users\userName\.m2\repository\org\apache\struts\st
> ruts2-rest-plugin\2.3.24.1\struts2-rest-plugin-2.3.24.1.jar!\struts-pl
> ugin.xml:36:138>
>
> Caused by: java.lang.NoClassDefFoundError: net/sf/json/JSONArray
>
> Caused by: java.lang.ClassNotFoundException: net.sf.json.JSONArray

How did you declare this dependency in your pom.xml? Basically you are missing json-lib but that should be resolved by Maven.
http://search.maven.org/#artifactdetails%7Cnet.sf.json-lib%7Cjson-lib%7C2.4%7Cjar


Regards
--
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

This email and any attachments are intended solely for the use of the individual or entity to whom it is addressed and may be confidential and/or privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email and all attachments,

(iii) Dassault Systemes does not accept or assume any liability or responsibility for any use of or reliance on this email.

For other languages, go to http://www.3ds.com/terms/email-disclaimer

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Unable to integrate struts2-rest-plugin in existing maven structure

Yasser Zamani-2


On 12/1/2017 3:50 PM, PATIL Preetam wrote:
>                  <dependency>
>                          <groupId>net.sf.json-lib</groupId>
>                          <artifactId>json-lib</artifactId>
>                          <version>2.4</version>
>                  </dependency>

Could you try

<classifier>jdk15</classifier>

i.e.

     <dependency>
         <groupId>net.sf.json-lib</groupId>
         <artifactId>json-lib</artifactId>
         <version>2.4</version>
         <classifier>jdk15</classifier>
     </dependency>

Regards,
Yasser.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Unable to integrate struts2-rest-plugin in existing maven structure

preetam1910@gmail.com
Yes, i tried
 <classifier>jdk15</classifier>
as well
 <classifier>jdk13</classifier>

On 2017-12-01 18:17, Yasser Zamani <[hidden email]> wrote:

>
>
> On 12/1/2017 3:50 PM, PATIL Preetam wrote:
> >                  <dependency>
> >                          <groupId>net.sf.json-lib</groupId>
> >                          <artifactId>json-lib</artifactId>
> >                          <version>2.4</version>
> >                  </dependency>
>
> Could you try
>
> <classifier>jdk15</classifier>
>
> i.e.
>
>      <dependency>
>          <groupId>net.sf.json-lib</groupId>
>          <artifactId>json-lib</artifactId>
>          <version>2.4</version>
>          <classifier>jdk15</classifier>
>      </dependency>
>
> Regards,
> Yasser.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Unable to integrate struts2-rest-plugin in existing maven structure

Lukasz Lenart
In reply to this post by preetam1910@gmail.com
2017-12-01 12:35 GMT+01:00 [hidden email] <[hidden email]>:

> Yes., in  start i thought same (also in stack overflow everyone suggested same). but even after adding json-lib . getting same error.
>
> my pom.xml contain.
>
>                 <dependency>
>                         <groupId>org.apache.struts</groupId>
>                         <artifactId>struts2-core</artifactId>
>                         <version>2.3.24.1</version>
>                 </dependency>
>
>                 <!-- https://mvnrepository.com/artifact/org.apache.struts/struts2-rest-plugin -->
>                 <dependency>
>                     <groupId>org.apache.struts</groupId>
>                     <artifactId>struts2-rest-plugin</artifactId>
>                     <version>2.3.24.1</version>
>                 </dependency>
>
>                 <dependency>
>                         <groupId>org.apache.struts</groupId>
>                         <artifactId>struts2-convention-plugin</artifactId>
>                         <version>2.3.24.1</version>
>                 </dependency>
>
>                 <dependency>
>                         <groupId>net.sf.json-lib</groupId>
>                         <artifactId>json-lib</artifactId>
>                         <version>2.4</version>
>                 </dependency>

This won't work, you must add the classifier. There is no such
version, either jdk3 or jdk5 have to be used.


Regards
--
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Unable to integrate struts2-rest-plugin in existing maven structure

preetam1910@gmail.com
In reply to this post by Yasser Zamani-2
Also tried by upgrading rest-plug in version.

                <dependency>
                    <groupId>org.apache.struts</groupId>
                    <artifactId>struts2-rest-plugin</artifactId>
                    <version>2.5</version>
                </dependency>
It gives new type of error

ERROR InterceptorBuilder - Actual exception
Could not load class org.apache.struts2.rest.RestWorkflowInterceptor. Perhaps it exists but certain dependencies are not available? - interceptor - jar:file:/C:/Users/u/.m2/repository/org/apache/struts/struts2-rest-plugin/2.5/struts2-rest-plugin-2.5.jar!/struts-plugin.xml:61:103


Caused by: java.lang.NoClassDefFoundError: org/apache/logging/log4j/LogManager

Caused by: java.lang.ClassNotFoundException: org.apache.logging.log4j.LogManager






On 2017-12-01 18:17, Yasser Zamani <[hidden email]> wrote:

>
>
> On 12/1/2017 3:50 PM, PATIL Preetam wrote:
> >                  <dependency>
> >                          <groupId>net.sf.json-lib</groupId>
> >                          <artifactId>json-lib</artifactId>
> >                          <version>2.4</version>
> >                  </dependency>
>
> Could you try
>
> <classifier>jdk15</classifier>
>
> i.e.
>
>      <dependency>
>          <groupId>net.sf.json-lib</groupId>
>          <artifactId>json-lib</artifactId>
>          <version>2.4</version>
>          <classifier>jdk15</classifier>
>      </dependency>
>
> Regards,
> Yasser.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Unable to integrate struts2-rest-plugin in existing maven structure

adam brin
In reply to this post by preetam1910@gmail.com
Apologies if I missed something earlier, but can you do a dependency search in your project and see if you already have a version of net.sf.json.lib included elsewhere? perhaps an older (or newer) version is conflicting?
--
_________________________________________________________
Adam Brin
Director of Technology, Digital Antiquity
480.965.1278

> On Dec 1, 2017, at 6:29 AM, [hidden email] wrote:
>
> Yes, i tried
> <classifier>jdk15</classifier>
> as well
> <classifier>jdk13</classifier>
>
> On 2017-12-01 18:17, Yasser Zamani <[hidden email]> wrote:
>>
>>
>> On 12/1/2017 3:50 PM, PATIL Preetam wrote:
>>>                 <dependency>
>>>                         <groupId>net.sf.json-lib</groupId>
>>>                         <artifactId>json-lib</artifactId>
>>>                         <version>2.4</version>
>>>                 </dependency>
>>
>> Could you try
>>
>> <classifier>jdk15</classifier>
>>
>> i.e.
>>
>>     <dependency>
>>         <groupId>net.sf.json-lib</groupId>
>>         <artifactId>json-lib</artifactId>
>>         <version>2.4</version>
>>         <classifier>jdk15</classifier>
>>     </dependency>
>>
>> Regards,
>> Yasser.
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Unable to integrate struts2-rest-plugin in existing maven structure

Yasser Zamani-2


On 12/1/2017 7:13 PM, Adam Brin wrote:
> Apologies if I missed something earlier, but can you do a dependency search in your project and see if you already have a version of net.sf.json.lib included elsewhere? perhaps an older (or newer) version is conflicting?
>

Also see your published app's lib directory and see if the jar file is
there at all. Also do a maven update command and see if maven warns
about it cannot download the artifact.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]