[jira] Created: (DERBY-4458) Dalvik compatibility

View: New views
10 Messages — Rating Filter:   Alert me  

[jira] Created: (DERBY-4458) Dalvik compatibility

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dalvik compatibility
--------------------

                 Key: DERBY-4458
                 URL: https://issues.apache.org/jira/browse/DERBY-4458
             Project: Derby
          Issue Type: Task
            Reporter: Thomas Görres




--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-4458) Dalvik / Andoid compatibility

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ https://issues.apache.org/jira/browse/DERBY-4458?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Görres updated DERBY-4458:
---------------------------------

           Description:
derby.jar cannot be used on mobile devices running the Android OS. Android uses Dalvik as runtime environment, and the classfiles from derby.jar cannot be translated to Dalvik byte code.

Steps to repeat:
1. get the Android SDK from http://developer.android.com
2. navigate to [android-sdk]/platforms/android-1.5/tools
3. execute ./dx --dex path/to/derby.jar

The dx tool should convert the JRE byte code to Dalvik byte code. Instead, it spits out this warning several time:
warning: Ignoring InnerClasses attribute for an anonymous inner class that doesn't come with an associated EnclosingMethod attribute. (This class was probably produced by a broken compiler.)

Then it runs out of memory:
java.lang.OutOfMemoryError: Java heap space
        at com.android.dx.rop.code.ThrowingInsn.withNewRegisters(ThrowingInsn.java:116)
        at com.android.dx.ssa.NormalSsaInsn.toRopInsn(NormalSsaInsn.java:122)
        at com.android.dx.ssa.back.SsaToRop.convertInsns(SsaToRop.java:386)
        at com.android.dx.ssa.back.SsaToRop.convertBasicBlock(SsaToRop.java:365)
        at com.android.dx.ssa.back.SsaToRop.convertBasicBlocks(SsaToRop.java:300)
        at com.android.dx.ssa.back.SsaToRop.convertToRop(SsaToRop.java:277)
        at com.android.dx.ssa.back.SsaToRop.convert(SsaToRop.java:118)
        at com.android.dx.ssa.back.SsaToRop.convertToRopMethod(SsaToRop.java:71)
        at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:103)
        at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:74)
        at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:269)
        at com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.java:131)
        at com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.java:85)
        at com.android.dx.command.dexer.Main.processClass(Main.java:297)
        at com.android.dx.command.dexer.Main.processFileBytes(Main.java:276)
        at com.android.dx.command.dexer.Main.access$100(Main.java:56)
        at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:228)
        at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245)
        at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:130)
        at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:108)
        at com.android.dx.command.dexer.Main.processOne(Main.java:245)
        at com.android.dx.command.dexer.Main.processAllFiles(Main.java:183)
        at com.android.dx.command.dexer.Main.run(Main.java:139)
        at com.android.dx.command.dexer.Main.main(Main.java:120)
        at com.android.dx.command.Main.main(Main.java:87)

              Priority: Blocker  (was: Major)
      Issue & fix info: [High Value Fix, Newcomer]
           Environment: dx 1.2 (from the Android SDK 2.0) running on Java 1.6
     Affects Version/s: 10.5.3.0
    Bug behavior facts: [Crash]
    Remaining Estimate: 96h
     Original Estimate: 96h
               Summary: Dalvik / Andoid compatibility  (was: Dalvik compatibility)

