I am following the http://docs.broadleafcommerce.org/current/Getting-Started.html and all the steps were successfully completed, and i also migrated to MySQL database as well, and configured mysite with jrebel successfully.
Now after i start my site & admin projects, i start playing with the framework by adding few more product under demo site only, and the newly created product is added successfully to my site, but every time i re-start my demo site, the products goes back to the default in the original state, i mean the product which i have added to this table "broadleaf.blc_product" is gone after restart, so how do I keep the changes in database?
I did these changes in my development.properties
blPU.hibernate.hbm2ddl.auto=create-update
blPU.hibernate.hbm2ddl.import_files=/sql/load_admin_security.sql,\
/sql/load_admin_users.sql,\
/sql/load_code_tables.sql,\
/sql/load_table_sequences.sql,\
/sql/load_catalog_data.sql,\
/sql/load_content_structure.sql,\
/sql/load_content_data.sql
blCMSStorage.hibernate.hbm2ddl.auto=create-update
blCMSStorage.hibernate.hbm2ddl.import_files=/sql/import_storage.sql
after this changes my demo site page has stop working.
it is giving me an error when I trying to open my site on web browser:-
HTTP ERROR 404
Problem accessing /. Reason:
Not Found
Can you please let me know where did I had made a mistake.
Thanks in advance
Regards,
Ankit Patni
Take your project environment to tomcat server .. by deploying the .war file of ur demosite in tomcat webapp folder.
once you have delpoyed the full demosite in your tomcat server after starting the tomcat services
make one change in development.properties in below
blPU.hibernate.hbm2ddl.auto=create-drop
to
blPU.hibernate.hbm2ddl.auto=update.
This will work for you..
Go to development-shared properties of demo site
blPU.hibernate.hbm2ddl.auto=update
blCMSStorage.hibernate.hbm2ddl.auto=update
blSecurePU.hibernate.hbm2ddl.auto=update
make the changes as given above and Run As--> Maven install and start the jetty server
hope this works
I am posting my findings and a method to achieve this,
First of all we need to keep in mind three files for this.
a. common-shared.properties
b. development-shared.properties
c. development.properties
Step1: start the app, let the app create the database and load all the data.
Step2: Stop the database server.
Step3: Stop the application server.
Step4: Changes in the properties file mentioned above.
a. set following values.
blPU.hibernate.hbm2ddl.auto=none
blCMSStorage.hibernate.hbm2ddl.auto=none
blSecurePU.hibernate.hbm2ddl.auto=none
and comment out the following line :
blPU.hibernate.hbm2ddl.import_files=/config/bc/sql/load_admin_permissions.sql,\
/config/bc/sql/load_admin_roles.sql,\
/config/bc/sql/load_admin_menu.sql,\
/config/bc/sql/load_menu_admin_security.sql,\
/sql/load_admin_users.sql,\
/sql/load_code_tables.sql,\
/sql/load_i18n_countries.sql,\
/sql/load_table_sequences.sql,\
/sql/load_content_structure.sql,\
/sql/load_catalog_data.sql,\
/sql/load_content_data.sql,\
/sql/load_content_structure_i18n.sql,\
/sql/load_content_data_i18n.sql,\
/sql/load_catalog_i18n_data_FR.sql,\
/sql/load_catalog_i18n_data_ES.sql,\
/sql/load_sitemap_data.sql,\
/sql/load_menu_data.sql
b. Set the following properties to "none"
blPU.hibernate.hbm2ddl.auto=none
blCMSStorage.hibernate.hbm2ddl.auto=none
blSecurePU.hibernate.hbm2ddl.auto=none
c. Set the only property in development.properties to "none"
blPU.hibernate.hbm2ddl.auto=none
Step 5: Restart the DB server.
Step 6: Redeploy the application.
and Boom .... you have done it.. :) :) :) :)
Related
First of all, I am aware that there are other questions regarding Tomcat, Eclipse, and the infamous 404 error. However, none of them manages to resolve the issue. I have spent well over 24 hours on this issue.
To save time, when I configured everything (including Tomcat, and creating a server in Eclipse), I:
• Changed the server location from "workspace metadata" to its correct location by using the "Switch Location" button located in the server's Properties window.
• I chose the "Use Tomcat Installation" option in Server Locations, and saved the choice I made.
In both cases, I restarted the server. If you're curious as to what app I'm currently working on, it's a simple Hello World app, found at: http://theopentutorials.com/examples/java-ee/servlet/how-to-create-a-servlet-with-eclipse-and-tomcat/
• I have included the Java file in the "welcome file" list inside web.xml.
Lastly, out of curiosity, why does the Eclipse browser only go to the project directory, and not the servlet itself? (If I add on the servlet name, then "Hello World" appears).
• Yes, if I enter "http://localhost:8080", the default Tomcat page appears, so no issues there.
Can anyone clue me in, as to why I am still getting 404s after all this, and following advice that has been marked as "Accepted" here at SO, such as the following:
HTTP Status 404 - The requested resource (/) is not available
Thanks in advance for any help, it is greatly appreciated.
The error 404 may occur because of large amount of different reasons. In order to resolve that, you should check your tomcat log file out first. It contains by the path:
%PATH_TO_WORKSPACE%\.metadata\.plugins\org.eclipse.wst.server.core\tmp%SERVER_NUMBER%\
logs
Usually it contains some stacktraces which discribes the problem. If not, then you should check your deployed application out there:
%PATH_TO_WORKSPACE%\.metadata\.plugins\org.eclipse.wst.server.core\
tmp%SERVER_NUMBER%\___YOUR_APP____
It might happen that your application was not deployed correctly by eclipse plugin (happens very often) and you should try this:
Project --> clean
'Right click on your server' --> clean
Or just remove your webapp from the directory I mentioned erlier and redeploy it from scratch.
There is something basic you need to understand regarding using tomcat(or application server for that matter). There is a slight difference between using from Eclipse and using from outside
Using From within Eclipse
What happens here is that Eclipse (by default) uses a copy of your tomcat installation and places it in its metadata workplace. This secondary tomcat is used by Eclipse for all deployments, re-deployments and all. Keep in mind that this is not your original copy of tomcat installation.
The difference in this tomcat installation is that is actually a minimal server, meaning that although it has all the deployment capabilities, it does not have some of the extra features that come with the tomcat installation and one main feature is the tomcat's homepage (the only reason why people out there get the infamous 404 resource not found when they try to run-on-server their application).
Workaround
Although not an issue (nor a bug from the Apache's end), you can still view your application by changing the URL to your application's url, homepage or no homepage ! All you have to do is change the url from http://localhost:8080 to http://localhost:8080/yourApplicationName and voila , the default page of your application will be shown that you mentioned in the welcome-page-list. Keep note that if you didn't specify a default page in your web.xml, you will again wind up with, yet again, the dreaded 404 resource not found page. The reason is that Tomcat has found your application, but it doesn't know what to do at the root context of your application. You can either map your servlet to the root of the application (that way it will always run at http://localhost:8080/yourApplicationName) or you can change the URL to the url-pattern that you mapped with the servlet in the web.xml, it must be something like http://localhost:8080/myApplicationName/myServletMappingPattern
There is an application, say myApp.war (developed using Spring MVC) that I give the users to deploy in their tomcat webapp folder. When the user starts tomcat, the war is exploded, and then I ask the user to go myApp/WEB-INF/classes/persistence.properties and ask him to edit just one property name (actually an HSQLDB path). Post that I ask the user to stop tomcat, delete the war file and start tomcat server again. And the application is up and running.
Although the users are not complaining, I believe there has to be a better way of doing this. For example when the users deploy wordpress or hudson and the first time they try to access the app. they are redirected to an install page where they do their basic configuration and they are up and running. How can I achieve it here.
I have used JNDI to solve this very problem in the past. Here is a nice example to show you how to do this with Spring:
http://www.journaldev.com/2597/spring-datasource-jndi-with-tomcat-example
Checkout JMX which can allow on the fly configuration, or there is one obix framework
Why not something like this:
Use a relative path with sysprops, like ${user.home}/path-to-hsqldb. If the user runs tomcat as user "jim", it will look in c:\users\jim\path-to-hsqldb (Windows) or /usr/jim/path-to-hsqldb (Linux)
You might need to use Spring's <context:property-placeholder/> to enable this.
I'm trying to deploy my first servlet to my server. There are, of course, many tutorials online. But most of them are very detailed and complicated, and I only need to deploy a few simply servlets to this server.
I found what I think to be the shortest method of deployment: Deployment on Tomcat Startup. I moved my .WAR file (FirstProject.war) into $CATALINA_BASE/webapps folder, but when trying to access it (ServerIP/FirstProject) I get the "The requested resource is not available." error.
Is there anything I forgot in the process of deployment?
I know that deployOnStartup has to be set to true, but I didn't change anything with the server's hosts, so the current host is localhost. I didn't change its settings, so deployOnStartup should be true (It's said that true is the default).
What am I missing?
You are using easiest way but I don't know what you are missing. Here what I would suggest is run your server and access through localhost:8080 then click manage app then enter username and password then you can deploy your war.
If you have any query post command.
Even i used to face this problem while deploying my first web application on Jboss and Apache ..
Even though your code is working properly with all your servlet mappings and paths using in your content files ...some times they kick back in real time environment ..So we have to know the proper deployment folder structure and accordingly we have to change our paths in the code
what i am concluding is check the below lines of code
Examples, assuming root is http://foo.com/site/
Absolute path, no matter where we are on the site
/foo.html
will refer to http://foo.com/site/foo.html
Relative path, assuming the containing link is located in http://foo.com/site/part1/bar.html
../part2/quux.html
will refer to http://foo.com/site/part2/quux.html
or
part2/blue.html
will refer to http://foo.com/site/part1/part2/blue.html
I have Jboss 5 installed/configured. I would like the ability to have Jboss auto start when my VM boots up. I see in my Jboss bin directory I have a startup script jboss_init_redhat.sh
I am assuming I have to get that script into my /etc/rc.d/init.d/jboss file
Then I am stuck, what is my next step?
Thank you for helping a beginner
According to How do I Start JBoss on boot with Linux? on JBoss Community Wiki, your task is to:
create a user for JBoss (recommended) so that JBoss can be
restricted to accessing only the files
and system resources that it has
permission to access via the "jboss"
user.
create a script called /etc/rc.d/init.d/jboss
create a link called /etc/rc3.d/S84jboss
optionally /etc/rc5.d/S84jboss and /etc/rc4.d/S84jboss
create a link called /etc/rc6.d/K15jboss
create the K15
link in /etc/rc1.d, /etc/rc2.d,
/etc/rc0.d
For the 2nd step, you can indeed use the jboss_init_redhat.sh file that ships with JBoss. For more information, check the link given above, it details each step.
The stock init script is very primitive; here's my take at a better one: https://jira.jboss.org/jira/browse/JBPAPP-3194
My project is a Web project built using three technologies :
Icefaces for presentation layer.
Spring for business layer.
Hibernate for data access layer.
My Project deployed on WebSphere 6.1 and the user can upload files, I use ice:inputFile component to handle the upload process...
The first issue is:
When the upload process finished i expect to find the uploaded file under the following path : myWebProjectRoot/upload/"sessionId"/fileName.ext
where the "sessionId" is a folder named with the current session id and the fileName.ex is the file uploaded by the user...
But what i found is : the folder "sessionId" did not created and the file is stored directly on the upload folder..
My Configuration is like the configuration of the component-showcase of icefaces library which i deployed it on my server and it create the sessionId directory successfully....
i don't know what to do.. please help me...
The second Issue is :
When the session expired I expect the sessionId folder will be deleted, i modified the code of component-showcase in the class InputFileSessionCleaner and make it delete the folder and it's children recursevly form bottm to up, but some time i face the current problem :
Some files can not be deleted using my code -may be they are used by another process-, thus the folder will not be deleted because one of its children didn't deleted. so what to do in this case ... ?
There is an idea in my mind, which is:
Is there any way to create a process running at the background in the server-side: this process check the upload directory and if it founds any file created from at least 60 minutes -which is my session time out period specified in web.xml- this process will delete this file....
any one can help me.. every help will be appriciated .....
In answer to your second question:
WebSphere has a facility for creating worker threads and arranging for them to be initiated according to a schedule. This approach is fully supported in WebSphere - you don't violate any Java EE restrictions on thread creation by using it.
Search for Aysynchronous Beans in your WebSphere documentation.
There are a couple of flavours of this capability in WebSphere one of which is a generally standardised form that you may also find in other vendors App Servers. Some description is given here: http://www.ibm.com/developerworks/library/specification/j-commonj-sdowmt/index.html