FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Development Java

 
 
LinkBack Thread Tools
 
Old 05-23-2008, 08:43 PM
Robert Marcano
 
Default Alternative to com.sun class

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.Ba se64
>
> 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/Base64.html
________________________________________
Robert Marcano

web: http://www.marcanoonline.com/
gpg --keyserver hkp://pgp.mit.edu/ --recv-key 72A0DCFD



--
fedora-devel-java-list mailing list
fedora-devel-java-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-java-list
 
Old 05-23-2008, 09:35 PM
Orion Poplawski
 
Default Alternative to com.sun class

Robert Marcano wrote:

jakarta-commons-codec

http://commons.apache.org/codec/apidocs/org/apache/commons/codec/binary/Base64.html


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?

--
Orion Poplawski
Technical Manager 303-415-9701 x222
NWRA/CoRA Division FAX: 303-415-9702
3380 Mitchell Lane orion@cora.nwra.com
Boulder, CO 80301 http://www.cora.nwra.com

--
fedora-devel-java-list mailing list
fedora-devel-java-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-java-list
 
Old 05-23-2008, 10:09 PM
Orion Poplawski
 
Default Alternative to com.sun class

Robert Marcano wrote:

jakarta-commons-codec

http://commons.apache.org/codec/apidocs/org/apache/commons/codec/binary/Base64.html



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)

--
Orion Poplawski
Technical Manager 303-415-9701 x222
NWRA/CoRA Division FAX: 303-415-9702
3380 Mitchell Lane orion@cora.nwra.com
Boulder, CO 80301 http://www.cora.nwra.com

--
fedora-devel-java-list mailing list
fedora-devel-java-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-java-list
 
Old 05-24-2008, 04:09 PM
Robert Marcano
 
Default Alternative to com.sun class

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/Base64.html
>

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



--
fedora-devel-java-list mailing list
fedora-devel-java-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-java-list
 

Thread Tools




All times are GMT. The time now is 11:51 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org