банка xstream в gwt

I downloaded xstream jar and sourcecode and append the sourcecode into jar file using winrar

и я создал 2 gwt.xml файла.

xstream.gwt.xml присутствует в com.thoughtworks

<?xml version="1.0" encoding="UTF-8"?> 
 
 

и operations.gwt.xml присутствует в com.thoughworks.xstream

<?xml version="1.0" encoding="UTF-8"?> 
 
 
 
 
 
 
 

Отредактированный: его мой gwt проект xml

<?xml version="1.0" encoding="UTF-8"?>

  
  
  
  

но я получил ошибку

Compiling module com.example.test.Test
   Validating newly compiled units
      Ignored 142 units with compilation errors in first pass.
Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.
   [ERROR] Errors in 'jar:file:/C:/Users/YRC/Downloads/xstream-1.4.4.jar!/com/thoughtworks/xstream/XStream.java'
      [ERROR] Line 499:  The method forName(String, boolean, ClassLoader) is undefined for the type Class
      [ERROR] Line 500:  The method getConstructor(Class[]) is undefined for the type Class
      [ERROR] Line 764:  The method forName(String, boolean, ClassLoader) is undefined for the type Class
      [ERROR] Line 765:  The method getConstructor(Class[]) is undefined for the type Class
      [ERROR] Line 1062:  The method getPackage() is undefined for the type Class
   [ERROR] Errors in 'jar:file:/C:/Users/YRC/Downloads/xstream-1.4.4.jar!/com/thoughtworks/xstream/converters/basic/NullConverter.java'
      [ERROR] Line 30:  The method isAssignableFrom(Class) is undefined for the type Class
   [ERROR] Errors in 'jar:file:/C:/Users/YRC/Downloads/xstream-1.4.4.jar!/com/thoughtworks/xstream/converters/basic/StringConverter.java'
      [ERROR] Line 73:  The method synchronizedMap(WeakCache) is undefined for the type Collections
   [ERROR] Errors in 'jar:file:/C:/Users/YRC/Downloads/xstream-1.4.4.jar!/com/thoughtworks/xstream/converters/collections/AbstractCollectionConverter.java'
      [ERROR] Line 77:  The method newInstance() is undefined for the type Class
   [ERROR] Errors in 'jar:file:/C:/Users/YRC/Downloads/xstream-1.4.4.jar!/com/thoughtworks/xstream/converters/collections/TreeMapConverter.java'
      [ERROR] Line 54:  The method getDeclaredFields() is undefined for the type Class<treeMap>
   [ERROR] Errors in 'jar:file:/C:/Users/YRC/Downloads/xstream-1.4.4.jar!/com/thoughtworks/xstream/converters/collections/TreeSetConverter.java'
      [ERROR] Line 48:  The method getDeclaredFields() is undefined for the type Class<treeSet>
      [ERROR] Line 50:  The method isAssignableFrom(Class
   [ERROR] Errors in 'jar:file:/C:/Users/YRC/Downloads/xstream-1.4.4.jar!/com/thoughtworks/xstream/converters/extended/DynamicProxyConverter.java'
      [ERROR] Line 51:  The method getDeclaredField(String) is undefined for the type Class
      [ERROR] Line 60:  The method getClassLoader() is undefined for the type Class
      [ERROR] Line 85:  The method getInterfaces() is undefined for the type Class
   [ERROR] Errors in 'jar:file:/C:/Users/YRC/Downloads/xstream-1.4.4.jar!/com/thoughtworks/xstream/converters/extended/JavaClassConverter.java'
      [ERROR] Line 61:  The method getClassLoader() is undefined for the type Class
   [ERROR] Errors in 'jar:file:/C:/Users/YRC/Downloads/xstream-1.4.4.jar!/com/thoughtworks/xstream/converters/reflection/AbstractReflectionConverter.java'
      [ERROR] Line 271:  The method isAssignableFrom(Class) is undefined for the type Class
      [ERROR] Line 326:  The method isAssignableFrom(Class) is undefined for the type Class
      [ERROR] Line 378:  The method isAssignableFrom(Class) is undefined for the type Class
      [ERROR] Line 378:  The method isAssignableFrom(Class) is undefined for the type Class
   [ERROR] Errors in 'jar:file:/C:/Users/YRC/Downloads/xstream-1.4.4.jar!/com/thoughtworks/xstream/converters/reflection/AbstractAttributedCharacterIteratorAttributeConverter.java'
      [ERROR] Line 38:  The method getDeclaredMethod(String, Class[]) is undefined for the type Class
   [ERROR] Errors in 'jar:file:/C:/Users/YRC/Downloads/xstream-1.4.4.jar!/com/thoughtworks/xstream/converters/reflection/ExternalizableConverter.java'
      [ERROR] Line 58:  The method isAssignableFrom(Class) is undefined for the type Class
      [ERROR] Line 104:  The method getDeclaredConstructor(Class[]) is undefined for the type Class
   [ERROR] Errors in 'jar:file:/C:/Users/YRC/Downloads/xstream-1.4.4.jar!/com/thoughtworks/xstream/converters/reflection/SerializableConverter.java'
      [ERROR] Line 90:  The method isAssignableFrom(Class) is undefined for the type Class
      [ERROR] Line 214:  The method isAssignableFrom(Class) is undefined for the type Class
      [ERROR] Line 271:  The method getDeclaredField(String) is undefined for the type Class
      [ERROR] Line 462:  The method isAssignableFrom(Class) is undefined for the type Class
   [ERROR] Errors in 'jar:file:/C:/Users/YRC/Downloads/xstream-1.4.4.jar!/com/thoughtworks/xstream/core/DefaultConverterLookup.java'
      [ERROR] Line 37:  The method synchronizedMap(WeakHashMap) is undefined for the type Collections
      [ERROR] Line 86:  The method synchronizedMap(HashMap) is undefined for the type Collections
   [ERROR] Errors in 'jar:file:/C:/Users/YRC/Downloads/xstream-1.4.4.jar!/com/thoughtworks/xstream/core/JVM.java'
      [ERROR] Line 46:  The method getProperty(String) is undefined for the type System
      [ERROR] Line 94:  The method getProperty(String) is undefined for the type System
      [ERROR] Line 185:  The method getProperty(String) is undefined for the type System
      [ERROR] Line 199:  The method getProperty(String) is undefined for the type System
      [ERROR] Line 231:  The method getClassLoader() is undefined for the type Class
      [ERROR] Line 251:  The method newInstance() is undefined for the type Class
      [ERROR] Line 342:  The method getDeclaredFields() is undefined for the type Class
      [ERROR] Line 350:  The method getDeclaredFields() is undefined for the type Class
      [ERROR] Line 361:  The method getProperty(String) is undefined for the type System
   [ERROR] Errors in 'jar:file:/C:/Users/YRC/Downloads/xstream-1.4.4.jar!/com/thoughtworks/xstream/core/util/CompositeClassLoader.java'
      [ERROR] Line 57:  The method getClassLoader() is undefined for the type Class
      [ERROR] Line 58:  The method getClassLoader() is undefined for the type Class
   [ERROR] Errors in 'jar:file:/C:/Users/YRC/Downloads/xstream-1.4.4.jar!/com/thoughtworks/xstream/core/util/CustomObjectInputStream.java'
      [ERROR] Line 95:  The method forName(String, boolean, ClassLoader) is undefined for the type Class
   [ERROR] Errors in 'jar:file:/C:/Users/YRC/Downloads/xstream-1.4.4.jar!/com/thoughtworks/xstream/io/xml/XppDriver.java'
      [ERROR] Line 18:  The import org.xmlpull cannot be resolved
      [ERROR] Line 19:  The import org.xmlpull cannot be resolved
      [ERROR] Line 20:  The import org.xmlpull cannot be resolved
      [ERROR] Line 31:  XmlPullParserFactory cannot be resolved to a type
      [ERROR] Line 55:  XmlPullParser cannot be resolved to a type
      [ERROR] Line 55:  XmlPullParserException cannot be resolved to a type
      [ERROR] Line 56:  XmlPullParserFactory cannot be resolved to a type
      [ERROR] Line 57:  XmlPullParserFactory cannot be resolved to a type
      [ERROR] Line 57:  XmlPullParserFactory cannot be resolved
      [ERROR] Line 59:  XmlPullParserFactory cannot be resolved to a type
   [ERROR] Errors in 'jar:file:/C:/Users/YRC/Downloads/xstream-1.4.4.jar!/com/thoughtworks/xstream/io/xml/AbstractXppDriver.java'
      [ERROR] Line 19:  The import org.xmlpull cannot be resolved
      [ERROR] Line 20:  The import org.xmlpull cannot be resolved
      [ERROR] Line 54:  The method createParser() from the type AbstractXppDriver refers to the missing type XmlPullParser
      [ERROR] Line 55:  XmlPullParserException cannot be resolved to a type
      [ERROR] Line 93:  XmlPullParser cannot be resolved to a type
      [ERROR] Line 93:  XmlPullParserException cannot be resolved to a type
   [ERROR] Errors in 'jar:file:/C:/Users/YRC/Downloads/xstream-1.4.4.jar!/com/thoughtworks/xstream/mapper/MapperWrapper.java'
      [ERROR] Line 103:  The method isAssignableFrom(Class) is undefined for the type Class
   [ERROR] Errors in 'jar:file:/C:/Users/YRC/Downloads/xstream-1.4.4.jar!/com/thoughtworks/xstream/mapper/CachingMapper.java'
      [ERROR] Line 55:  The method synchronizedMap(HashMap) is undefined for the type Collections
   [ERROR] Errors in 'jar:file:/C:/Users/YRC/Downloads/xstream-1.4.4.jar!/com/thoughtworks/xstream/mapper/ClassAliasingMapper.java'
      [ERROR] Line 60:  The method isAssignableFrom(Class) is undefined for the type Class
   [ERROR] Errors in 'jar:file:/C:/Users/YRC/Downloads/xstream-1.4.4.jar!/com/thoughtworks/xstream/mapper/DefaultMapper.java'
      [ERROR] Line 47:  The method getClassLoader() is undefined for the type Class
      [ERROR] Line 51:  The method forName(String, boolean, ClassLoader) is undefined for the type Class
      [ERROR] Line 53:  The method forName(String) is undefined for the type Class
   [ERROR] Errors in 'jar:file:/C:/Users/YRC/Downloads/xstream-1.4.4.jar!/com/thoughtworks/xstream/mapper/ImplicitCollectionMapper.java'
      [ERROR] Line 97:  The method getDeclaredField(String) is undefined for the type Class
      [ERROR] Line 110:  The method isAssignableFrom(Class
      [ERROR] Line 114:  The method isAssignableFrom(Class
      [ERROR] Line 127:  The method isAssignableFrom(Class) is undefined for the type Class
      [ERROR] Line 162:  The method isAssignableFrom(Class) is undefined for the type Class
   [ERROR] Errors in 'jar:file:/C:/Users/YRC/Downloads/xstream-1.4.4.jar!/com/thoughtworks/xstream/core/util/Fields.java'
      [ERROR] Line 27:  The method getDeclaredField(String) is undefined for the type Class
   [ERROR] Errors in 'jar:file:/C:/Users/YRC/Downloads/xstream-1.4.4.jar!/com/thoughtworks/xstream/core/util/Primitives.java'
      [ERROR] Line 30:  Byte.TYPE cannot be resolved
      [ERROR] Line 32:  Short.TYPE cannot be resolved
      [ERROR] Line 33:  Integer.TYPE cannot be resolved
      [ERROR] Line 34:  Long.TYPE cannot be resolved
      [ERROR] Line 35:  Float.TYPE cannot be resolved
      [ERROR] Line 36:  Double.TYPE cannot be resolved
      [ERROR] Line 37:  Boolean.TYPE cannot be resolved
      [ERROR] Line 38:  Void.TYPE cannot be resolved
   [ERROR] Errors in 'jar:file:/C:/Users/YRC/Downloads/xstream-1.4.4.jar!/com/thoughtworks/xstream/converters/reflection/SerializationMethodInvoker.java'
      [ERROR] Line 40:  The method getDeclaredMethods() is undefined for the type Class
      [ERROR] Line 48:  The method synchronizedMap(HashMap) is undefined for the type Collections
      [ERROR] Line 161:  The method getDeclaredMethod(String, Class[]) is undefined for the type Class
   [ERROR] Errors in 'jar:file:/C:/Users/YRC/Downloads/xstream-1.4.4.jar!/com/thoughtworks/xstream/converters/reflection/PureJavaReflectionProvider.java'
      [ERROR] Line 58:  The method getDeclaredConstructors() is undefined for the type Class
      [ERROR] Line 68:  The method isAssignableFrom(Class) is undefined for the type Class
      [ERROR] Line 113:  The method getClassLoader() is undefined for the type Class
   [ERROR] Errors in 'jar:file:/C:/Users/YRC/Downloads/xstream-1.4.4.jar!/com/thoughtworks/xstream/converters/reflection/FieldDictionary.java'
      [ERROR] Line 136:  The method getDeclaredFields() is undefined for the type Class
   [ERROR] Errors in 'jar:file:/C:/Users/YRC/Downloads/xstream-1.4.4.jar!/com/thoughtworks/xstream/io/xml/XmlFriendlyNameCoder.java'
      [ERROR] Line 278:  The method clone() is undefined for the type Object
   [ERROR] Errors in 'jar:file:/C:/Users/YRC/Downloads/xstream-1.4.4.jar!/com/thoughtworks/xstream/core/util/XmlHeaderAwareReader.java'
      [ERROR] Line 100:  The method isWhitespace(char) is undefined for the type Character
      [ERROR] Line 109:  The method isWhitespace(char) is undefined for the type Character
      [ERROR] Line 124:  The method isWhitespace(char) is undefined for the type Character
   [ERROR] Errors in 'jar:file:/C:/Users/YRC/Downloads/xstream-1.4.4.jar!/com/thoughtworks/xstream/io/xml/XppReader.java'
      [ERROR] Line 17:  The import org.xmlpull cannot be resolved
      [ERROR] Line 18:  The import org.xmlpull cannot be resolved
      [ERROR] Line 32:  XmlPullParser cannot be resolved to a type
      [ERROR] Line 42:  XmlPullParser cannot be resolved to a type
      [ERROR] Line 54:  XmlPullParser cannot be resolved to a type
      [ERROR] Line 56:  XmlPullParser cannot be resolved to a type
      [ERROR] Line 60:  XmlPullParserException cannot be resolved to a type
      [ERROR] Line 80:  XmlPullParser cannot be resolved to a type
      [ERROR] Line 80:  The method createParser() from the type XppReader refers to the missing type XmlPullParser
      [ERROR] Line 82:  XmlPullParser cannot be resolved to a type
      [ERROR] Line 84:  XmlPullParserException cannot be resolved to a type
      [ERROR] Line 93:  XmlPullParser cannot be resolved to a type
      [ERROR] Line 96:  XmlPullParser cannot be resolved to a type
      [ERROR] Line 96:  XmlPullParser cannot be resolved to a type
      [ERROR] Line 96:  Class cannot be resolved to a type
      [ERROR] Line 109:  XmlPullParser cannot be resolved to a type
      [ERROR] Line 110:  XmlPullParser cannot be resolved
      [ERROR] Line 111:  XmlPullParser cannot be resolved
      [ERROR] Line 113:  XmlPullParser cannot be resolved
      [ERROR] Line 114:  XmlPullParser cannot be resolved
      [ERROR] Line 116:  XmlPullParser cannot be resolved
      [ERROR] Line 118:  XmlPullParser cannot be resolved
      [ERROR] Line 123:  XmlPullParserException cannot be resolved to a type
      [ERROR] Line 131:  XmlPullParser cannot be resolved to a type
      [ERROR] Line 135:  XmlPullParser cannot be resolved to a type
      [ERROR] Line 139:  XmlPullParser cannot be resolved to a type
      [ERROR] Line 143:  XmlPullParser cannot be resolved to a type
      [ERROR] Line 147:  XmlPullParser cannot be resolved to a type
      [ERROR] Line 151:  XmlPullParser cannot be resolved to a type
      [ERROR] Line 155:  XmlPullParser cannot be resolved to a type
   [ERROR] Errors in 'jar:file:/C:/Users/YRC/Downloads/xstream-1.4.4.jar!/com/thoughtworks/xstream/io/xml/PrettyPrintWriter.java'
      [ERROR] Line 267:  The method isDefined(char) is undefined for the type Character
      [ERROR] Line 267:  The method isISOControl(char) is undefined for the type Character
   [ERROR] Errors in 'jar:file:/C:/Users/YRC/Downloads/xstream-1.4.4.jar!/com/thoughtworks/xstream/core/util/Pool.java'
      [ERROR] Line 49:  The method wait() is undefined for the type Object
      [ERROR] Line 68:  The method notify() is undefined for the type Object
   [ERROR] Errors in 'jar:file:/C:/Users/YRC/Downloads/xstream-1.4.4.jar!/com/thoughtworks/xstream/core/util/Cloneables.java'
      [ERROR] Line 32:  Cannot invoke clone() on the array type Object[]
      [ERROR] Line 44:  The method getMethod(String, Class[]) is undefined for the type Class
   [ERROR] Cannot proceed due to previous errors




1
nl ja de
Ошибки в ' jar:file:/C:/Users/YRC/Downloads/xstream-1.4.4.jar!/com/tho‌ ​ ughtworks/xstream/XS‌ ​ tream.java' вы открыли файл Xstream.java?? какие-либо ошибки?
добавлено автор ꜱᴜʀᴇꜱʜ ᴀᴛᴛᴀ, источник
добавьте .gwt.xml код файла также
добавлено автор Parvathy, источник
@Bucks теперь у вас есть исходный поток. так откройте его в новом prjt в затмении или netbeans и найдите ошибку. этому, возможно, понадобится другая банка. и gwt не поддерживает все банки. Я открыл его, я видел Файл. но мы наклоняем Файл использования в клиентской стороне. Так используйте его в серверной стороне
добавлено автор Parvathy, источник
добавлено автор Thomas Broyer, источник
@Parvathy может вы, пожалуйста, связывать любой пример для использования этого в серверной стороне
добавлено автор Bucks, источник

2 ответы

Вы не можете использовать отражение в GWT;

  • getDeclaredFields

  • getDeclaredMethod

  • forName

  • getConstructor

и подобные... - все рефлексивные требования;

3
добавлено

GWt not supporting all code in client side so we can use it in server. GWT supporting RPC. http://www.vogella.com/articles/GWT/article.html or refer https://developers.google.com/web-toolkit/doc/latest/DevGuideServerCommunication

то, что необходимо сделать, включают всю банку в lib и формируют, строят путь и только используют этот код в серверной стороне.

0
добавлено