> Dalvik / Andoid compatibility
> -----------------------------
>
>                 Key: DERBY-4458
>                 URL: https://issues.apache.org/jira/browse/DERBY-4458
>             Project: Derby
>          Issue Type: Task
>    Affects Versions: 10.5.3.0
>         Environment: dx 1.2 (from the Android SDK 2.0) running on Java 1.6
>            Reporter: Thomas Görres
>            Priority: Blocker
>   Original Estimate: 96h
>  Remaining Estimate: 96h
>
> derby.jar cannot be used on mobile devices running the Android OS. Android uses Dalvik as runtime environment, and the classfiles from derby.jar cannot be translated to Dalvik byte code.
> Steps to repeat:
> 1. get the Android SDK from http://developer.android.com
> 2. navigate to [android-sdk]/platforms/android-1.5/tools
> 3. execute ./dx --dex path/to/derby.jar
> The dx tool should convert the JRE byte code to Dalvik byte code. Instead, it spits out this warning several time:
> warning: Ignoring InnerClasses attribute for an anonymous inner class that doesn't come with an associated EnclosingMethod attribute. (This class was probably produced by a broken compiler.)
> Then it runs out of memory:
> java.lang.OutOfMemoryError: Java heap space
> at com.android.dx.rop.code.ThrowingInsn.withNewRegisters(ThrowingInsn.java:116)
> at com.android.dx.ssa.NormalSsaInsn.toRopInsn(NormalSsaInsn.java:122)
> at com.android.dx.ssa.back.SsaToRop.convertInsns(SsaToRop.java:386)
> at com.android.dx.ssa.back.SsaToRop.convertBasicBlock(SsaToRop.java:365)
> at com.android.dx.ssa.back.SsaToRop.convertBasicBlocks(SsaToRop.java:300)
> at com.android.dx.ssa.back.SsaToRop.convertToRop(SsaToRop.java:277)
> at com.android.dx.ssa.back.SsaToRop.convert(SsaToRop.java:118)
> at com.android.dx.ssa.back.SsaToRop.convertToRopMethod(SsaToRop.java:71)
> at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:103)
> at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:74)
> at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:269)
> at com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.java:131)
> at com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.java:85)
> at com.android.dx.command.dexer.Main.processClass(Main.java:297)
> at com.android.dx.command.dexer.Main.processFileBytes(Main.java:276)
> at com.android.dx.command.dexer.Main.access$100(Main.java:56)
> at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:228)
> at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245)
> at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:130)
> at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:108)
> at com.android.dx.command.dexer.Main.processOne(Main.java:245)
> at com.android.dx.command.dexer.Main.processAllFiles(Main.java:183)
> at com.android.dx.command.dexer.Main.run(Main.java:139)
> at com.android.dx.command.dexer.Main.main(Main.java:120)
> at com.android.dx.command.Main.main(Main.java:87)

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Updated: (DERBY-4458) Dalvik / Andoid compatibility

by francois.orsini :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Thomas,

This is a separate issue but last I heard about Dalvik is that there is still no support for dynamic bytecode translation at runtime  - Derby generates bytecode dynamically for every new SQL statement, so I doubt you might be able to get Derby running on Android until dynamic bytecode translation is available in the Dalvik VM at runtime

Cheers,

--Francois

2009/12/1 Thomas Görres (JIRA) <jira@...>

    [ https://issues.apache.org/jira/browse/DERBY-4458?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Görres updated DERBY-4458:
---------------------------------

          Description:
derby.jar cannot be used on mobile devices running the Android OS. Android uses Dalvik as runtime environment, and the classfiles from derby.jar cannot be translated to Dalvik byte code.

Steps to repeat:
1. get the Android SDK from http://developer.android.com
2. navigate to [android-sdk]/platforms/android-1.5/tools
3. execute ./dx --dex path/to/derby.jar

The dx tool should convert the JRE byte code to Dalvik byte code. Instead, it spits out this warning several time:
warning: Ignoring InnerClasses attribute for an anonymous inner class that doesn't come with an associated EnclosingMethod attribute. (This class was probably produced by a broken compiler.)

Then it runs out of memory:
java.lang.OutOfMemoryError: Java heap space
       at com.android.dx.rop.code.ThrowingInsn.withNewRegisters(ThrowingInsn.java:116)
       at com.android.dx.ssa.NormalSsaInsn.toRopInsn(NormalSsaInsn.java:122)
       at com.android.dx.ssa.back.SsaToRop.convertInsns(SsaToRop.java:386)
       at com.android.dx.ssa.back.SsaToRop.convertBasicBlock(SsaToRop.java:365)
       at com.android.dx.ssa.back.SsaToRop.convertBasicBlocks(SsaToRop.java:300)
       at com.android.dx.ssa.back.SsaToRop.convertToRop(SsaToRop.java:277)
       at com.android.dx.ssa.back.SsaToRop.convert(SsaToRop.java:118)
       at com.android.dx.ssa.back.SsaToRop.convertToRopMethod(SsaToRop.java:71)
       at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:103)
       at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:74)
       at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:269)
       at com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.java:131)
       at com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.java:85)
       at com.android.dx.command.dexer.Main.processClass(Main.java:297)
       at com.android.dx.command.dexer.Main.processFileBytes(Main.java:276)
       at com.android.dx.command.dexer.Main.access$100(Main.java:56)
       at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:228)
       at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245)
       at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:130)
       at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:108)
       at com.android.dx.command.dexer.Main.processOne(Main.java:245)
       at com.android.dx.command.dexer.Main.processAllFiles(Main.java:183)
       at com.android.dx.command.dexer.Main.run(Main.java:139)
       at com.android.dx.command.dexer.Main.main(Main.java:120)
       at com.android.dx.command.Main.main(Main.java:87)

             Priority: Blocker  (was: Major)
     Issue & fix info: [High Value Fix, Newcomer]
          Environment: dx 1.2 (from the Android SDK 2.0) running on Java 1.6
    Affects Version/s: 10.5.3.0
   Bug behavior facts: [Crash]
   Remaining Estimate: 96h
    Original Estimate: 96h
              Summary: Dalvik / Andoid compatibility  (was: Dalvik compatibility)

