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 9114459
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T04:12:19+00:00 2026-06-17T04:12:19+00:00

I followed the example given in this post: How to send data from Matlab

  • 0

I followed the example given in this post: How to send data from Matlab to Rails, but am receiving an error message that I cannot find any information on. My script looks like this:

javaaddpath('./httpcomponents/httpclient-4.2.2.jar')
javaaddpath('./httpcomponents/httpcore-4.2.2.jar')

import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;

httpclient = DefaultHttpClient();

httppost = HttpPost('http://localhost:3000/signin');
httppost.addHeader('Content-Type','application/json');
httppost.addHeader('Accept','application/json');

tokenRequest = StringEntity('{"session", "{email_address:""email@aol.com,""password:""password""}"}');
httppost.setEntity(tokenRequest);

response = httpclient.execute(httppost);

On the last line, I get the error:

Java exception occurred: java.lang.VerifyError: Cannot inherit from final class

From searches online, I gather that this is a software version issue. I tried using the 4.2 builds of those files (the same ones used in the other post), but I received the same error. Does anyone have an idea what could be wrong? Or know a way to do what I am trying to do without using these external libraries?

EDIT:

originally I tried using this code:

tokenRequest = {'session', '{''email_address'':''email@aol.com'',''password'':''password''}'};
token = urlread('http://localhost:3000/signin','POST',tokenRequest);

but I received the NoMethodError that led me to that other post:

NoMethodError (undefined method `each' for "{'email_address':'email@aol.com','password':'password'}":String):
     app/models/session.rb:14:in `initialize'

I think the reason it throws this error is because the server thinks it is receiving a String object, which doesn’t have an each method. I assume I would fix this by using the ‘Content-Type’ argument to specify that its json. Is there a way to do this using urlread?

EDIT: full stack trace for java libs issue

Java exception occurred:
java.lang.VerifyError: Cannot inherit from final class

at java.lang.ClassLoader.defineClass1(Native Method)

at java.lang.ClassLoader.defineClass(Unknown Source)

at java.security.SecureClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.access$000(Unknown Source)

at java.net.URLClassLoader$1.run(Unknown Source)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(Unknown Source)

at com.mathworks.jmi.CustomURLClassLoader.findClass(ClassLoaderManager.java:760)

at java.lang.ClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClassInternal(Unknown Source)

at org.apache.http.impl.client.DefaultHttpClient.createHttpParams(DefaultHttpClient.java:157)

at  org.apache.http.impl.client.AbstractHttpClient.getParams(AbstractHttpClient.java:448)

at org.apache.http.impl.client.AbstractHttpClient.createClientConnectionManager(AbstractHttpClient.java:309)

at org.apache.http.impl.client.AbstractHttpClient.getConnectionManager(AbstractHttpClient.java:466)

at org.apache.http.impl.client.AbstractHttpClient.createHttpContext(AbstractHttpClient.java:286)

at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:851)

at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)

at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:784)
  • 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-17T04:12:20+00:00Added an answer on June 17, 2026 at 4:12 am

    urlread2 turned out to be a much better solution. This code does the job:

    tokenRequest = '{ "session" : { "email_address": "email@aol.com", "password": "password" } }';
    header = http_createHeader('Content-Type','application/json');
    token = urlread2('http://localhost:3000/signin.json','POST',tokenRequest,header);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been given some 'reports' from another piece of software that contains data
I followed the example given in ember application stucture guide http://emberjs.com/guides/outlets/ in order to
Followed this question about delayed_job and monit Its working on my development machine. But
I followed this tutorial . But whenever I try to log in with my
I followed this link to gzip my php driven website It's working fine but
Noob here again. I've followed the example given by Google Dev (and read a
I have a Sencha Touch App that loads data from a REST service into
Given a table (TableA) that contains the following data; Id Date Status RecordId 1
Given this example: class Server < ActiveRecord::Base has_many :clients,:dependent => :destroy after_destroy: delete_server_directory end
i followed the solution given here: Passing pointer argument in MATLAB to a C-DLL

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.