IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Android Discussion :

[com.googlecode.openbeans.XMLEncoder] cherche mais ne trouve pas java.awt.Choice


Sujet :

Android

  1. #1
    Nouveau membre du Club
    Homme Profil pro
    Retraité
    Inscrit en
    Février 2009
    Messages
    21
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Loire Atlantique (Pays de la Loire)

    Informations professionnelles :
    Activité : Retraité
    Secteur : Enseignement

    Informations forums :
    Inscription : Février 2009
    Messages : 21
    Points : 30
    Points
    30
    Par défaut [com.googlecode.openbeans.XMLEncoder] cherche mais ne trouve pas java.awt.Choice
    Bonjour,

    Je désire encoder en XML comme je le fais habituellement. Je change de packetage pour celui d'Android.
    Une exception apparaît à l'exécution au moment du new XMLEncoder (fos). (pile d'exceptions ci-dessous)
    La méthode a été testée/tracée jusqu'au new. (code ci-dessous)
    Une méthode de substitution pratique la "XMLisation manuelle" à base de println() et fonctionne parfaitement. (code ci-dessous)
    Le problème est identique sur un autre périphérique.

    Où est le problème ?

    Cordialement

    La méthode en erreur
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
     
    private void saveXML (String nomFichier) throws IOException
    {
               file = new File(nomFichier + ".xml");
               file.createNewFile();
               FileOutputStream fos = new FileOutputStream(file);
               XMLEncoder encodeur = new XMLEncoder(fos);
               encodeur.writeObject(parcelle);
               encodeur.close();
    }
    La méthode qui fonctionne
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
     
    private void saveXMLmanuel (String nomFichier) throws IOException
    {
              file = new File(nomFichier + ".xml");
              file.createNewFile();
              PrintStream out = new PrintStream(file);
              parcelle.print(out); // which is a long long long list of println() !!!!
              out.close();
    }
    Un extrait de la pile d'exception
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
     
    01-30 19:28:38.509: E/AndroidRuntime(1844): Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Ljava/awt/Choice;
    01-30 19:28:38.509: E/AndroidRuntime(1844): 	at com.googlecode.openbeans.Encoder.<clinit>(Encoder.java:120)
    01-30 19:28:38.509: E/AndroidRuntime(1844): 	at org.universsel.estay.arpenteur.Enregistrer.enregistrerXML(Enregistrer.java:149)
    01-30 19:28:38.509: E/AndroidRuntime(1844): 	at org.universsel.estay.arpenteur.Enregistrer.enregistrer(Enregistrer.java:124)
    01-30 19:28:38.509: E/AndroidRuntime(1844): 	... 13 more
    01-30 19:28:38.509: E/AndroidRuntime(1844): Caused by: java.lang.ClassNotFoundException: Didn't find class "java.awt.Choice" on path: DexPathList[[zip file "/data/app/.../base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
    01-30 19:28:38.509: E/AndroidRuntime(1844): 	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
    01-30 19:28:38.509: E/AndroidRuntime(1844): 	at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
    01-30 19:28:38.509: E/AndroidRuntime(1844): 	at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
    01-30 19:28:38.509: E/AndroidRuntime(1844): 	... 16 more
    01-30 19:28:38.509: E/AndroidRuntime(1844): 	Suppressed: java.lang.ClassNotFoundException: java.awt.Choice
    01-30 19:28:38.509: E/AndroidRuntime(1844): 		at java.lang.Class.classForName(Native Method)
    01-30 19:28:38.509: E/AndroidRuntime(1844): 		at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
    01-30 19:28:38.509: E/AndroidRuntime(1844): 		at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
    01-30 19:28:38.509: E/AndroidRuntime(1844): 		at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
    01-30 19:28:38.509: E/AndroidRuntime(1844): 		... 17 more
    01-30 19:28:38.509: E/AndroidRuntime(1844): 	Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
    PS : Ubuntu 14.04 / Android Studio 1.0.2 / AVD Nexus 5 API 21 x86

  2. #2
    Modérateur
    Avatar de Hizin
    Homme Profil pro
    Développeur mobile
    Inscrit en
    Février 2010
    Messages
    2 180
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 35
    Localisation : France

    Informations professionnelles :
    Activité : Développeur mobile

    Informations forums :
    Inscription : Février 2010
    Messages : 2 180
    Points : 5 072
    Points
    5 072
    Par défaut
    Android utilise Java mais n'utilise pas toutes les classes d'une JVM standard. Dalvik & ART sont des JVM différentes de celles que l'on trouve sur le desktop. Elles peuvent se ressembler, avoir des classes identiques, mais ce ne sont pas les mêmes et il faut être très prudent lorsque l'on est un habitué du Java. Il n'est pas rare d'utiliser des méthodes de mémoire pour se rendre compte qu'elles ne font pas la même chose sur Android.

    En bref, les packages awt et Swing ne sont pas embarqués par les VM Android, il est donc normal que le compilateur ne les trouve pas.

    EDIT : Voici le code de la classe en question :
    Code Java : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    /*
     *  Licensed to the Apache Software Foundation (ASF) under one or more
     *  contributor license agreements.  See the NOTICE file distributed with
     *  this work for additional information regarding copyright ownership.
     *  The ASF licenses this file to You under the Apache License, Version 2.0
     *  (the "License"); you may not use this file except in compliance with
     *  the License.  You may obtain a copy of the License at
     *
     *     http://www.apache.org/licenses/LICENSE-2.0
     *
     *  Unless required by applicable law or agreed to in writing, software
     *  distributed under the License is distributed on an "AS IS" BASIS,
     *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     *  See the License for the specific language governing permissions and
     *  limitations under the License.
     */
     
    package com.googlecode.openbeans;
     
    import java.awt.Choice;
    import java.awt.Color;
    import java.awt.Component;
    import java.awt.Container;
    import java.awt.Cursor;
    import java.awt.Dimension;
    import java.awt.Font;
    import java.awt.Insets;
    import java.awt.List;
    import java.awt.Menu;
    import java.awt.MenuBar;
    import java.awt.MenuShortcut;
    import java.awt.Point;
    import java.awt.Rectangle;
    import java.awt.ScrollPane;
    import java.awt.SystemColor;
    import java.awt.font.TextAttribute;
    import com.googlecode.openbeans.ArrayPersistenceDelegate;
    import com.googlecode.openbeans.BeanInfo;
    import com.googlecode.openbeans.DefaultPersistenceDelegate;
    import com.googlecode.openbeans.ExceptionListener;
    import com.googlecode.openbeans.Expression;
    import com.googlecode.openbeans.Introspector;
    import com.googlecode.openbeans.NullPersistenceDelegate;
    import com.googlecode.openbeans.PersistenceDelegate;
    import com.googlecode.openbeans.ProxyPersistenceDelegate;
    import com.googlecode.openbeans.Statement;
    import java.lang.reflect.Field;
    import java.lang.reflect.Method;
    import java.lang.reflect.Proxy;
    import java.util.Collection;
    import java.util.Date;
    import java.util.Hashtable;
    import java.util.IdentityHashMap;
    import java.util.Map;
     
    import javax.swing.Box;
    import javax.swing.DefaultComboBoxModel;
    import javax.swing.JFrame;
    import javax.swing.JTabbedPane;
    import javax.swing.ToolTipManager;
     
    /**
     * The <code>Encoder</code>, together with <code>PersistenceDelegate</code> s,
     * can encode an object into a series of java statements. By executing these
     * statements, a new object can be created and it will has the same state as the
     * original object which has been passed to the encoder. Here "has the same
     * state" means the two objects are indistinguishable from their public API.
     * <p>
     * The <code>Encoder</code> and <code>PersistenceDelegate</code> s do this by
     * creating copies of the input object and all objects it references. The copy
     * process continues recursively util every object in the object graph has its
     * new copy and the new version has the same state as the old version. All
     * statements used to create those new objects and executed on them during the
     * process form the result of encoding.
     * </p>
     *
     */
    public class Encoder {
     
        private static final Hashtable<Class<?>, PersistenceDelegate> delegates = new Hashtable<Class<?>, PersistenceDelegate>();
     
        private static final DefaultPersistenceDelegate defaultPD = new DefaultPersistenceDelegate();
     
        private static final UtilCollectionsPersistenceDelegate utilCollectionsPD = new UtilCollectionsPersistenceDelegate();
     
        private static final ArrayPersistenceDelegate arrayPD = new ArrayPersistenceDelegate();
     
        private static final ProxyPersistenceDelegate proxyPD = new ProxyPersistenceDelegate();
     
        private static final NullPersistenceDelegate nullPD = new NullPersistenceDelegate();
     
        private static final ExceptionListener defaultExListener = new DefaultExceptionListener();
     
        private static class DefaultExceptionListener implements ExceptionListener {
     
            public void exceptionThrown(Exception exception) {
                System.err.println("Exception during encoding:" + exception); //$NON-NLS-1$
                System.err.println("Continue..."); //$NON-NLS-1$
            }
     
        }
     
        static {
            PersistenceDelegate ppd = new PrimitiveWrapperPersistenceDelegate();
            delegates.put(Boolean.class, ppd);
            delegates.put(Byte.class, ppd);
            delegates.put(Character.class, ppd);
            delegates.put(Double.class, ppd);
            delegates.put(Float.class, ppd);
            delegates.put(Integer.class, ppd);
            delegates.put(Long.class, ppd);
            delegates.put(Short.class, ppd);
     
            delegates.put(Class.class, new ClassPersistenceDelegate());
            delegates.put(Field.class, new FieldPersistenceDelegate());
            delegates.put(Method.class, new MethodPersistenceDelegate());
            delegates.put(String.class, new StringPersistenceDelegate());
            delegates.put(Proxy.class, new ProxyPersistenceDelegate());
     
            delegates.put(Choice.class, new AwtChoicePersistenceDelegate());
            delegates.put(Color.class, new AwtColorPersistenceDelegate());
            delegates.put(Container.class, new AwtContainerPersistenceDelegate());
            delegates.put(Component.class, new AwtComponentPersistenceDelegate());
            delegates.put(Cursor.class, new AwtCursorPersistenceDelegate());
            delegates.put(Dimension.class, new AwtDimensionPersistenceDelegate());
            delegates.put(Font.class, new AwtFontPersistenceDelegate());
            delegates.put(Insets.class, new AwtInsetsPersistenceDelegate());
            delegates.put(List.class, new AwtListPersistenceDelegate());
            delegates.put(Menu.class, new AwtMenuPersistenceDelegate());
            delegates.put(MenuBar.class, new AwtMenuBarPersistenceDelegate());
            delegates.put(MenuShortcut.class,
                    new AwtMenuShortcutPersistenceDelegate());
            delegates.put(Point.class, new AwtPointPersistenceDelegate());
            delegates.put(Rectangle.class, new AwtRectanglePersistenceDelegate());
            delegates.put(SystemColor.class,
                    new AwtSystemColorPersistenceDelegate());
            delegates.put(TextAttribute.class,
                    new AwtFontTextAttributePersistenceDelegate());
     
            delegates.put(Box.class, new SwingBoxPersistenceDelegate());
            delegates.put(JFrame.class, new SwingJFramePersistenceDelegate());
            delegates.put(JTabbedPane.class,
                    new SwingJTabbedPanePersistenceDelegate());
            delegates.put(DefaultComboBoxModel.class,
                    new SwingDefaultComboBoxModelPersistenceDelegate());
            delegates.put(ToolTipManager.class,
                    new SwingToolTipManagerPersistenceDelegate());
            delegates.put(ScrollPane.class, new AwtScrollPanePersistenceDelegate());
     
            delegates.put(Date.class, new UtilDatePersistenceDelegate());
     
            PersistenceDelegate pd = new UtilListPersistenceDelegate();
            delegates.put(java.util.List.class, pd);
            delegates.put(java.util.AbstractList.class, pd);
     
            pd = new UtilCollectionPersistenceDelegate();
            delegates.put(java.util.Collection.class, pd);
            delegates.put(java.util.AbstractCollection.class, pd);
     
            pd = new UtilMapPersistenceDelegate();
            delegates.put(java.util.Map.class, pd);
            delegates.put(java.util.AbstractMap.class, pd);
            delegates.put(java.util.Hashtable.class, pd);
        }
     
        private ExceptionListener listener = defaultExListener;
     
        private IdentityHashMap<Object, Object> oldNewMap = new IdentityHashMap<Object, Object>();
     
        /**
         * Construct a new encoder.
         */
        public Encoder() {
            super();
        }
     
        /**
         * Clear all the new objects have been created.
         */
        void clear() {
            oldNewMap.clear();
        }
     
        /**
         * Gets the new copy of the given old object.
         * <p>
         * Strings are special objects which have their new copy by default, so if
         * the old object is a string, it is returned directly.
         * </p>
         *
         * @param old
         *            an old object
         * @return the new copy of the given old object, or null if there is not
         *         one.
         */
        public Object get(Object old) {
            if (old == null || old.getClass() == String.class) {
                return old;
            }
            return oldNewMap.get(old);
        }
     
        /**
         * Returns the exception listener of this encoder.
         * <p>
         * An encoder always have a non-null exception listener. A default exception
         * listener is used when the encoder is created.
         * </p>
         *
         * @return the exception listener of this encoder
         */
        public ExceptionListener getExceptionListener() {
            return listener;
        }
     
        /**
         * Returns a <code>PersistenceDelegate</code> for the given class type.
         * <p>
         * The <code>PersistenceDelegate</code> is determined as following:
         * <ol>
         * <li>If a <code>PersistenceDelegate</code> has been registered by calling
         * <code>setPersistenceDelegate</code> for the given type, it is returned.</li>
         * <li>If the given type is an array class, a special
         * <code>PersistenceDelegate</code> for array types is returned.</li>
         * <li>If the given type is a proxy class, a special
         * <code>PersistenceDelegate</code> for proxy classes is returned.</li>
         * <li><code>Introspector</code> is used to check the bean descriptor value
         * "persistenceDelegate". If one is set, it is returned.</li>
         * <li>If none of the above applies, the
         * <code>DefaultPersistenceDelegate</code> is returned.</li>
         * </ol>
         * </p>
         *
         * @param type
         *            a class type
         * @return a <code>PersistenceDelegate</code> for the given class type
         */
        public PersistenceDelegate getPersistenceDelegate(Class<?> type) {
            if (type == null) {
                return nullPD; // may be return a special PD?
            }
     
            // registered delegate
            PersistenceDelegate registeredPD = delegates.get(type);
            if (registeredPD != null) {
                return registeredPD;
            }
     
            if (type.getName().startsWith(
                    UtilCollectionsPersistenceDelegate.CLASS_PREFIX)) {
                return utilCollectionsPD;
            }
     
            if (type.isArray()) {
                return arrayPD;
            }
     
            if (Proxy.isProxyClass(type)) {
                return proxyPD;
            }
     
            // check "persistenceDelegate" property
            try {
                BeanInfo beanInfo = Introspector.getBeanInfo(type);
                if (beanInfo != null) {
                    PersistenceDelegate pd = (PersistenceDelegate) beanInfo
                            .getBeanDescriptor().getValue("persistenceDelegate"); //$NON-NLS-1$
                    if (pd != null) {
                        return pd;
                    }
                }
            } catch (Exception e) {
                // Ignored
            }
     
            // default persistence delegate
            return defaultPD;
        }
     
        /**
         * Remove the existing new copy of the given old object.
         *
         * @param old
         *            an old object
         * @return the removed new version of the old object, or null if there is
         *         not one
         */
        public Object remove(Object old) {
            return oldNewMap.remove(old);
        }
     
        /**
         * Sets the exception listener of this encoder.
         *
         * @param listener
         *            the exception listener to set
         */
        public void setExceptionListener(ExceptionListener listener) {
            this.listener = listener == null ? defaultExListener : listener;
        }
     
        /**
         * Register the <code>PersistenceDelegate</code> of the specified type.
         *
         * @param type
         * @param delegate
         */
        public void setPersistenceDelegate(Class<?> type,
                PersistenceDelegate delegate) {
            if (type == null || delegate == null) {
                throw new NullPointerException();
            }
            delegates.put(type, delegate);
        }
     
        Object expressionValue(Expression exp) {
            try {
                return exp == null ? null : exp.getValue();
            } catch (IndexOutOfBoundsException e) {
                return null;
            } catch (Exception e) {
                listener.exceptionThrown(new Exception(
                        "failed to excute expression: " + exp, e)); //$NON-NLS-1$
            }
            return null;
        }
     
        private Statement createNewStatement(Statement oldStat) {
            Object newTarget = createNewObject(oldStat.getTarget());
            Object[] oldArgs = oldStat.getArguments();
            Object[] newArgs = new Object[oldArgs.length];
            for (int index = 0; index < oldArgs.length; index++) {
                newArgs[index] = createNewObject(oldArgs[index]);
            }
     
            if (oldStat.getClass() == Expression.class) {
                return new Expression(newTarget, oldStat.getMethodName(), newArgs);
            } else {
                return new Statement(newTarget, oldStat.getMethodName(), newArgs);
            }
        }
     
        private Object createNewObject(Object old) {
            Object nu = get(old);
            if (nu == null) {
                writeObject(old);
                nu = get(old);
            }
            return nu;
        }
     
        /**
         * Write an expression of old objects.
         * <p>
         * The implementation first check the return value of the expression. If
         * there exists a new version of the object, simply return.
         * </p>
         * <p>
         * A new expression is created using the new versions of the target and the
         * arguments. If any of the old objects do not have its new version yet,
         * <code>writeObject()</code> is called to create the new version.
         * </p>
         * <p>
         * The new expression is then executed to obtained a new copy of the old
         * return value.
         * </p>
         * <p>
         * Call <code>writeObject()</code> with the old return value, so that more
         * statements will be executed on its new version to change it into the same
         * state as the old value.
         * </p>
         *
         * @param oldExp
         *            the expression to write. The target, arguments, and return
         *            value of the expression are all old objects.
         */
        public void writeExpression(Expression oldExp) {
            if (oldExp == null) {
                throw new NullPointerException();
            }
            try {
                // if oldValue exists, no operation
                Object oldValue = expressionValue(oldExp);
                if (oldValue == null || get(oldValue) != null) {
                    return;
                }
     
                // copy to newExp
                Expression newExp = (Expression) createNewStatement(oldExp);
                // relate oldValue to newValue
                try {
                    oldNewMap.put(oldValue, newExp.getValue());
                } catch (IndexOutOfBoundsException e) {
                    // container does not have any component, set newVal null
                }
     
                // force same state
                writeObject(oldValue);
            } catch (Exception e) {
                listener.exceptionThrown(new Exception(
                        "failed to write expression: " + oldExp, e)); //$NON-NLS-1$
            }
        }
     
        /**
         * Encode the given object into a series of statements and expressions.
         * <p>
         * The implementation simply finds the <code>PersistenceDelegate</code>
         * responsible for the object's class, and delegate the call to it.
         * </p>
         *
         * @param o
         *            the object to encode
         */
        protected void writeObject(Object o) {
            if (o == null) {
                return;
            }
            getPersistenceDelegate(o.getClass()).writeObject(o, this);
        }
     
        /**
         * Write a statement of old objects.
         * <p>
         * A new statement is created by using the new versions of the target and
         * arguments. If any of the objects do not have its new copy yet,
         * <code>writeObject()</code> is called to create one.
         * </p>
         * <p>
         * The new statement is then executed to change the state of the new object.
         * </p>
         *
         * @param oldStat
         *            a statement of old objects
         */
        public void writeStatement(Statement oldStat) {
            if (oldStat == null) {
                throw new NullPointerException();
            }
            Statement newStat = createNewStatement(oldStat);
            try {
                // execute newStat
                newStat.execute();
            } catch (Exception e) {
                listener.exceptionThrown(new Exception(
                        "failed to write statement: " + oldStat, e)); //$NON-NLS-1$
            }
        }
    }

    On remarque au niveau des import ces suites de classes :

    Code Java : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    import java.awt.Choice;
    import java.awt.Color;
    import java.awt.Component;
    import java.awt.Container;
    import java.awt.Cursor;
    import java.awt.Dimension;
    import java.awt.Font;
    import java.awt.Insets;
    import java.awt.List;
    import java.awt.Menu;
    import java.awt.MenuBar;
    import java.awt.MenuShortcut;
    import java.awt.Point;
    import java.awt.Rectangle;
    import java.awt.ScrollPane;
    import java.awt.SystemColor;
    import java.awt.font.TextAttribute;
    [...]
    import javax.swing.Box;
    import javax.swing.DefaultComboBoxModel;
    import javax.swing.JFrame;
    import javax.swing.JTabbedPane;
    import javax.swing.ToolTipManager;

    Note : source du code : https://code.google.com/p/openbeans/...9d1ff014cad1e6

    Ces classes et packages n'existent pas sous Android.

    De ce que je lis, openbeans est un repackaging de java.beans pour Android. Manifestement, les personnes ayant réalisées ce projet ont oubliées cette classe à minima. A part ne pas l'utiliser (si ça compile sans, ce qui m'étonnerai, mais sait-on jamais) ou faire un ticket sur leur bug tracker, je ne vois pas trop quoi faire. Vu que le projet ne contient qu'un seul commit "initial import" datant de 2011, ça me paraît compromis.
    C'est Android, PAS Androïd, ou Androïde didiou !
    Le premier est un OS, le second est la mauvaise orthographe du troisième, un mot français désignant un robot à forme humaine.

    Membre du comité contre la phrase "ça marche PAS" en titre et/ou explication de problème.

    N'oubliez pas de consulter les FAQ Android et les cours et tutoriels Android

  3. #3
    Nouveau membre du Club
    Homme Profil pro
    Retraité
    Inscrit en
    Février 2009
    Messages
    21
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Loire Atlantique (Pays de la Loire)

    Informations professionnelles :
    Activité : Retraité
    Secteur : Enseignement

    Informations forums :
    Inscription : Février 2009
    Messages : 21
    Points : 30
    Points
    30
    Par défaut Résolu ?
    Merci Hizin de ta rapide et intelligente réaction.
    Je suis parti en confiance sans creuser et persuadé d'une erreur de ma part.
    C'est posté à l'adresse :
    https://code.google.com/p/android/is...&ts=1422901998

    Je te laisse la responsabilité de classer en "Résolu"

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Liaison a webservice mais ne trouve pas bibliothèque
    Par luxior dans le forum Services Web
    Réponses: 7
    Dernier message: 14/10/2011, 12h03
  2. L'autocomplétion marche mais ne trouve pas de contenu
    Par manudwarf dans le forum Eclipse Java
    Réponses: 2
    Dernier message: 28/05/2009, 13h04
  3. PopUp marche sans GET mais ne trouve pas la page avec GET
    Par Orbiplanax dans le forum Général JavaScript
    Réponses: 11
    Dernier message: 20/12/2008, 13h01
  4. Réponses: 2
    Dernier message: 12/09/2007, 21h47
  5. With // Je cherche mais ne trouve pas
    Par cm16 dans le forum VB 6 et antérieur
    Réponses: 4
    Dernier message: 10/05/2007, 20h44

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo