Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8814503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:08:29+00:00 2026-06-14T04:08:29+00:00

i am developing android application with maven and spring resttemplate. This is my pom.xml

  • 0

i am developing android application with maven and spring resttemplate.

This is my pom.xml

<properties>
    <platform.version> 2.3.3</platform.version>
    <spring.version>1.0.0.RELEASE</spring.version>
    <simple-version>2.4.1</simple-version>
</properties>

<dependencies>

    <!-- Spring Android Core -->
    <dependency>
        <groupId>org.springframework.android</groupId>
        <artifactId>spring-android-core</artifactId>
        <version>${spring.version}</version>
    </dependency>

    <!-- Spring Rest Android -->
    <dependency>
        <groupId>org.springframework.android</groupId>
        <artifactId>spring-android-rest-template</artifactId>
        <version>${spring.version}</version>
    </dependency>

    <!-- Using Jackson for JSON marshaling -->
    <dependency>
        <groupId>org.codehaus.jackson</groupId>
        <artifactId>jackson-mapper-asl</artifactId>
        <version>1.7.1</version>
    </dependency>

    <!-- Using Simple for XML marshaling -->
    <dependency>
        <groupId>org.simpleframework</groupId>
        <artifactId>simple-xml</artifactId>
        <version>${simple-version}</version>
        <exclusions>
            <exclusion>
                <artifactId>stax</artifactId>
                <groupId>stax</groupId>
            </exclusion>
            <exclusion>
                <artifactId>stax-api</artifactId>
                <groupId>stax</groupId>
            </exclusion>
        </exclusions>
    </dependency>

</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>com.jayway.maven.plugins.android.generation2</groupId>
            <artifactId>android-maven-plugin</artifactId>
            <version>3.1.1</version>
            <configuration>
                <androidManifestFile>${project.basedir}/AndroidManifest.xml</androidManifestFile>
                <assetsDirectory>${project.basedir}/assets</assetsDirectory>
                <resourceDirectory>${project.basedir}/res</resourceDirectory>
                <nativeLibrariesDirectory>${project.basedir}/src/main/native</nativeLibrariesDirectory>
                <sdk>
                    <platform>10</platform>
                </sdk>
                <emulator>
                    <avd>10</avd>
                </emulator>
                <deleteConflictingFiles>true</deleteConflictingFiles>
                <undeployBeforeDeploy>true</undeployBeforeDeploy>
            </configuration>
            <extensions>true</extensions>
        </plugin>

        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.3.2</version>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
            </configuration>
        </plugin>
    </plugins>
</build>

In main Activity i have this code into button:

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    btnLogin = (Button) findViewById(R.id.btnLogin);

    btnLogin.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View arg0) {

            String email = "user@xxxx.com";
            String passwd = "123456";

            restTemplate = new RestTemplate();

            try {
                Users user = restTemplate.getForObject(URL + "/{email}/{password}",
                                Users.class, email, passwd);

                if (user != null) {
                    System.out.println("Mi nombre es: " + user);
                }

            } catch (ResourceAccessException ex) {
                System.out.println("OFF");
            } catch (RestClientException ex) {
                System.out.println("Error");
            }
        }
    });

When i run my aaplication into device this is the error that show in logCat:

java.lang-IllegalArgumentException: 'messageConverters' must not be empty

Thansk!!!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T04:08:31+00:00Added an answer on June 14, 2026 at 4:08 am

    I found the solution using try/catch and inside method:

    public Users obtainUser() {
        try {
    
            HttpHeaders requestHeaders = new HttpHeaders();
            requestHeaders.setAccept(Collections.singletonList(new MediaType("application","json")));
            HttpEntity<?> requestEntity = new HttpEntity<Object>(requestHeaders);
    
            RestTemplate restTemplate = new RestTemplate();
    
            restTemplate.getMessageConverters().add(new MappingJacksonHttpMessageConverter());
    
            ResponseEntity<Users> responseEntity = restTemplate.exchange(URL, HttpMethod.GET, requestEntity, Users.class);
            Users users = responseEntity.getBody();
    
            return users;
    
    
        } catch (Exception e) {
            System.out.println("Error: " + e);
            return null;
        }
    }
    

    using android class AsyncTask too

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing android application which requires user to Login. This application relies on
I'm developing android application using eclipse and svn for version control. I wanted to
I have been developing Android application where I use this code: Date d=new Date(new
Hi i am developing android application in tablet version. Here i am facing problem
I have created a simple application in android [PhoneGap] [Eclipse] {Sorry for this convention
I've been developing an Android application using version 2.3.3 (API 10). The application simply
Hi i am developing android application. Now at this stage i am developing calendar
I'm developing android application with phonegap . Currently I'm facing one problem with inputbox
I'm developing android application for CAR usage and I need that in phone or
I am developing android application in which i have to open option menu from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.