> Dalvik / Andoid compatibility
> -----------------------------
>
>                 Key: DERBY-4458
>                 URL: https://issues.apache.org/jira/browse/DERBY-4458
>             Project: Derby
>          Issue Type: Task
>    Affects Versions: 10.5.3.0
>         Environment: dx 1.2 (from the Android SDK 2.0) running on Java 1.6
>            Reporter: Thomas Görres
>            Priority: Blocker
>   Original Estimate: 96h
>  Remaining Estimate: 96h
>
> derby.jar cannot be used on mobile devices running the Android OS. Android uses Dalvik as runtime environment, and the classfiles from derby.jar cannot be translated to Dalvik byte code.
> Steps to repeat:
> 1. get the Android SDK from http://developer.android.com
> 2. navigate to [android-sdk]/platforms/android-1.5/tools
> 3. execute ./dx --dex path/to/derby.jar
> The dx tool should convert the JRE byte code to Dalvik byte code. Instead, it spits out this warning several time:
> warning: Ignoring InnerClasses attribute for an anonymous inner class that doesn't come with an associated EnclosingMethod attribute. (This class was probably produced by a broken compiler.)
> Then it runs out of memory:
> java.lang.OutOfMemoryError: Java heap space
>       at com.android.dx.rop.code.ThrowingInsn.withNewRegisters(ThrowingInsn.java:116)
>       at com.android.dx.ssa.NormalSsaInsn.toRopInsn(NormalSsaInsn.java:122)
>       at com.android.dx.ssa.back.SsaToRop.convertInsns(SsaToRop.java:386)
>       at com.android.dx.ssa.back.SsaToRop.convertBasicBlock(SsaToRop.java:365)
>       at com.android.dx.ssa.back.SsaToRop.convertBasicBlocks(SsaToRop.java:300)
>       at com.android.dx.ssa.back.SsaToRop.convertToRop(SsaToRop.java:277)
>       at com.android.dx.ssa.back.SsaToRop.convert(SsaToRop.java:118)
>       at com.android.dx.ssa.back.SsaToRop.convertToRopMethod(SsaToRop.java:71)
>       at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:103)
>       at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:74)
>       at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:269)
>       at com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.java:131)
>       at com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.java:85)
>       at com.android.dx.command.dexer.Main.processClass(Main.java:297)
>       at com.android.dx.command.dexer.Main.processFileBytes(Main.java:276)
>       at com.android.dx.command.dexer.Main.access$100(Main.java:56)
>       at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:228)
>       at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245)
>       at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:130)
>       at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:108)
>       at com.android.dx.command.dexer.Main.processOne(Main.java:245)
>       at com.android.dx.command.dexer.Main.processAllFiles(Main.java:183)
>       at com.android.dx.command.dexer.Main.run(Main.java:139)
>       at com.android.dx.command.dexer.Main.main(Main.java:120)
>       at com.android.dx.command.Main.main(Main.java:87)

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (DERBY-4458) Dalvik / Andoid compatibility

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ https://issues.apache.org/jira/browse/DERBY-4458?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dag H. Wanvik updated DERBY-4458:
---------------------------------

            Issue Type: Improvement  (was: Task)
    Remaining Estimate:     (was: 96h)
     Original Estimate:     (was: 96h)

