Apache classes not building corrrectly in project

2 views
Skip to first unread message

Aric - On Demand Programmers Of America .: www.odpoa.com :.

unread,
Feb 10, 2009, 12:48:53 PM2/10/09
to PulpCore
When I integrate the XML-RPC classes into my project, I keep getting
this recursive error. I don't know whats wrong.

jar:
Building jar: G:\BonAppetit\build\applet\BonAppetit-1.0.jar
retroweave:
Copying 1 file to G:\BonAppetit\build\applet
Processing 662 classes
java.util.zip.ZipException: duplicate entry: META-INF/LICENSE
at java.util.zip.ZipOutputStream.putNextEntry
(ZipOutputStream.java:175)
at java.util.jar.JarOutputStream.putNextEntry
(JarOutputStream.java:92)
at net.sourceforge.retroweaver.RetroWeaver.weaveJarFile
(RetroWeaver.java:216)
at net.sourceforge.retroweaver.ant.RetroWeaverTask.execute
(RetroWeaverTask.java:381)
at org.apache.tools.ant.UnknownElement.execute
(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor119.invoke(Unknown
Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute
(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets
(Project.java:1337)
at org.apache.tools.ant.Project.executeTarget(Project.java:
1306)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets
(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:
1189)
at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run
(BridgeImpl.java:273)
at org.apache.tools.ant.module.run.TargetExecutor.run
(TargetExecutor.java:499)
at org.netbeans.core.execution.RunClassThread.run
(RunClassThread.java:151)
BUILD FAILED (total time: 13 seconds)


Heres the source code:


public class XMLRPC {
int hits;
public void submit_hits() {
hits = hits + 1;
try
{
URL url = new URL("http://www.odpoa.com/bonappetit/scripts/
bonappetit_xmlrpc.php");

XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
config.setServerURL(url);
XmlRpcClient client = new XmlRpcClient();
client.setConfig(config);
Object[] params = new Object[]{hits};
String result = (String) client.execute
("XmlRpcDemo.StatHits", params);

}
catch (Exception e)
{
e.printStackTrace();

}

}
}

David Brackeen

unread,
Feb 10, 2009, 12:56:57 PM2/10/09
to pulp...@googlegroups.com
You might have to tweak the build.xml file to exclude META-INF dir when including files from library jars. If you get something working, let me know.

Aric - On Demand Programmers Of America .: www.odpoa.com :.

unread,
Feb 10, 2009, 5:40:42 PM2/10/09
to PulpCore
<!-- Creates a jar of the compiled code and libraries -->
<target name="jar" depends="compile">
<jar destfile="${build}/${project.jar}">
<fileset dir="${build.classes}" includes="**/*.class" />
<fileset dir="${build.res}/jar" />
<zipfileset src="${core.jar.file}" excludes="META-INF/**/
*" />
<zipgroupfileset dir="${lib}" includes="**/*.jar">
<exclude name="META-INF/**/*"/>
</zipgroupfileset>
</jar>
</target>

I don't know if im looking at the correct configuration block, but it
appears that it's already blocking Meta-Inf...
> > }- Hide quoted text -
>
> - Show quoted text -

David Brackeen

unread,
Feb 11, 2009, 10:22:09 AM2/11/09
to pulp...@googlegroups.com
Hmm, I'm not sure what's going on. Try running "clean" then build again?
What other client-side libraries are you using? Got the latest XMLRPC libraries?

Aric Holland

unread,
Feb 11, 2009, 12:21:41 PM2/11/09
to pulp...@googlegroups.com
David,

It appears to have been my fault. I was trying to pass integer data along an XML-RPC request, for some reason the way I did it did'nt work properly and caused the build error.

import org.apache.xmlrpc.XmlRpcException;
import org.apache.xmlrpc.client.XmlRpcClientException;
import org.apache.xmlrpc.client.XmlRpcClient;
import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;
import java.net.MalformedURLException;
import java.net.URL;


public class XMLRPC {
int hits;
    public void submit_hits() {
       URL url = null;

       hits = hits + 1;
            try
            {
               url = new URL("http://www.odpoa.com/bonappetit/scripts/bonappetit_xmlrpc.php");

                    XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
                config.setServerURL(url);
                XmlRpcClient client = new XmlRpcClient();
                client.setConfig(config);
                Object[] params = new Object[]{hits};
                String result = (String) client.execute("BonAppetit.SubmitHits", params);
            }
            catch (Exception e)
            {
                e.printStackTrace();
            }
        }
}


I simply commented out the Object[] params = new Object[]{hits}; params object, and am looking over the XML-RPC documentation to see how to correctly do what I am trying to do.

Thanks for your help,

Aric
Reply all
Reply to author
Forward
0 new messages