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

  • Home
  • SEARCH
  • 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 6796779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:31:43+00:00 2026-05-26T18:31:43+00:00

I have a Java application where I use Akka Typed Actors . The code

  • 0

I have a Java application where I use Akka Typed Actors. The code has no errors in Eclipse, but when I start my application it crashes and prints this error:

Exception in thread "main" java.lang.VerifyError: Inconsistent stackmap frames at branch target 266 in method com.example.actors.DBActor.getItems(Lorg/joda/time/DateTime;Lorg/joda/time/DateTime;)I at offset 170
    at com.example.ui.Main$1.create(Main.java:31)
    at akka.actor.TypedActor$$anonfun$newInstance$3.apply(TypedActor.scala:677)
    at akka.actor.TypedActor$$anonfun$newInstance$3.apply(TypedActor.scala:677)
    at akka.actor.TypedActor$.newTypedActor(TypedActor.scala:847)
    at akka.actor.TypedActor$$anonfun$newInstance$1.apply(TypedActor.scala:601)
    at akka.actor.TypedActor$$anonfun$newInstance$1.apply(TypedActor.scala:601)
    at akka.actor.LocalActorRef.akka$actor$LocalActorRef$$newActor(ActorRef.scala:1084)
    at akka.actor.LocalActorRef$$anonfun$2.apply(ActorRef.scala:628)
    at akka.actor.LocalActorRef$$anonfun$2.apply(ActorRef.scala:628)
    at akka.util.ReentrantGuard.withGuard(LockUtil.scala:20)
    at akka.actor.LocalActorRef.<init>(ActorRef.scala:628)
    at akka.actor.Actor$.actorOf(Actor.scala:249)
    at akka.actor.TypedActor$.newInstance(TypedActor.scala:677)
    at akka.actor.TypedActor.newInstance(TypedActor.scala)
    at com.example.ui.Main.main(Main.java:29)

I don’t understand what can be wrong. I have check my com.example.actors.DBActor.getItems() but there is no error in it. What could be wrong?


UPDATE

Below is example on code where I get this error.
I have these jar-files on the “Build path” in Eclipse:

  • derby.jar (from JDK7) (only an in-memory database is used in this example)
  • akka-actor-1.2.jar
  • akka-typed-actor-1.2.jar
  • aspectwerkz-2.2.3.jar
  • scala-library.jar

Here is the code:

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

import akka.actor.TypedActor;
import akka.actor.TypedActorFactory;


public class App {

    public App() {
        TypedActor.newInstance(Backend.class, new TypedActorFactory() {
            public TypedActor create() {
                return new DataActor();
            }
        });
    }

    class DataActor extends TypedActor implements Backend {

        @Override
        public void insertData(String msg) {
            final String sqlSelect = "SELECT msg FROM SESSION.messages "+
                                     "WHERE to_user_id = ? AND from_user_id = ?";
            final String connectionURL = "jdbc:derby:memory:memdatabase;create=true";

            /* if this declaration is moved to where the string is used 
               in the conditional, the conditional can be used */
            String result;

            try(Connection conn = DriverManager.getConnection(connectionURL);) {

                try(PreparedStatement ps = conn.prepareStatement(sqlSelect);
                    ResultSet rs = new QueryHelper(ps)
                                    .integer(13).integer(26).executeQuery();) {

                    /* this doesn't work */

                    result = (rs.next()) ? rs.getString("text")
                                         : null;

                    /* but this work:

                     String result = (rs.next()) ? rs.getString("text")
                                                 : null;
                     */

                    /* this works fine 

                    while(rs.next()) {
                        result = rs.getString("msg");
                    }                                   */
                }
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }
    }

    class QueryHelper {
        private final PreparedStatement ps;
        private int index = 1;

        public QueryHelper(PreparedStatement ps) {
            this.ps = ps;
        }

        public QueryHelper integer(int param) throws SQLException {
            ps.setInt(index++, param);
            return this;
        }

        public ResultSet executeQuery() throws SQLException {
            return ps.executeQuery();
        }
    }

    public interface Backend {
        public void insertData(String text);
    }

    public static void main(String[] args) {
        new App();
    }
}
  • 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-05-26T18:31:44+00:00Added an answer on May 26, 2026 at 6:31 pm

    I have found out that this bug is in places where I use multiple resources in a single Java 7 try-with-resources statement.

    E.g. this code will have the bug:

    try (Connection conn = DriverManager.getConnection(connURL);
         PreparedStatement ps = conn.prepareStatement(sql);) {
    
        // do something
    
    } catch (SQLException e) {
        e.printStackTrace();
    }
    

    and a workaround would look like:

    try (Connection conn = DriverManager.getConnection(connURL);) {
        try (PreparedStatement ps = conn.prepareStatement(sql);) {
    
            // do something
    
        }
    } catch (SQLException e) {
        e.printStackTrace();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Java application that makes heavy use of a large file, to
I have a java main application, and I want to use log4j. I don't
I have a Java-JSF Web Application on GlassFish, in which I want to use
I'm converting an application to use Java 1.5 and have found the following method:
I have a Java application that launches another java application. The launcher has a
I have a java application that has Web Services published using Axis. With the
I have a Java application and I want to use SQL database. I have
i have a java applet application in which i use rich text area .
I have a Java Swing application client that I want to use to consume
I have a Java web application that has a 'disconnected' Java Swing desktop app.

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.