I've got a package that is trying to use:
com.sun.org.apache.xerces.internal.impl.dv.util.Base64
Is there an alternative that is in the Fedora java implementation?
On Fri, 2008-05-23 at 14:21 -0600, Orion Poplawski wrote:
I've got a package that is trying to use:
com.sun.org.apache.xerces.internal.impl.dv.util.Base64
Is there an alternative that is in the Fedora java implementation?
jakarta-commons-codec
http://commons.apache.org/codec/apidocs/org/apache/commons/codec/binary/Base... ________________________________________ Robert Marcano
web: http://www.marcanoonline.com/ gpg --keyserver hkp://pgp.mit.edu/ --recv-key 72A0DCFD
Robert Marcano wrote:
jakarta-commons-codec
http://commons.apache.org/codec/apidocs/org/apache/commons/codec/binary/Base...
Great, thanks!
Now to get a java neophyte like myself to be able to use it. I'm trying to specify the location in the main build.xml file (no idea if this is how to do it):
<macrodef name="myant"> <attribute name="target" default=""/> <!-- attribute name="args" default="${sge.ant.args}"/ --> <attribute name="dir" default="${basedir}"/> <sequential> <echo>myant: Doing target="@{target}" on directory "@{dir}"</echo> <java classname="org.apache.tools.ant.launch.Launcher" fork="true" failonerror="true" dir="@{dir}"> <jvmarg value="-Djava.compiler=none"/> <classpath> <pathelement path="${java.class.path}"/> <pathelement location="${libs.junit.classpath}"/> <pathelement location="/usr/share/java/commons-codec.jar"/> </classpath> <!-- arg line="@{args} @{target}"/ --> <arg line="@{target}"/> </java> </sequential> </macrodef>
but it doesn't seem to take:
[java] [javac] 1. ERROR in /export/home/orion/fedora/gridengine/devel/gridengine/source/libs/juti/java/com/sun/grid/security/login/GECATrustManagerLoginModule.java (at line 35) [java] [javac] import org.apache.commons.codec.binary.Base64; [java] [javac] ^^^^^^^^^^ [java] [javac] The import org.apache cannot be resolved
Thoughts?
Robert Marcano wrote:
jakarta-commons-codec
http://commons.apache.org/codec/apidocs/org/apache/commons/codec/binary/Base...
Finally figured out where to add the path, but it looks like it's not a drop in replacement for the com.sun class:
[java] [javac] Compiling 1 source file to /export/home/orion/fedora/gridengine/devel/gridengine/source/CLASSES/juti/classes [java] [javac] ---------- [java] [javac] 1. ERROR in /export/home/orion/fedora/gridengine/devel/gridengine/source/libs/juti/java/com/sun/grid/security/login/GECATrustManagerLoginModule.java (at line 203) [java] [javac] byte[] message = Base64.decode(messa [java] [javac] geStr); [java] [javac] ^^^^^^^^^^^^^^^^^^^^^^^^^ [java] [javac] Cannot make a static reference to the non-static method decode(Object) from the type Base64 [java] [javac] ---------- [java] [javac] 2. ERROR in /export/home/orion/fedora/gridengine/devel/gridengine/source/libs/juti/java/com/sun/grid/security/login/GECATrustManagerLoginModule.java (at line 203) [java] [javac] byte[] message = Base64.decode(messa [java] [javac] geStr); [java] [javac] ^^^^^^^^^^^^^^^^^^^^^^^^^ [java] [javac] Type mismatch: cannot convert from Object to byte[] [java] [javac] ---------- [java] [javac] 3. ERROR in /export/home/orion/fedora/gridengine/devel/gridengine/source/libs/juti/java/com/sun/grid [java] [javac] /security/login/GECATrustManagerLoginModule.java (at line 210) [java] [javac] byte[] signature = Base64.decode(signatureStr); [java] [javac] ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [java] [javac] Cannot make a static reference to the non-static method decode(Object) from the type Base64 [java] [javac] ---------- [java] [javac] 4. ERROR in /export/home/orion/fedora/gridengine/devel/gridengine/source/libs/juti/java/com/sun/grid [java] [javac] /security/login/GECATrustManagerLoginModule.java (at line 210) [java] [javac] byte[] signature = Base64.decode(signatureStr); [java] [javac] ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [java] [javac] Type mismatch: cannot convert from Object to byte[] [java] [javac] ---------- [java] [javac] 4 problems (4 errors)
On Fri, 2008-05-23 at 16:09 -0600, Orion Poplawski wrote:
Robert Marcano wrote:
jakarta-commons-codec
http://commons.apache.org/codec/apidocs/org/apache/commons/codec/binary/Base...
Ohh sorry, but I am not sure you will find a drop in replacement, the commons-codec version does not convert to Strings always works with byte arrays, but you can change a little the code, for example
// sun code String encodedData = Base64.encode(data);
// new code String encodedData = null; try { encodedData = new String(Base64.encodeBase64(data), "UTF-8"); } catch (UnsupportedEncodingException e) { // can not happen, UTF-8 is always supported }
Hope this helps
Finally figured out where to add the path, but it looks like it's not a drop in replacement for the com.sun class:
[java] [javac] Compiling 1 source file to
/export/home/orion/fedora/gridengine/devel/gridengine/source/CLASSES/juti/classes [java] [javac] ---------- [java] [javac] 1. ERROR in /export/home/orion/fedora/gridengine/devel/gridengine/source/libs/juti/java/com/sun/grid/security/login/GECATrustManagerLoginModule.java (at line 203) [java] [javac] byte[] message = Base64.decode(messa [java] [javac] geStr); [java] [javac] ^^^^^^^^^^^^^^^^^^^^^^^^^ [java] [javac] Cannot make a static reference to the non-static method decode(Object) from the type Base64 [java] [javac] ---------- [java] [javac] 2. ERROR in /export/home/orion/fedora/gridengine/devel/gridengine/source/libs/juti/java/com/sun/grid/security/login/GECATrustManagerLoginModule.java (at line 203) [java] [javac] byte[] message = Base64.decode(messa [java] [javac] geStr); [java] [javac] ^^^^^^^^^^^^^^^^^^^^^^^^^ [java] [javac] Type mismatch: cannot convert from Object to byte[] [java] [javac] ---------- [java] [javac] 3. ERROR in /export/home/orion/fedora/gridengine/devel/gridengine/source/libs/juti/java/com/sun/grid [java] [javac] /security/login/GECATrustManagerLoginModule.java (at line 210) [java] [javac] byte[] signature = Base64.decode(signatureStr); [java] [javac] ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [java] [javac] Cannot make a static reference to the non-static method decode(Object) from the type Base64 [java] [javac] ---------- [java] [javac] 4. ERROR in /export/home/orion/fedora/gridengine/devel/gridengine/source/libs/juti/java/com/sun/grid [java] [javac] /security/login/GECATrustManagerLoginModule.java (at line 210) [java] [javac] byte[] signature = Base64.decode(signatureStr); [java] [javac] ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [java] [javac] Type mismatch: cannot convert from Object to byte[] [java] [javac] ---------- [java] [javac] 4 problems (4 errors)
________________________________________ Robert Marcano
web: http://www.marcanoonline.com/ gpg --keyserver hkp://pgp.mit.edu/ --recv-key 72A0DCFD
java-devel@lists.fedoraproject.org