Running Jboss 7 using different config folder under standalone-servers - jboss7.x

I'm used to jboss 5 deployment schemes where i use this command to deploy:
D:\jboss5\bin\run.bat -c ZZZ
which will deploy whatever in the jboss5\server\ZZZ folder
I have this structure on my jboss7:
D:\jboss7\
+standalone-servers
++ZZZ
+++modules
when i try to run jboss7 like this:
D:\jboss7\bin\standalone-servers.bat -c ZZZ
it complains with the following:
org.jboss.modules.ModuleNotFoundException: Module
org.jboss.as.standalone:main is not found in local module loader
#7559ec47 (roots: D:\jboss7\standalone-servers\modules) at
org.jboss.modules.LocalModuleLoader.findModule(LocalModuleLoader.java:126)
at
org.jboss.modules.ModuleLoader.loadModuleLocal(ModuleLoader.java:275)
at
org.jboss.modules.ModuleLoader.preloadModule(ModuleLoader.java:222)
at
org.jboss.modules.LocalModuleLoader.preloadModule(LocalModuleLoader.java:94)
at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:204)
at org.jboss.modules.Main.main(Main.java:262)
how to tell jboss7 to look for the right configuration that resides in the folder ZZZ?
appreciate for answers

By default the base directory for a standalone JBoss EAP 6 / JBoss AS 7 instance is ${JBOSS_HOME}/standalone
You can override this by supplying -Djboss.server.base.dir=ZZZ
You need to create ZZZ/configuration and ZZZ/deployment directories, and
place your standalone.xml file in ZZZ/configuration, then start jboss using the option.
standalone.bat -Djboss.server.base.dir=path_to_ZZZ
If your JBoss configuration file is not called standalone.xml then you will also need to add
-Dtarget.appserver.configfile=my_standalone_config.xml
The JBoss instance base directory does not need to be within the ${JBOSS_HOME} subdirectory tree. In fact it is better to keep it somewhere separate as it allows you to update / reinstall JBOSS binaries without overwriting your configuration files.
The modules folder should remain within ${JBOSS_HOME}
So if your ${JBOSS_HOME} were c:\jboss7 it would look something like
C:\jboss7
+bin
+modules
+standalone <- not used!
... etc
c:\standalone-servers
+ZZZ
++configuration
+++standalone.xml
++deployments

A possible reason is your jboss runtime is corrupt. Reason for
**org.jboss.modules.ModuleNotFoundException: org.jboss.as.standalone:main
at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:224)
at org.jboss.modules.Main.main(Main.java:341)**
is that jboss-eap-6.2\modules\system\layers\base\org\jboss\as\server\main package is missing inside your jboss directory. This package contains jboss-as-server-7.3.0.Final-redhat-14.jar and module.xml which are essential to run jboss server.

Related

Why is my moqui executable war file not allowing request to be found

I tried to follow the war generation instructions by changing the warName in build.gradle to moqui-plus-runtime.war and running gradle addRuntime and then gradle deployTomcat. There were no errors in the war build and I checked to see that the war file got installed as ROOT. I did not make any other changes (still using MoquiDevConf and I already had other system parameters in MoquiInit.properties.)
When I startup tomcat8, I don't see any errors in the log file and it says that it is loading moqui-plus-runtime, but when I make any request in the browser, the localhost_access... log shows 404 for any request.
Can you tell me what things I might of missed or how I would go about debugging this - there is very little info in the log files other than the 404 messages.
I followed the following steps to deploy to a Tomcat instance on the same machine. This is from memory as my production machine is currently offline for the next couple of weeks.
Edit tomcatHome to point to correct location
I personally run a gradle cleanAll first to remove old WARs etc
Run gradle build
Optionally run gradle loadProduction to load the production database, alternatively you can run java -Dmoqui.conf=conf/MoquiProductionConf.xml -jar moqui-1.5.3.war -load -types=seed,seed-initial so that you can pick which data types you want to load into production etc.
Stop Tomcat from running, probably optional but the next step deletes files & folders from a deployed tomcat instance.
Run gradle addRuntimeTomcat this task adds your runtime and also copies over the completed WAR into the Tomcat webapps directory if you set the location correctly in step 1.
Start Tomcat
Check Tomcat logs for any startup errors
Hope this helps

Run Intraweb .so on apache

I made a stand alone app and it works find Intraweb 9.4.2'
Create an apache 2 .so
project info ---
library DartsDLL;
uses
ApacheTwoApp,
IWInitApacheTwo,
DLogin in 'DLogin.pas' {IWForm1: TIWAppForm},
ServerController in 'ServerController.pas' {IWServerController:
TIWServerControllerBase},
UserSessionUnit in 'UserSessionUnit.pas' {IWUserSession: TIWUserSessionBase},
DartDM in 'DartDM.pas' {dm: TDataModule},
plyrshow in 'plyrshow.pas' {plyrs: TIWAppForm},
plyrdetail in 'plyrdetail.pas' {weekdtail: TIWAppForm},
NPlyr in 'NPlyr.pas' {FrmNewPlyr: TIWAppForm},
pidlweeks in 'pidlweeks.pas' {Tseasweeks: TIWAppForm};
{$E so}
{$R *.res}
exports
apache_module name 'webdarts_mod';
begin
IWRun;
end.
conf files have been modified
httpd2.pas has been modified
apache restarts ok.
I get no errors in apache logs.
When I try to run inside delphi I get:
Can not run unless host application is defined.
Question how do you run it?
From the menu open Run Parameters and set the host application to C:\Program Files\Apache Software Foundation\Apache2.2\bin\httpd.exe or the path where you installed Apache httpd. Another tip is to add -X to the parameters to force Apache httpd to run from a single process to not confuse the debugger.
Looking at project files the two important items are library DartsDll and apache_module name 'webdarts_mod'.
Presuming project compiles DartsDll.so will be created along with apache_module name.
Notice where apache_module name and library are used in LoadModule directive and where library name is used without ext in SetHandler.
Next you need to modify Apache httpd.conf file by adding four lines as follows;
LoadModule webdarts_mod modules/Dartsdll.so
< Location /??????>
SetHandler DartsDll-handler
< Location>
Replace the question marks with anything you desire (except any name you have already used as a apache alias) I used 'guessd'
You must copy the DartsDll.so file to the apache modules directory.
Restart Apache.
In browser just enter - localhost/guessd
If your apache has been configured correctly your .so(dll) will run.

