Building Mango in Eclipse
-
I do the following:
- make sure you have eclipse release which includes the web tools project.
- unpack mango source in a directory called "myMangoBranch" inside the eclipse workspace directory
- Do File->New->Other, choose "Dynamic Web project" from under "Web"
- Make Project name "myMangoBranch" (must match existing directory name)
- I don't have to change any other options on the new dynamic web project dialog, target runtime is apache tomcat 6.0 (you may have to add a target runtime), so I hit next.
- Source folders on the build path i leave as "src" and default output folder I leave as build/classes, so i hit next
- Content Directory I change from "WebContent" to war. Hit finish!
-
Hi Craig,
I followed your steps. I got the webtools Eclipse. However, it seems the current Eclipse version doesn't like that the myMangoBranch directory already exists (and suggests to use import existing project).
Nevertheless, I did create a new dynamic web project according to your steps and copied the Mango source into the newly created directory afterwards. Then I did a refresh in the project explorer. The new source files are then recognized, but I get exactly the same problems as before.
-
Update: building Mango now succeeded :)
I had to run the createconfigfiles task first. Still, I had to solve the problem that axis tools (wsdl2java) couldn't be found. axis-ant.jar is needed for this. I downloaded it from somewhere and put it in the WEB-INF/lib where it is now next to axis.jar. I understand that this isn't the correct place, but until someone points out what the right place is, this works for now :wink:
Summarizing the steps I had to take to build Mango:
-follow the general Mango installation instructions (including Tomcat install) from the Mango download page
-get Eclipse IDE for Java EE Developers
-get Mango source code, unpack it
-add empty subdirectories lib, src_gen and src_test to Mango source
-in file build.properties, edit tomcat.home to point at the tomcat location on your system. For windows, make sure forward slashes "/" are used in the tomcat.home path
-get axis-ant.jar and put it into the WEB-INF/lib directory
-In Eclipse choose import->general and browse to the mango source
-right-click build.xml in the project explorer and choose run as->2.ant-build...
choose the createconfigfiles target
-right-click build.xml again and again choose run as->2.ant-build...
choose the default deployThe newly built Mango is now copied to the tomcat webapps/test directory
Probably this isn't the most optimal recipe, but it does the job :)
-
You should be able to just remove the axis jar from your build path.
-
Thanks, I removed it from the build path and now the axix-ant.jar isn't needed anymore.
-
Hi,
if you want to build it with maven and/or Netbeans i can provide a setup-script (bash with symlinks) and a pom.xml.
Arne
-
Hi,
i want to install the mango source, but i have this error when i try run the build.xml.
BUILD FAILED
/home/.../workspace/myMangoBranch/build.xml:233: taskdef class org.apache.axis.tools.ant.wsdl.Wsdl2javaAntTask cannot be foundi know the lib axis-ant fix a problem linked to wsdl2, but in my case this doesn't work... the lib's version is axis-ant-1.2.1.jar
please i need help...
regards
Mariothanks
-
Hi Mario,
For building Mango you don't need the axis stuff. Besides removing the axis jars from the build path, you can remove the last WDSL related part of the build.xml as well. It's not needed for the "deploy" build target. Building the way I described above should then work.
Although building now works, when using the IDE, you will still get quite some unresolved red markings. You can solve that by adding some jars to the build path under the menu "project->properties->java build path->libraries". I used "add jar" to add these jars in war/WEB-INF/lib :
modbus4J
seroUtils
common-httputils
quartz
bacnet4J
commons-codec
jodaYou might also need use "add external jar" to point to the servlet and jsp api. For Tomcat 5 these jars are in ${tomcat.home}/lib and are named:
servlet-api
jsp-apiRegards,
Andras
-
Hi Andras,
i use: linux(ubuntu-10.4)
tomcat-6.0.20
eclipse 3.5(galileo)
mysql-server-5.0and i build the mango source without error or red markers the way you said(i added more others jars)
For building Mango you don't need the axis stuff. Besides removing the axis jars from the build path, you can remove the last WDSL related part of the build.xml as well. It's not needed for the "deploy" build target. Building the way I described above should then work.
but when i try to access http://localhost:8080/test with my browser(firefox 3.5) i can't see nothing only a HTTP STATUS 404
regards,
Mario -
Did you installed Mango in webapps/test? Also, are there any startup errors in the Tomcat console?
-
this is the default folder in build.properties
tomcat.appdir=test
tomcat.apppath=/testno errors
26/03/2010 18:30:38 org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/lib/jvm/java-6-sun-1.6.0.15/jre/lib/i386/server:/usr/lib/jvm/java-6-sun-1.6.0.15/jre/lib/i386:/usr/lib/jvm/java-6-sun-1.6.0.15/jre/../lib/i386:/usr/lib/jvm/java-6-sun-1.6.0.15/jre/lib/i386/client:/usr/lib/jvm/java-6-sun-1.6.0.15/jre/lib/i386:/usr/lib/xulrunner-addons:/usr/lib/xulrunner-addons:/usr/java/packages/lib/i386:/lib:/usr/lib
26/03/2010 18:30:38 org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
26/03/2010 18:30:38 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1018 ms
26/03/2010 18:30:38 org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
26/03/2010 18:30:38 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.20
26/03/2010 18:30:38 org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
26/03/2010 18:30:38 org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
26/03/2010 18:30:39 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/61 config=null
26/03/2010 18:30:39 org.apache.catalina.startup.Catalina start
INFO: Server startup in 710 mssorry my ignorance...
and thanks for your patienceregards,
Mario -
Obvious sounding, i know, but can you check that there is a <tomcat>/webapps/test directory?
Also (assuming you're using ANT), what does "ant list" tell you?
-
Hi mlohbihler,
yes this folder exist and have into:
/audio
/exception
/graphics
/images
/resources
/uploads
/WEB-INF
customViewExample.jsp
index.jsp
soundmanager2.swf
soundmanager2_flash9.swfi guess the ant is used to build and get what i need to build the project and deploy.
but i don't use the ant because Andras said this is not necessary
sorry my ignorance...
and thanks for your patienceregards,
Mario -
What do you see when you hit http://localhost:8080/manager/list (changing host info as necessary)? This assumes that you left the manager application in the deployment. You should be able to find your u/p in the conf/tomcat-users.xml file.
-
Hi,
I try do everything from beginning again...because i could't access http://localhost:8080/manager/list
so i install the tomcat6 againand when i try build i have another error
[copy] Copying 2797 files to /home/mario/Programas/apache-tomcat-6.0.20/webapps/mango
BUILD FAILED
/home/mario/workspace7/SuperMango/build.xml:117: Failed to copy /home/mario/workspace7/SuperMango/build/WEB-INF/classes/com/serotonin/mango/rt/maint/work/WorkItem.class to /home/mario/Programas/apache-tomcat-6.0.20/webapps/mango/WEB-INF/classes/com/serotonin/mango/rt/maint/work/WorkItem.class due to java.io.FileNotFoundException /home/mario/Programas/apache-tomcat-6.0.20/webapps/mango/WEB-INF/classes/com/serotonin/mango/rt/maint/work/WorkItem.class (No such file or directory)Total time: 3 seconds
sorry my ignorance...
and thanks for your patienceregards,
Mario -
Regarding your problem to access the manager: did you check that the manager role was assigned to the user with which you tried to access the manager ?
In conf/tomcat-users.xml you should have something like
<tomcat-users>
<role rolename="manager"/>
<user username="manager" password="manager" roles="manager"/>
</tomcat-users>to be able to access http://localhost:8080/manager/html with user manager
-
Hi Andras,
in my tomcat-users.xml i have this
<tomcat-users>
<role rolename="tomcat"/>
<role rolename="role1"/>
<role rolename="manager"/>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user username="manager" password="manager" roles="tomcat,manager"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="role1" password="tomcat" roles="role1"/></tomcat-users>
and in my build.properties i have
tomcat.home=/home/mario/Programas/apache-tomcat-6.0.20
tomcat.manager.url=http://localhost:8080/manager
tomcat.manager.username=manager
tomcat.manager.password=manager
tomcat.hostname=webapps/ROOTApp name and app path are separated to accomodate root deployments. (i.e. 'ROOT' vs. '/')
tomcat.appdir=mango
tomcat.apppath=/mangoand when i run the build.xml to createConfigFiles
Buildfile: /home/mario/workspace7/SuperMango/build.xml
createConfigFiles:
[copy] Copying 1 file to /home/mario/workspace7/SuperMango/build/WEB-INF/classes
[copy] Copying 1 file to /home/mario/workspace7/SuperMango/build/WEB-INF/classes
BUILD SUCCESSFUL
Total time: 466 millisecondsbut when i run to deploy[default]
Buildfile: /home/mario/workspace7/SuperMango/build.xml
compile:
static:
build:
copy:
[copy] Copying 2797 files to /home/mario/Programas/apache-tomcat-6.0.20/webapps/ROOT/mangoBUILD FAILED
/home/mario/workspace7/SuperMango/build.xml:117: Failed to copy /home/mario/workspace7/SuperMango/build/WEB-INF/classes/com/serotonin/mango/rt/maint/work/WorkItem.class to /home/mario/Programas/apache-tomcat-6.0.20/webapps/ROOT/mango/WEB-INF/classes/com/serotonin/mango/rt/maint/work/WorkItem.class due to java.io.FileNotFoundException /home/mario/Programas/apache-tomcat-6.0.20/webapps/ROOT/mango/WEB-INF/classes/com/serotonin/mango/rt/maint/work/WorkItem.class (No such file or directory)Total time: 2 seconds
other thing i observe is the fact when i started tomcat by the eclipse, i can't access the "http://localhost:8080/" , returning a HTTP Status 404
but when i started the tomcat by console like root, i can access the homepage of tomcat("http://localhost:8080/") and "http://localhost:8080/manager/html" normally
sorry my ignorance...
and thanks for your patienceregards,
Mario -
Hi Mario,
If you're going to have a context path of "mango", then your hostname should not include "ROOT". Try changing the following build.properties value:
tomcat.hostname=webapps
-
Hi mlohbihler,
i changed to
tomcat.hostname=webapps
but don't have any effect...
Buildfile: /home/mario/workspace7/SuperMango/build.xml
compile:
static:
build:
copy:
[copy] Copying 2797 files to /home/mario/Programas/apache-tomcat-6.0.20/webapps/mangoBUILD FAILED
/home/mario/workspace7/SuperMango/build.xml:117: Failed to copy /home/mario/workspace7/SuperMango/build/WEB-INF/classes/com/serotonin/mango/rt/maint/work/WorkItem.class to /home/mario/Programas/apache-tomcat-6.0.20/webapps/mango/WEB-INF/classes/com/serotonin/mango/rt/maint/work/WorkItem.class due to java.io.FileNotFoundException /home/mario/Programas/apache-tomcat-6.0.20/webapps/mango/WEB-INF/classes/com/serotonin/mango/rt/maint/work/WorkItem.class (No such file or directory)Total time: 3 seconds
sorry my ignorance...
and thanks for your patienceregards,
Mario -
Maybe a silly question, but can you say how much of this path actually exists:
/home/mario/Programas/apache-tomcat-6.0.20/webapps/mango/WEB-INF/classes/com/serotonin/mango/rt/maint/work/