I'm so tired of tying to setup the project in Eclipse Ide and runnig
it on tomcat. I'm sick of all the errors. I've wasted a week trying to
do so.
What exactly are the steps to successfully deploy it?
1.I've tried importing from svn.
2.importing from .war
3.building it in the command line with maven, launching then the .war
with jitty and tomcat.
The closest think i came to was this page http://ubuntuone.com/5awgZExrABYt7chKsvcbWv
Please give me some compact, bullet-point, step-by-step instructions
on deploying it.
Op 14 feb. 2012, om 11:48 heeft Alexandru het volgende geschreven:
> I'm so tired of tying to setup the project in Eclipse Ide and runnig > it on tomcat. I'm sick of all the errors. I've wasted a week trying to > do so.
Make sure to delete any previous directory 'data', since it can include a lingering Lucene search index or hsqldb files. Running mvn and jetty also works on trunk ('svn co https://scm.mmbase.org/view/openimages/trunk' and repeat the same steps).
> 3.building it in the command line with maven, launching then the .war > with jitty and tomcat. > The closest think i came to was this page http://ubuntuone.com/5awgZExrABYt7chKsvcbWv
> Please give me some compact, bullet-point, step-by-step instructions > on deploying it.
Hope this helps.
---André
-- André van Toly web http://www.toly.nl mobile +31(0)627233562 irc irc://irc.slashnet.org/#mmbase twitter twitter://twitter.com/#!/elfuego2 ----------------------------------------------------------------~~<<>>~~
For the javax.mail related exceptions or NPEs, you need to download the mail.jar and put it into your tomcat/lib. This also applies to your database-connector jar, such as http://dev.mysql.com/downloads/connector/j/5.1.html for MySQL. That solution filters out a big part of the errors. The other remain, which I don't know.
The web application relies on mail. You need to have Java mail installed in Tomcat, from
localhost 2012-02-14 14:53:57,216 INF org.mmbase.module.Module loadInitParameters.338 - Put for mmbaseroot {basename=oi, datasource-context=java:comp/env, datasource=jdbc/MMBase, database=hsqldb_csv} localhost 2012-02-14 14:53:57,242 ERR org.mmbase.module.Module loadModulesFromDisk.617 - During instantation of 'org.mmbase.applications.email.SendMail' for 'sendmail': javax/mail/MessagingException java.lang.NoClassDefFoundError: javax/mail/MessagingException
Or comment these line in your context xml (oip-1.1.1.xml or something probably in your directory [tomcat]/conf/Catalina/localhost):
<!-- configuration of how to mail --> <Environment name="mmbase/sendmail/host" type="java.lang.String" value="smtp.gmail.com"/> <Environment name="mmbase/sendmail/user" type="java.lang.String" value="mihxiltest"/> <Environment name="mmbase/sendmail/password" type="java.lang.String" value="mmbase"/>
---André
> -- > You received this message because you are subscribed to the Google Groups "mmbase-discuss" group. > To post to this group, send email to mmbase-discuss@googlegroups.com. > To unsubscribe from this group, send email to mmbase-discuss+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/mmbase-discuss?hl=en.
-- André van Toly web http://www.toly.nl mobile +31(0)627233562 irc irc://irc.slashnet.org/#mmbase twitter twitter://twitter.com/#!/elfuego2 ----------------------------------------------------------------~~<<>>~~
This is my tomcat/lib:
annotations-api.jar catalina.jar el-api.jar jsp-
api.jar servlet-api.jar tomcat-
dbcp.jar tomcat-i18n-ja.jar
catalina-ant.jar catalina-tribes.jar jasper-el.jar
mail.jar tomcat-api.jar tomcat-i18n-
es.jar tomcat-jdbc.jar
catalina-ha.jar ecj-3.7.1.jar jasper.jar mysql-
connector-java-5.1.18-bin.jar tomcat-coyote.jar tomcat-i18n-fr.jar
tomcat-util.jar
This is the console launching tomcat now : http://pastebin.com/DENBQFP3 I have a hunch that i need to specify the settings for my db. Where
can i do that, if that's the cause.
> This is the console launching tomcat now : http://pastebin.com/DENBQFP3 > I have a hunch that i need to specify the settings for my db. Where > can i do that, if that's the cause.
I believe that when you have a defined libraries to use in a context.xml (probably in this case in [tomcat]/conf/Catalina/localhost/oip-1.1.1.xml) you will have to include those libraries in tomcat's lib directory. See tomcat's documentation for that. You probably need to copy the jar for HSQL (there is one in your the oip war in WEB-INF/lib/ I think).
I see you already have a jar for MySQL, maybe you can configure your webapp to run against that database?
---André
-- André van Toly web http://www.toly.nl mobile +31(0)627233562 irc irc://irc.slashnet.org/#mmbase twitter twitter://twitter.com/#!/elfuego2 ----------------------------------------------------------------~~<<>>~~
I would refer to tomcat documentation to find out how exactly that works (http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howt...) . Since tomcat in this case is responsible for the jdbc connections, it should have the JDBC driver too. It should be put in the common.loader of tomcat.
IIRC, the example jetty:run configuration should set up everthing automaticly for use with hsql. But there are at least 2 issues with this: 1. it uses port 8080, which you seem to use already for something else 2. Open images uses a few newer features of MMBase, which are hardly tested with hsql.
So although it is more complicated it is better to set up mysql anyway.
In the CMS Container project, we delivered context.xml files with sensible defaults and some options already pre-configured for common use. Isn't it a good idea to also have these sensible defaults pre-configured in the OI project context.xml? Also an install.txt or something like that might be handy. Now a newbie is struggling all the time and it might piss him of to use the whole project. Just some ideas.
> 2012/2/14 Alexandru<asas...@gmail.com>: >> I have a hunch that i need to specify the settings for my db. Where >> can i do that, if that's the cause.
> I would refer to tomcat documentation to find out how exactly that > works (http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howt...) > . Since tomcat in this case is responsible for the jdbc connections, > it should have the JDBC driver too. It should be put in the > common.loader of tomcat.
Op 15 feb. 2012, om 09:43 heeft Jacobjob Koster het volgende geschreven:
> In the CMS Container project, we delivered context.xml files with sensible defaults and some options already pre-configured for common use.
It just has defaults for mail and a hsqldb. Rather sensible if you ask me.
> Isn't it a good idea to also have these sensible defaults pre-configured in the OI project context.xml? Also an install.txt or something like that might be handy. Now a newbie is struggling all the time and it might piss him of to use the whole project. Just some ideas.
> On 14-2-2012 20:57, Michiel Meeuwissen wrote: >> 2012/2/14 Alexandru<asas...@gmail.com>: >>> I have a hunch that i need to specify the settings for my db. Where >>> can i do that, if that's the cause.
>> I would refer to tomcat documentation to find out how exactly that >> works (http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howt...) >> . Since tomcat in this case is responsible for the jdbc connections, >> it should have the JDBC driver too. It should be put in the >> common.loader of tomcat.
> -- > You received this message because you are subscribed to the Google Groups "mmbase-discuss" group. > To post to this group, send email to mmbase-discuss@googlegroups.com. > To unsubscribe from this group, send email to mmbase-discuss+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/mmbase-discuss?hl=en.
-- André van Toly web http://www.toly.nl mobile +31(0)627233562 irc irc://irc.slashnet.org/#mmbase twitter twitter://twitter.com/#!/elfuego2 ----------------------------------------------------------------~~<<>>~~
> In the CMS Container project, we delivered context.xml files with sensible > defaults and some options already pre-configured for common use. > Isn't it a good idea to also have these sensible defaults pre-configured in > the OI project context.xml? Also an install.txt or something like that might > be handy. Now a newbie is struggling all the time and it might piss him of > to use the whole project. Just some ideas.
I think it is 'sensible' to simply require a data source to be configured. As this is a more or less standard way of doing it. Providing a preconfigured database would merely mean that one has to understand how we've done that, because you have to configure it away then.
The jetty:run target could provide a preconfigured hsql (as I think it does). This is targeted at developers, but that is sensible too, because OI is shipped as a site, so I'd say it hardly can be used 'as is'.
But I do also think that there are some problems with easy deployment or getting going. I do doubt though whether that is related to 'sensible defaults'.
I fear that that is not quite accurate? Because it sais that the war is preconfigured to run hsql. But since the war does not contain the hsql driver, this is perhaps not really true, because at the very least that supposes that you installed it in the common.loader (I didn't test myself whether that would suffice). Of course it _could_ contain the driver, but that would be bit silly too, because this driver you are _certainly_ not going to use for real.
I think the documentation should simply state 'configure a datesource named jdbc/MMBase', and make documenting how to do that completely the responsibility of the container implementation.
@ Jacobjob Koster, i did read the install.txt. It mislead me: there is
no oip-1.1.xml, nor oip-1.1-1.xml on my system
$ locate oip-1.1.1.xml //returns nothing.
I'm trying to find the context.xml file now. This is what i have:
$ locate context.xml
/home/alexandru/Installers/OIP-1.1.1/oip-1.1.1/META-INF/context.xml
/home/alexandru/Installers/jetty-distribution-8.1.0.v20120127/contexts-
available/move-context.xml
/home/alexandru/Programs/Jetty6/contexts-available/move-context.xml
/home/alexandru/Programs/apache-tomcat-7.0.25/conf/context.xml
/home/alexandru/Programs/apache-tomcat-7.0.25/webapps/host-manager/
META-INF/context.xml
/home/alexandru/Programs/apache-tomcat-7.0.25/webapps/manager/META-INF/
context.xml
/home/alexandru/workspace/.metadata/.plugins/
org.eclipse.wst.server.core/tmp0/conf/context.xml
/home/alexandru/workspace/.metadata/.plugins/
org.eclipse.wst.server.core/tmp0/wtpwebapps/oip-1.1.1/META-INF/
context.xml
/home/alexandru/workspace/1.1.1/src/main/webapp/META-INF/context.xml
/home/alexandru/workspace/1.1.1/src/main/webapp/META-INF/.svn/text-
base/context.xml.svn-base
/home/alexandru/workspace/1.1.1/target/oip-1.1.1/META-INF/context.xml
/home/alexandru/workspace/OIP/src/main/webapp/META-INF/context.xml
/home/alexandru/workspace/OIP/src/main/webapp/META-INF/.svn/text-base/
context.xml.svn-base
/home/alexandru/workspace/Servers/Tomcat v7.0 Server at localhost-
config/context.xml
/home/alexandru/workspace/oip-1.1.1/WebContent/META-INF/context.xml
Since i imported the build .war file in eclipse and ran it from there,
i chose to edit .metadata/.plugins/org.eclipse.wst.server.core/tmp0/
wtpwebapps/oip-1.1.1/META-INF/context.xml. I commented the hsql
declaration and uncommented the mysql one.
This seemed to work. My db got created but it stumbled on a "function
not found exception". http://pastebin.com/RXUE3SAf
Op 15 feb. 2012, om 11:47 heeft Alexandru het volgende geschreven:
> @ Jacobjob Koster, i did read the install.txt. It mislead me: there is > no oip-1.1.xml, nor oip-1.1-1.xml on my system > $ locate oip-1.1.1.xml //returns nothing.
INSTALL describes the installation of version 1.1. OIP-1.1.1 is the successor to OIP-1.1. I am sorry I never got around updating INSTALL. You can replace 1.1 with 1.1.1.
> I'm trying to find the context.xml file now. This is what i have: > $ locate context.xml
With context.xml developers often indicate the xml file that contains the Context description. Contexts can be also found in server.xml look for <Context> ... </Context>, or in a file next to it in Tomcat's config named context.xml. It can also be included in a webapp, in it's META-INF directory etc. When a WAR is installed Tomcat normally copies it to some location inside it's own config directory like probably config/Catalina/localhost/oip-1.1.1.xml
> Since i imported the build .war file in eclipse and ran it from there, > i chose to edit .metadata/.plugins/org.eclipse.wst.server.core/tmp0/ > wtpwebapps/oip-1.1.1/META-INF/context.xml. I commented the hsql > declaration and uncommented the mysql one. > This seemed to work. My db got created but it stumbled on a "function > not found exception". http://pastebin.com/RXUE3SAf
I believe this is related to the mmbase-mmsite.jar. Maybe it helps to build mmsite yourself. From the oip project directory, cd to the mmsite directory which is located within the oip project directory and type 'mvn clean install' to build just the mmsite project.
Hope that helps.
---Cheers, André
-- André van Toly web http://www.toly.nl mobile +31(0)627233562 irc irc://irc.slashnet.org/#mmbase twitter twitter://twitter.com/#!/elfuego2 ----------------------------------------------------------------~~<<>>~~
Thanks Andre, it looks like building mmsite from source did the job. I
placed the jar in /web-inf/lib and now the site seems to work.
BUT, in my project tree i i receive a lot of errors, and it looks like
the majority are tag related.
For example, in web-infblock.jspx i have this line " xmlns:c="http://
java.sun.com/jsp/jstl/core"" and this is the error "Missing start tag
for "c:if""
How to fix this?
PS: i can't find any oim-1.1*.xml on my sysyem. I did changed
oip-1.1.1/WebContent/META-INF/context.xml and it looks like that was
it.
And i still run into problems. It seems that after i restart tomcat,
some other port gets occupied, 1112.
Check these sources http://pastebin.com/dRPexJkM .
Op 16 feb. 2012, om 10:26 heeft Alexandru het volgende geschreven:
> Thanks Andre, it looks like building mmsite from source did the job. I > placed the jar in /web-inf/lib and now the site seems to work.
Great.
> BUT, in my project tree i i receive a lot of errors, and it looks like > the majority are tag related. > For example, in web-infblock.jspx i have this line " xmlns:c="http:// > java.sun.com/jsp/jstl/core"" and this is the error "Missing start tag > for "c:if""
> How to fix this?
I don't know of any file by that name. Are you sure it is within OIP or maybe some other project in your development tool (Eclipse?) ?
> PS: i can't find any oim-1.1*.xml on my sysyem. I did changed > oip-1.1.1/WebContent/META-INF/context.xml and it looks like that was > it.
I don't recognize that directory path, but there is /META-INF/context in the root of the OIP webapp.
---André
-- André van Toly web http://www.toly.nl mobile +31(0)627233562 irc irc://irc.slashnet.org/#mmbase twitter twitter://twitter.com/#!/elfuego2 ----------------------------------------------------------------~~<<>>~~
>> I don't recognize that directory path, but there is /META-INF/context in the root of the OIP webapp.
> Yes, i used that to solve the db problem. Switched it to mysql.
Great.
---André
> -- > You received this message because you are subscribed to the Google Groups "mmbase-discuss" group. > To post to this group, send email to mmbase-discuss@googlegroups.com. > To unsubscribe from this group, send email to mmbase-discuss+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/mmbase-discuss?hl=en.
-- André van Toly web http://www.toly.nl mobile +31(0)627233562 irc irc://irc.slashnet.org/#mmbase twitter twitter://twitter.com/#!/elfuego2 ----------------------------------------------------------------~~<<>>~~
Yes, it's from eclipse's marker tab. Copy pasted some of the errors.
What do you think we could do about it?
Btw, a wiki page on setting-up the project with eclipse would be very
helpful for this project.
Take a look at opencms http://opencms-wiki.org/Developing_OpenCms_with_Eclipse .
It was a pleasure reading and executing it step by step... though i
met some difficulties there too, at the end. Just saying.
>> You generated that list with Eclipse? > Yes, it's from eclipse's marker tab. Copy pasted some of the errors. > What do you think we could do about it?
Most of those errors are not errors at all, or can safely be ignored.
A few examples: - Attribute name (onChange) uses wrong case character : From tinymce, This is not our thing. This should be fixed in tinymce. - c cannot be resolved to a variable : This is simply incorrect. Eclipse doesn 't understand the taglib
- EL Syntax Error : This might be correct. But it is only in a test-jsp. I suppose it was never used in tomcat 7 or so.
- XML validations warnings. : some of these may be solvable.
So, for the biggest part of this list I think eclipse is simply whining, and we shouldn't and/or couldn't do much.
> Btw, a wiki page on setting-up the project with eclipse would be very > helpful for this project. > Take a look at opencms http://opencms-wiki.org/Developing_OpenCms_with_Eclipse > . > It was a pleasure reading and executing it step by step... though i > met some difficulties there too, at the end. Just saying.
That might be a good idea, but someone has to make and maintain it. I'd prefer to simply point to the pom.xml in the IDE (e.g. at least Netbeans and IntelliJ are quite good at that), and then it should work out of the box.
Well, perhaps besides the database. Jetty-run should work, but that would probably not be picked up by an IDE, so I suppose that would require some manual setting up. So I agree that some more easy-to-find documentation would be welcome, but I'd find it a bit disappointing if it wants to be a long recipe.