> Dalvik / Andoid compatibility
> -----------------------------
>
>                 Key: DERBY-4458
>                 URL: https://issues.apache.org/jira/browse/DERBY-4458
>             Project: Derby
>          Issue Type: Improvement
>    Affects Versions: 10.5.3.0
>         Environment: dx 1.2 (from the Android SDK 2.0) running on Java 1.6
>            Reporter: Thomas Görres
>            Priority: Blocker
>
> derby.jar cannot be used on mobile devices running the Android OS. Android uses Dalvik as runtime environment, and the classfiles from derby.jar cannot be translated to Dalvik byte code.
> Steps to repeat:
> 1. get the Android SDK from http://developer.android.com
> 2. navigate to [android-sdk]/platforms/android-1.5/tools
> 3. execute ./dx --dex path/to/derby.jar
> The dx tool should convert the JRE byte code to Dalvik byte code. Instead, it spits out this warning several time:
> warning: Ignoring InnerClasses attribute for an anonymous inner class that doesn't come with an associated EnclosingMethod attribute. (This class was probably produced by a broken compiler.)
> Then it runs out of memory:
> java.lang.OutOfMemoryError: Java heap space
> at com.android.dx.rop.code.ThrowingInsn.withNewRegisters(ThrowingInsn.java:116)
> at com.android.dx.ssa.NormalSsaInsn.toRopInsn(NormalSsaInsn.java:122)
> at com.android.dx.ssa.back.SsaToRop.convertInsns(SsaToRop.java:386)
> at com.android.dx.ssa.back.SsaToRop.convertBasicBlock(SsaToRop.java:365)
> at com.android.dx.ssa.back.SsaToRop.convertBasicBlocks(SsaToRop.java:300)
> at com.android.dx.ssa.back.SsaToRop.convertToRop(SsaToRop.java:277)
> at com.android.dx.ssa.back.SsaToRop.convert(SsaToRop.java:118)
> at com.android.dx.ssa.back.SsaToRop.convertToRopMethod(SsaToRop.java:71)
> at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:103)
> at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:74)
> at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:269)
> at com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.java:131)
> at com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.java:85)
> at com.android.dx.command.dexer.Main.processClass(Main.java:297)
> at com.android.dx.command.dexer.Main.processFileBytes(Main.java:276)
> at com.android.dx.command.dexer.Main.access$100(Main.java:56)
> at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:228)
> at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245)
> at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:130)
> at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:108)
> at com.android.dx.command.dexer.Main.processOne(Main.java:245)
> at com.android.dx.command.dexer.Main.processAllFiles(Main.java:183)
> at com.android.dx.command.dexer.Main.run(Main.java:139)
> at com.android.dx.command.dexer.Main.main(Main.java:120)
> at com.android.dx.command.Main.main(Main.java:87)

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-4458) Dalvik / Andoid compatibility

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ https://issues.apache.org/jira/browse/DERBY-4458?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dag H. Wanvik updated DERBY-4458:
---------------------------------

      Issue & fix info:   (was: [Newcomer, High Value Fix])
    Bug behavior facts:   (was: [Crash])

> Dalvik / Andoid compatibility
> -----------------------------
>
>                 Key: DERBY-4458
>                 URL: https://issues.apache.org/jira/browse/DERBY-4458
>             Project: Derby
>          Issue Type: Improvement
>    Affects Versions: 10.5.3.0
>         Environment: dx 1.2 (from the Android SDK 2.0) running on Java 1.6
>            Reporter: Thomas Görres
>            Priority: Blocker
>
> derby.jar cannot be used on mobile devices running the Android OS. Android uses Dalvik as runtime environment, and the classfiles from derby.jar cannot be translated to Dalvik byte code.
> Steps to repeat:
> 1. get the Android SDK from http://developer.android.com
> 2. navigate to [android-sdk]/platforms/android-1.5/tools
> 3. execute ./dx --dex path/to/derby.jar
> The dx tool should convert the JRE byte code to Dalvik byte code. Instead, it spits out this warning several time:
> warning: Ignoring InnerClasses attribute for an anonymous inner class that doesn't come with an associated EnclosingMethod attribute. (This class was probably produced by a broken compiler.)
> Then it runs out of memory:
> java.lang.OutOfMemoryError: Java heap space
> at com.android.dx.rop.code.ThrowingInsn.withNewRegisters(ThrowingInsn.java:116)
> at com.android.dx.ssa.NormalSsaInsn.toRopInsn(NormalSsaInsn.java:122)
> at com.android.dx.ssa.back.SsaToRop.convertInsns(SsaToRop.java:386)
> at com.android.dx.ssa.back.SsaToRop.convertBasicBlock(SsaToRop.java:365)
> at com.android.dx.ssa.back.SsaToRop.convertBasicBlocks(SsaToRop.java:300)
> at com.android.dx.ssa.back.SsaToRop.convertToRop(SsaToRop.java:277)
> at com.android.dx.ssa.back.SsaToRop.convert(SsaToRop.java:118)
> at com.android.dx.ssa.back.SsaToRop.convertToRopMethod(SsaToRop.java:71)
> at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:103)
> at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:74)
> at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:269)
> at com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.java:131)
> at com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.java:85)
> at com.android.dx.command.dexer.Main.processClass(Main.java:297)
> at com.android.dx.command.dexer.Main.processFileBytes(Main.java:276)
> at com.android.dx.command.dexer.Main.access$100(Main.java:56)
> at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:228)
> at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245)
> at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:130)
> at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:108)
> at com.android.dx.command.dexer.Main.processOne(Main.java:245)
> at com.android.dx.command.dexer.Main.processAllFiles(Main.java:183)
> at com.android.dx.command.dexer.Main.run(Main.java:139)
> at com.android.dx.command.dexer.Main.main(Main.java:120)
> at com.android.dx.command.Main.main(Main.java:87)

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-4458) Dalvik / Andoid compatibility

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/jira/browse/DERBY-4458?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12784595#action_12784595 ]

