I've been trying this recently. I'm using Netbeans IDE 6.7.1. After unzipping I tried opening the freeform project that NetBeans found, but that had problems, so I renamed the directory and created a project from existing sources. That seemed to build OK.
I then tried the primer, at http://xins.sourceforge.net/primers/primer.html
I found some issues there, mostly that I needed to copy the dist\xins.jar file that netbeans created to the build directory and rename it to xins-common.jar, after that I seemed to be able to execute the xins all command without any issue.
That does not sound quite right:
- XINS 2.x does not use a dist/ directory AFAIK; instead it sends all generated files to the build/ directory
- normally, XINS 2.x does not generate a xins.jar file, but instead 3 separate ones: xins-common.jar, xins-client.jar and xins-server.jar
- renaming xins.jar to xins-common.jar sounds like the wrong approach, assuming it probably also contains the Client- and Server-stuff.
Note that I don't know anything about the NetBeans-support built-in to XINS 2.x.
The next issue was when I tried to execute:
xins -Dorg.xins.server.config=xins.properties run-myapi
[java] log4j:ERROR A "org.apache.log4j.ConsoleAppender" object is not assignable to a "org.apache.log4j.Appender" variable.
[java] log4j:ERROR The class "org.apache.log4j.Appender" was loaded by
[java] log4j:ERROR [sun.misc.Launcher$AppClassLoader@7d772e] whereas object of type
[java] log4j:ERROR "org.apache.log4j.ConsoleAppender" was loaded by [org.xins.common.servlet.container.ServletClassLoader$ChildFirstClassLoader@1386000].
[java] log4j:ERROR Could not instantiate appender named "console".
[java] Exception in thread "XINS null Servlet container." java.lang.LinkageError: loader constraint violation: when resolving field "INFO" the class loader (instance of org/xins/common/servlet/container/ServletClassLoader$ChildFirstClassLoader) of the referring class, org/znerd/logdoc/internal/log4j/AbstractLog, and the class loader (instance of sun/misc/Launcher$AppClassLoader) for the field's resolved type, org/apache/log4j/Level, have different Class objects for that type
>From my goolge research, it seems that this particular issue is caused by using two different classloaders.
Sounds very odd; I presume you are running this from inside NetBeans?
I have never seen this kind of issue before. However, having used IDEs in combination with regular Java projects for a while, my solution would be:
- go to the command prompt
- execute: xins clean
- execute: ins -Dorg.xins.server.config=xins.properties run-myapi
I suppose that should work. Let me know whether it does!