How to fix java IOException: Can't find resource 'solrconfig.xml' in classpath?

I was trying to install Apache Solr 4.0.0 with apache Tomcat, but it is giving an error like this:
SolrCore Initialization Failures
collection1: java.io.IOException:java.io.IOException: Can't find resource 'solrconfig.xml' in classpath or 'solr\collection1\conf/', cwd=C:\apps\tomcat-solr\apache-tomcat-7.0.35\bin
There are no SolrCores running.
Using the Solr Admin UI currently requires at least one SolrCore.
After this I have installed apache solr 3.6.2 and it working perfectly well. I still cannot understand why i am not able to use solr 4.0.0 with the same server configuration.
I hope you will be able to tell me the mistake i have committed.
The directory structure changed in Solr 4.0. Have a look at the one in the example/solr directory. You will see that Solr 4 now has collection1 directory inside that and conf directory is now one level lower inside that. That's basically what the error message said.
If you don't like that, I think you can change it by putting solr.xml with the single core definition in it and directory paths setup the way you like it.

EXT Plugin not able to merge web.xml in liferay 6.0.6 and Weblogic 10.3

I deployed liferay war on weblogic 10.3 and cretaed EXT which have changes in web.xml.
If i deploy this EXT,weblogic doesn't take these changes which is made by web.xml of EXT.
I googled it and found this is issue in liferay 6.0 and resolved in liferay 6.2
please go through below link for more info:
http://issues.liferay.com/browse/LPS-13222
Howerver I found some workaround in liferay wiki which is suggesting to follow below steps.
copy somewhere existing web.xml
deploy EXT plugin
make plan.xml based on differences between the new web.xml and old one
use plan.xml in administration console
But still wondering how to create plan.xml in step3.
So would like to know how can i create plan.xml based on differnce between new web.xml and old one.
You just have to do a diff. Under Linux, open a console.
Try for example
diff web_old.xml web_new.xml > mydiff.patch
It will display the differences between the two files in a file called "mydiff.patch".
Now, you can patch the deployed web.xml (shutdown your server before) :
cd /path-of-the-web.xml-folder-on-the-server
patch -p0 < mydiff.patch
You can also use the svn diff command to make your diff file.
After these operations, restart your server.
Hope it helps.

Passing-through environment variables to Tomcat 7.0 web app context

Apache Tomcat 7.0, CentOS 5.8 i386
A web application needs a specific environment variable XY to be present in its context.
This variable is set in /etc/profile as a result of a computation (i.e. not a static value) and it is also used by other native applications running on the same system (hence it has to be the environment variable approach).
Tomcat is started with a general script using a dedicated tomcat user and sudo.
The first problem of passing XY through sudo is solved (thanks to stackoverflow) with the explicit definition within /etc/sudoers:
Defaults env_keep ="XY"
It means that the environment variable XY is preserved by sudo which is not the default case.
Now the environment variable XY is visible in the tomcat process. This can be verified with ps and /proc/tomcat-PID/environ or an explicit echo $XY in */your_tomcat/bin/startup.sh* (which is called by the init.d script using sudo). But seeing XY in the tomcat process does not mean the web app can see it. The web app dumps its environment to the log file with help of
LOGGER.debug("Environment: " + System.getenv());
the astonishing result for me was: no XY at all, although tomcat had it!
After reading the context documentation of tomcat 7.0 (be careful to distinguish between 7.0 and older versions of tomcat) I added the following entry to */your_tomcat/conf/context.xml*:
<Context>
...
<Environment name="XY" value="INIT_VALUE" type="java.lang.String"/>
...
</Context>
Now the output of System.getenv() really contains my XY environment variable BUT it has the correct value from /etc/profile not the value INIT_VALUE I specified in context.xml. With other words my /etc/profile does overwrite the INIT_VALUE, which is what I needed but not what I expected as there is no word about this in the documentation.
Did I find un-docmented behaviour that might be removed in later versions of tomcat or is this the way to go?
So in the end I am happy having a working solution but I am not very confident that this is a recommended and proper way of passing-through environment variables.
Any comments would be highly appreciated.
Tomcat Environment entries are different from system environment variables. Environment Entries specified by <Environment> markup are JNDI, accessible using InitialContext.lookup under java:/comp/env, while System.getEnv() is about system environment variables (of the tomcat process itself).