Intellij 12 not stopping at a breakpoint

Hi,

I just upgraded to Intellij 12 and I am investigating the jasypt (Java Simplified Encryption) library, http://www.jasypt.org/,


    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>servlet-api</artifactId>
      <version>2.4</version>
      <scope>provided</scope>
      <!--<optional>true</optional>-->
    </dependency>
    
    <dependency>
      <groupId>org.bouncycastle</groupId>
      <artifactId>bcprov-jdk16</artifactId>
      <version>1.40</version>
      <scope>test</scope>
    </dependency>

  • and ran the unit test BouncyCastleByProviderStringEncryptorTest in the IDE debugger.

What I found is that when I set a break point in the bouncycastle library constructor class JCEBlockCipher.java or other classes where it should stop at a breakpoint.
The IDE does not stop at the breakpoint inside bouncycastle library.

Please let me know what I am doing wrong...

Thanx in advance

- Young

I believe this worked in Intellij IDE 11

7 comments
Comment actions Permalink

Hi Young,

Checked the 'jasypt' project and it looks like your setup is incorrect - the pom.xml already has the following section:

<dependency>                           
  <groupId>org.bouncycastle</groupId>  
  <artifactId>bcprov-jdk12</artifactId>
  <version>130</version>               
  <scope>test</scope>                  
</dependency>                          



So, when you add a dependency definition below

<dependency>
  <groupId>org.bouncycastle</groupId>
  <artifactId>bcprov-jdk16</artifactId>
  <version>1.40</version>
  <scope>test</scope>
</dependency>


your project has two 'bcprov' dependencies. Try to replace the first one with yours if necessary

Denis
0
Comment actions Permalink

Hi,

Thank you for the response.

In the main pom.xml,  I replaced the original dependency

<dependency>                           

  <groupId>org.bouncycastle</groupId>  

  <artifactId>bcprov-jdk12</artifactId>

  <version>130</version>               

  <scope>test</scope>                  

</dependency>  


with version 1.40 of

<dependency>

  <groupId>org.bouncycastle</groupId>

  <artifactId>bcprov-jdk16</artifactId>

  <version>1.40</version>

  <scope>test</scope>

</dependency>

So I have only one entry in the pom.xml.

Please review the modified pom.xml I am using (see attached)

Thanx.

- Young



Attachment(s):
pom.xml
0
Comment actions Permalink

Ok, so, does the ide stops on break points now? Are you sure that the code with break point is actually executed?

Denis

0
Comment actions Permalink

no, it does not stop at the expected break point in bouncycastle module, when I run BouncyCastleByProviderStringEncryptorTest in debug mode.

And I am sure the code should be excuted as I set the breakpoint inside the default BouncyCastleProvider constructor (line 64),

...

    public BouncyCastleProvider()

    {

(line 64)      >>  super(PROVIDER_NAME, 1.40, info); <<

        for (int i = 0; i != SYMMETRIC_CIPHERS.length; i++)

        {

            Class clazz = null;

            try

            {



This is called from the unit test I am running BouncyCastleByProviderStringEncryptorTest (line 32) (see below)


...

package org.jasypt.encryption.pbe;

import org.bouncycastle.jce.provider.BouncyCastleProvider;

public class BouncyCastleByProviderStringEncryptorTest

        extends AbstractPBEStringEncryptorTest {

    protected PBEStringEncryptor createPBEStringEncryptor() {

        StandardPBEStringEncryptor encryptor = new StandardPBEStringEncryptor();

        encryptor.setAlgorithm("PBEWITHSHA256AND128BITAES-CBC-BC");

(line 32) >>        encryptor.setProvider(new BouncyCastleProvider()); <<

        return encryptor;

    }

}

Thanx.

- Young

0
Comment actions Permalink

Oh, I see now.

Asked our debugger guy to have a look into.

Denis

0
Comment actions Permalink

Thanx for the follow-up.  Please let me know...

- Young

0
Comment actions Permalink

The problem is that target class file is compiled with no debug info at all. The IDE shows hint for that:

  • the break point's sign is shown as invalid:
    sign.png
  • it shows a hint when the mouse is over the break point:
    hint.png

Note that you need to run the process being debugged in order for the IDE to be able to check break points states.

bouncycastle site mentions the following though:

The following signed provider jars are provided so that you can make use of the debug information in them. In the case of the non-provider jars (bcpkix, bcpg, and bcmail), the jar files do not need to be signed to work. You can rebuild them with debug turned on, or operate directly from the source, if you need.
I checked that it's possible to debug bcprov-ext-debug-jdk15on-147.jarhttp://www.bouncycastle.org/download/bcprov-ext-debug-jdk15on-147.jar with sources from maven repo.

Denis
0

Please sign in to leave a comment.