Dag H. Wanvik commented on DERBY-4458:
--------------------------------------

Francois Orsini wrote on derby-dev Tue, 01 Dec 2009 09:49:00 -0800:

>This is a separate issue but last I heard about Dalvik is that there is
>still no support for dynamic bytecode translation at runtime  - Derby
>generates bytecode dynamically for every new SQL statement, so I doubt you
>might be able to get Derby running on Android until dynamic bytecode
>translation is available in the Dalvik VM at runtime

That would be a show-stopper, yes.
As for why the converter balks at Derby byte code, I have no idea. It is produced by the standard Sun Java compiler. Marking this issue as Improvement.

> Dalvik / Andoid compatibility
> -----------------------------
>
>                 Key: DERBY-4458
>                 URL: https://issues.apache.org/jira/browse/DERBY-4458
>             Project: Derby
>          Issue Type: Improvement
>    Affects Versions: 10.5.3.0
>         Environment: dx 1.2 (from the Android SDK 2.0) running on Java 1.6
>            Reporter: Thomas Görres
>            Priority: Blocker
>
> derby.jar cannot be used on mobile devices running the Android OS. Android uses Dalvik as runtime environment, and the classfiles from derby.jar cannot be translated to Dalvik byte code.
> Steps to repeat:
> 1. get the Android SDK from http://developer.android.com
> 2. navigate to [android-sdk]/platforms/android-1.5/tools
> 3. execute ./dx --dex path/to/derby.jar
> The dx tool should convert the JRE byte code to Dalvik byte code. Instead, it spits out this warning several time:
> warning: Ignoring InnerClasses attribute for an anonymous inner class that doesn't come with an associated EnclosingMethod attribute. (This class was probably produced by a broken compiler.)
> Then it runs out of memory:
> java.lang.OutOfMemoryError: Java heap space
> at com.android.dx.rop.code.ThrowingInsn.withNewRegisters(ThrowingInsn.java:116)
> at com.android.dx.ssa.NormalSsaInsn.toRopInsn(NormalSsaInsn.java:122)
> at com.android.dx.ssa.back.SsaToRop.convertInsns(SsaToRop.java:386)
> at com.android.dx.ssa.back.SsaToRop.convertBasicBlock(SsaToRop.java:365)
> at com.android.dx.ssa.back.SsaToRop.convertBasicBlocks(SsaToRop.java:300)
> at com.android.dx.ssa.back.SsaToRop.convertToRop(SsaToRop.java:277)
> at com.android.dx.ssa.back.SsaToRop.convert(SsaToRop.java:118)
> at com.android.dx.ssa.back.SsaToRop.convertToRopMethod(SsaToRop.java:71)
> at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:103)
> at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:74)
> at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:269)
> at com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.java:131)
> at com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.java:85)
> at com.android.dx.command.dexer.Main.processClass(Main.java:297)
> at com.android.dx.command.dexer.Main.processFileBytes(Main.java:276)
> at com.android.dx.command.dexer.Main.access$100(Main.java:56)
> at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:228)
> at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245)
> at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:130)
> at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:108)
> at com.android.dx.command.dexer.Main.processOne(Main.java:245)
> at com.android.dx.command.dexer.Main.processAllFiles(Main.java:183)
> at com.android.dx.command.dexer.Main.run(Main.java:139)
> at com.android.dx.command.dexer.Main.main(Main.java:120)
> at com.android.dx.command.Main.main(Main.java:87)

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-4458) Dalvik / Andoid compatibility

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/jira/browse/DERBY-4458?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12784598#action_12784598 ]

Bryan Pendleton commented on DERBY-4458:
----------------------------------------

What, precisely, is it that we should improve about Derby?

Seems like if there is an improvement needed, it is in the android 'dx' tool, isn't it?


