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
Related
I've already spent more than 2 days trying to make this work without any result. The server is WebLogic 12c with embedded Coherence server. It is important to mention that I do not run Coherence in standalone mode, instead it starts automatically alongside the application server that has access to Coherence via JNDI context. I am trying to implement POF serialization approach using PortableObject interface to serialize certain objects I save in Coherence. I've also created the corresponding pof-config.xml registering the objects I'm planning to serialize. The only problem is: How do I add the override to the coherence class path?
According to http://docs.oracle.com/cd/E24290_01/coh.371/e22837/gs_config.htm#COHDG5014 I can use the following system property:
java -Dtangosol.pof.config=MyPOF.xml -cp COHERENCE_HOME;COHERENCE_HOME\lib\coherence.jar com.tangosol.net.DefaultCacheServer
The only problem here is that I have no idea which sh/cmd file to edit, since all edits I made to the files in Oracle_Home\coherence\bin\ had no effect.
Also the same article says that there is a way to confirm the pof-config override:
The output for a Coherence node indicates the location and name of the POF configuration deployment descriptors that are loaded at startup. The configuration messages are among the messages that display after the Coherence copyright text is emitted and are associated with the cache service that is configured to use POF. The output is especially helpful when developing and testing Coherence applications and solutions.
Loading POF configuration from resource "file:/D:/coherence/my-pof-config.xml"
But I couldn't find any of the mentioned lines in the logs produced by the server instance.
Any ideas?
Instead of editing files inside of your Oracle_Home, try the following inside of the weblogic admin console:
Login to admin console
Servers link -> Server Name
Click the Server Start tab
Edit the Arguments: text box and add in -Dtangosol.pof.config=MyPOF.xml
You can also change the classpath, Class Path: box, here if you need to
Every time your server starts it should have that property. If you are not using the nodemanager to start your server, you should do the following instead. Keep in mind this will change the properties for every server in your weblogic domain:
Navigate to your <domain home>/bin directory
Edit startWebLogic.sh/cmd
Edit the JAVA_OPTIONS= line and add in -Dtangosol.pof.config=MyPOF.xml
You can also change the classpath CLASSPATH= here if you need to
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 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.. :) :) :) :)
I have a Java EE 5 application which consists of three web projects. I'm using JBoss 5.1 web server and NetBeans 7.2 IDE.
I have the following problems:
I cannot start application in Debug mode. That I know of, there are two (best) approaches in NetBeans and Java: Remote debugging and debugging via shared memory. I read this post How to debug JBOSS application in netbeans? and I set debug parameters in Jboss configuration(I also know there are different parameter sets for shared memory and remote debugging), but when I go to attach debugger I got following errors:
If I use remote debugging I got error "Connection refused";
If I use shared memory I got error similar to this text "dt_shmem:file path could not be found".
These errors occur when I start JBoss by running run.bat file. If I start JBoss from Netbeans IDE, I can attach to remote process (still have problem with shared memory approach), but then I have other problems, regarding variable primitives and model binding in page life cycle (I will not write about that now).
How can I solve these problems so I can debug application? At least, how can I find a better error message when it fails. I could not find too much on the Net by looking for "Connection refused" error only.
Why I cannot just press run main project(or web project) and that netbeans start application, open it in new browser tab(as localhost) and start debug mode? I'm coming from .net background and VS is offering this as out of the box tool (called ASP .NET development server). Why I have to use external web server and with every change deploy new application and then attach to it? Why Netbeans cannot by default use JVM for running application, and later when I deploy application I will choose which web server to use!?
I hope someone will make this clear to me :)
Thanks
added Note at 03.01.2013.
Well, when I changed VM options in project.properties file of web project (added run.args.extra=-J-Xms256m -J-Xmx756m), I succeeded to debug application and heat breakpoint when executing the code. However, I still have strange problem with Managed Bean properties. I have select list on page, and it is connected to Boolean property. When nothing is selected it should be set to null value by default (and it is when I start JBoss server by running run.bat file), but its value is by default set to false! I checked parameters post values in firebug and there is no problem in posting parameters to bean. It looks to me that problem is when JSF framework is trying to map post values to Managed Beans properties, but I cannot find out why this is happening. I also checked faces-config.xml, but did not find any specific rule for mapping to this specific property. Any tips?
My company is preparing a new production box while the current one is running. I would like to proactively install applications in Tomcat container of the new production box but would like to keep them disabled (similar to the feature present in Websphere) - this is very important because some of the applications poll for the data from the database and starting an application would interfere with current production deployment. They would be enabled at the time of production switch-over.
How would I accomplish this? Any insight would be greatly appreciated.
You can simply rename de WEB-INF directory inside the webapp that you don't want to auto-start to some other name like Disabled-WEB-INF, before starting tomcat.
Later on, if you wish to start that app, while tomcat is running, simply rename back the directory to WEB-INF.
add deployIgnore attribute in <Host>, and the value is the regular expression of the dirs you want to ignore, if you want to ignore foo,just set deployIgnore="foo" and you want to ignore more dirs,use regular expressions to set the values
In the <Host> element of your conf/server.xml put deployOnStartup="false". Reference: Tomcat Host documentation
You can use tomcat web application manager; this webapp does let you stop any application inside tomcat from running.