> Dalvik / Andoid compatibility
> -----------------------------
>
>                 Key: DERBY-4458
>                 URL: https://issues.apache.org/jira/browse/DERBY-4458
>             Project: Derby
>          Issue Type: Improvement
>    Affects Versions: 10.5.3.0
>         Environment: dx 1.2 (from the Android SDK 2.0) running on Java 1.6
>            Reporter: Thomas Görres
>            Priority: Blocker
>
> derby.jar cannot be used on mobile devices running the Android OS. Android uses Dalvik as runtime environment, and the classfiles from derby.jar cannot be translated to Dalvik byte code.
> Steps to repeat:
> 1. get the Android SDK from http://developer.android.com
> 2. navigate to [android-sdk]/platforms/android-1.5/tools
> 3. execute ./dx --dex path/to/derby.jar
> The dx tool should convert the JRE byte code to Dalvik byte code. Instead, it spits out this warning several time:
> warning: Ignoring InnerClasses attribute for an anonymous inner class that doesn't come with an associated EnclosingMethod attribute. (This class was probably produced by a broken compiler.)
> Then it runs out of memory:
> java.lang.OutOfMemoryError: Java heap space
> at com.android.dx.rop.code.ThrowingInsn.withNewRegisters(ThrowingInsn.java:116)
> at com.android.dx.ssa.NormalSsaInsn.toRopInsn(NormalSsaInsn.java:122)
> at com.android.dx.ssa.back.SsaToRop.convertInsns(SsaToRop.java:386)
> at com.android.dx.ssa.back.SsaToRop.convertBasicBlock(SsaToRop.java:365)
> at com.android.dx.ssa.back.SsaToRop.convertBasicBlocks(SsaToRop.java:300)
> at com.android.dx.ssa.back.SsaToRop.convertToRop(SsaToRop.java:277)
> at com.android.dx.ssa.back.SsaToRop.convert(SsaToRop.java:118)
> at com.android.dx.ssa.back.SsaToRop.convertToRopMethod(SsaToRop.java:71)
> at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:103)
> at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:74)
> at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:269)
> at com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.java:131)
> at com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.java:85)
> at com.android.dx.command.dexer.Main.processClass(Main.java:297)
> at com.android.dx.command.dexer.Main.processFileBytes(Main.java:276)
> at com.android.dx.command.dexer.Main.access$100(Main.java:56)
> at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:228)
> at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245)
> at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:130)
> at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:108)
> at com.android.dx.command.dexer.Main.processOne(Main.java:245)
> at com.android.dx.command.dexer.Main.processAllFiles(Main.java:183)
> at com.android.dx.command.dexer.Main.run(Main.java:139)
> at com.android.dx.command.dexer.Main.main(Main.java:120)
> at com.android.dx.command.Main.main(Main.java:87)

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-4458) Dalvik / Andoid compatibility

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/jira/browse/DERBY-4458?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12784610#action_12784610 ]

Francois Orsini commented on DERBY-4458:
----------------------------------------


  > Seems like if there is an improvement needed, it is in the android 'dx' tool, isn't it?

You would think so but according to the Dalvik lead engineer, it is not:
http://www.mail-archive.com/android-developers@.../msg29593.html

This warning (not an error) is also reported by 'dx' translating some other Java libraries, not just derby.jar.
Unless I'm mistaken, derby.jar GA is built using Java 1.4 which is obviously not a modern compiler? my guess is that this warning would disappear if building with Java 1.5 or 1.6.

In any case, this is apparently NOT a blocking issue - Thomas was also reporting a Java OutOfMemory error which can be solved in Dalvik by increasing the heap size in dx.bat...

Of course, even if the translation succeeds, Derby will not run, causing all kinds of errors due to its dynamic generated bytecode not being translated by the Dalvik VM at runtime, which is obviously a separate issue by itself.

> Dalvik / Andoid compatibility
> -----------------------------
>
>                 Key: DERBY-4458
>                 URL: https://issues.apache.org/jira/browse/DERBY-4458
>             Project: Derby
>          Issue Type: Improvement
>    Affects Versions: 10.5.3.0
>         Environment: dx 1.2 (from the Android SDK 2.0) running on Java 1.6
>            Reporter: Thomas Görres
>            Priority: Blocker
>
> derby.jar cannot be used on mobile devices running the Android OS. Android uses Dalvik as runtime environment, and the classfiles from derby.jar cannot be translated to Dalvik byte code.
> Steps to repeat:
> 1. get the Android SDK from http://developer.android.com
> 2. navigate to [android-sdk]/platforms/android-1.5/tools
> 3. execute ./dx --dex path/to/derby.jar
> The dx tool should convert the JRE byte code to Dalvik byte code. Instead, it spits out this warning several time:
> warning: Ignoring InnerClasses attribute for an anonymous inner class that doesn't come with an associated EnclosingMethod attribute. (This class was probably produced by a broken compiler.)
> Then it runs out of memory:
> java.lang.OutOfMemoryError: Java heap space
> at com.android.dx.rop.code.ThrowingInsn.withNewRegisters(ThrowingInsn.java:116)
> at com.android.dx.ssa.NormalSsaInsn.toRopInsn(NormalSsaInsn.java:122)
> at com.android.dx.ssa.back.SsaToRop.convertInsns(SsaToRop.java:386)
> at com.android.dx.ssa.back.SsaToRop.convertBasicBlock(SsaToRop.java:365)
> at com.android.dx.ssa.back.SsaToRop.convertBasicBlocks(SsaToRop.java:300)
> at com.android.dx.ssa.back.SsaToRop.convertToRop(SsaToRop.java:277)
> at com.android.dx.ssa.back.SsaToRop.convert(SsaToRop.java:118)
> at com.android.dx.ssa.back.SsaToRop.convertToRopMethod(SsaToRop.java:71)
> at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:103)
> at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:74)
> at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:269)
> at com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.java:131)
> at com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.java:85)
> at com.android.dx.command.dexer.Main.processClass(Main.java:297)
> at com.android.dx.command.dexer.Main.processFileBytes(Main.java:276)
> at com.android.dx.command.dexer.Main.access$100(Main.java:56)
> at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:228)
> at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245)
> at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:130)
> at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:108)
> at com.android.dx.command.dexer.Main.processOne(Main.java:245)
> at com.android.dx.command.dexer.Main.processAllFiles(Main.java:183)
> at com.android.dx.command.dexer.Main.run(Main.java:139)
> at com.android.dx.command.dexer.Main.main(Main.java:120)
> at com.android.dx.command.Main.main(Main.java:87)

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-4458) Dalvik / Andoid compatibility

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/jira/browse/DERBY-4458?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12784937#action_12784937 ]

Dan Bornstein commented on DERBY-4458:
--------------------------------------

Hi. I'm the Dalvik engineer referred to above. In fact, I believe the bytecode spec changed between 1.4 and 1.5. dx's warning is basically saying that 1.4-based code that uses inner classes doesn't provide enough information for a 1.5 runtime to faithfully report about them via reflection. Rather than try to halfway reconstruct the reflection info in such cases, dx just gives up and ignores inner classes info entirely. If your code doesn't make reflection calls to look at inner class stuff, then none of this makes any difference.

Also, if dx is running out of memory, you can tell it to have a larger maximum heap size by using a passthrough option for the underlying vm that runs dx, e.g. "dx -JXmx2048m ...".

Also also, while the Dalvik vm doesn't read .class files directly, you can in fact synthesize .dex files and use them, in a similar manner. I have seen a proof of concept where someone generated .class files, ran them through dx (treated as a library), and then loaded the result. It works, but it is admittedly not pretty, especially since the dx code isn't particularly geared for use in a memory-constrained environment (see above). In the long run, you'd be better off generating .dex files more directly, but it might at least unblock you.

Cheers!

-dan


> Dalvik / Andoid compatibility
> -----------------------------
>
>                 Key: DERBY-4458
>                 URL: https://issues.apache.org/jira/browse/DERBY-4458
>             Project: Derby
>          Issue Type: Improvement
>    Affects Versions: 10.5.3.0
>         Environment: dx 1.2 (from the Android SDK 2.0) running on Java 1.6
>            Reporter: Thomas Görres
>            Priority: Blocker
>
> derby.jar cannot be used on mobile devices running the Android OS. Android uses Dalvik as runtime environment, and the classfiles from derby.jar cannot be translated to Dalvik byte code.
> Steps to repeat:
> 1. get the Android SDK from http://developer.android.com
> 2. navigate to [android-sdk]/platforms/android-1.5/tools
> 3. execute ./dx --dex path/to/derby.jar
> The dx tool should convert the JRE byte code to Dalvik byte code. Instead, it spits out this warning several time:
> warning: Ignoring InnerClasses attribute for an anonymous inner class that doesn't come with an associated EnclosingMethod attribute. (This class was probably produced by a broken compiler.)
> Then it runs out of memory:
> java.lang.OutOfMemoryError: Java heap space
> at com.android.dx.rop.code.ThrowingInsn.withNewRegisters(ThrowingInsn.java:116)
> at com.android.dx.ssa.NormalSsaInsn.toRopInsn(NormalSsaInsn.java:122)
> at com.android.dx.ssa.back.SsaToRop.convertInsns(SsaToRop.java:386)
> at com.android.dx.ssa.back.SsaToRop.convertBasicBlock(SsaToRop.java:365)
> at com.android.dx.ssa.back.SsaToRop.convertBasicBlocks(SsaToRop.java:300)
> at com.android.dx.ssa.back.SsaToRop.convertToRop(SsaToRop.java:277)
> at com.android.dx.ssa.back.SsaToRop.convert(SsaToRop.java:118)
> at com.android.dx.ssa.back.SsaToRop.convertToRopMethod(SsaToRop.java:71)
> at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:103)
> at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:74)
> at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:269)
> at com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.java:131)
> at com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.java:85)
> at com.android.dx.command.dexer.Main.processClass(Main.java:297)
> at com.android.dx.command.dexer.Main.processFileBytes(Main.java:276)
> at com.android.dx.command.dexer.Main.access$100(Main.java:56)
> at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:228)
> at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245)
> at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:130)
> at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:108)
> at com.android.dx.command.dexer.Main.processOne(Main.java:245)
> at com.android.dx.command.dexer.Main.processAllFiles(Main.java:183)
> at com.android.dx.command.dexer.Main.run(Main.java:139)
> at com.android.dx.command.dexer.Main.main(Main.java:120)
> at com.android.dx.command.Main.main(Main.java:87)

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-4458) Dalvik / Andoid compatibility

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/jira/browse/DERBY-4458?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12798254#action_12798254 ]

Bryan Pendleton commented on DERBY-4458:
----------------------------------------

I tried doing something similar, but different, which was to use the derbyclient.jar library in an Android application.

I made some progress, but am having trouble because Derby's ClientBaseDataSource class implements
javax.naming.Referenceable from the JNDI API, and Android apparently does not support javax.naming.*

The error I get is:

I/dalvikvm(  348): Failed resolving Lorg/apache/derby/jdbc/ClientBaseDataSource; interface 212 'Ljavax/naming/Referenceable;'

Sure enough, javax.naming is *not* in the list of supported packages at
http://developer.android.com/reference/packages.html


> Dalvik / Andoid compatibility
> -----------------------------
>
>                 Key: DERBY-4458
>                 URL: https://issues.apache.org/jira/browse/DERBY-4458
>             Project: Derby
>          Issue Type: Improvement
>    Affects Versions: 10.5.3.0
>         Environment: dx 1.2 (from the Android SDK 2.0) running on Java 1.6
>            Reporter: Thomas Görres
>            Priority: Blocker
>
> derby.jar cannot be used on mobile devices running the Android OS. Android uses Dalvik as runtime environment, and the classfiles from derby.jar cannot be translated to Dalvik byte code.
> Steps to repeat:
> 1. get the Android SDK from http://developer.android.com
> 2. navigate to [android-sdk]/platforms/android-1.5/tools
> 3. execute ./dx --dex path/to/derby.jar
> The dx tool should convert the JRE byte code to Dalvik byte code. Instead, it spits out this warning several time:
> warning: Ignoring InnerClasses attribute for an anonymous inner class that doesn't come with an associated EnclosingMethod attribute. (This class was probably produced by a broken compiler.)
> Then it runs out of memory:
> java.lang.OutOfMemoryError: Java heap space
> at com.android.dx.rop.code.ThrowingInsn.withNewRegisters(ThrowingInsn.java:116)
> at com.android.dx.ssa.NormalSsaInsn.toRopInsn(NormalSsaInsn.java:122)
> at com.android.dx.ssa.back.SsaToRop.convertInsns(SsaToRop.java:386)
> at com.android.dx.ssa.back.SsaToRop.convertBasicBlock(SsaToRop.java:365)
> at com.android.dx.ssa.back.SsaToRop.convertBasicBlocks(SsaToRop.java:300)
> at com.android.dx.ssa.back.SsaToRop.convertToRop(SsaToRop.java:277)
> at com.android.dx.ssa.back.SsaToRop.convert(SsaToRop.java:118)
> at com.android.dx.ssa.back.SsaToRop.convertToRopMethod(SsaToRop.java:71)
> at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:103)
> at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:74)
> at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:269)
> at com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.java:131)
> at com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.java:85)
> at com.android.dx.command.dexer.Main.processClass(Main.java:297)
> at com.android.dx.command.dexer.Main.processFileBytes(Main.java:276)
> at com.android.dx.command.dexer.Main.access$100(Main.java:56)
> at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:228)
> at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245)
> at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:130)
> at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:108)
> at com.android.dx.command.dexer.Main.processOne(Main.java:245)
> at com.android.dx.command.dexer.Main.processAllFiles(Main.java:183)
> at com.android.dx.command.dexer.Main.run(Main.java:139)
> at com.android.dx.command.dexer.Main.main(Main.java:120)
> at com.android.dx.command.Main.main(Main.java:87)

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.