How to check that `undertow-handlers.conf` is read/used? - jboss

I have a Jboss 7.4.
I added into my war application a undertow-handlers.conf file in the WEB-INF folder.
Content is :
path(/)->samesite-cookie(mode=LAX, case-sensitive=false, enable-client-checker=false, add-secure-for-none=false)
But I can not see anything in the logs when Jboss is starting about that file. Except when the syntax of the file is not correct.
Is there a setting I can change to see if that handler is set and read/used?
Actually, setting LAX using this method for Samesite is not working at all and I wonder if this file is currently used/read at start.
Many thanks,

Related

Where to find current standalone configuration?

I have a fully working JBoss 6.3.3.GA instance but one of my colleagues unwittingly connected to my Development server instead of his, and updated my Standalone.xml file.
He made a lot of changes and there's no way (at least I didn't find any one) to get my old file back.
Now I need to restart my server, and I'm afraid I'll loose my current configuration forever since his update will be taken into account.
My question is : Is there anyway I can find my current XML Standalone configuration in any temporary folder or something like that ?
Under your jboss directory go to : standalone/configuration/standalone_xml_history.
You should find different versions : standalone.boot.xml, standalone.initial.xml, standalone.last.xml ... etc
You will also find old configurations of your standalone stored in folders which names include the date when you made those configurations includig a folder containing your current configuration.

IBM Liberty issue

An architect is having issues bringing Liberty up. Currently, an individual is running a server on his local computer and they want to move it to a shared server. When he tries to deploy a simple “helloworld” it’s failing and he is receiving an error “Context Root Not Found”. He is not sure what to set in server.xml file to have wlp recognize the application. They have ODM 8.5 on the mainframe. He thinks it might help if he saw an example of an EAR or WAR file deployed. Any ideas or suggestions?
Either put your application in the dropins folder, it will be detected and started automatically, or put it in the apps folder and configure in server.xml like this:
<webApplication id="HelloApp" location="HelloApp.war" name="HelloApp"/>
by default context root is application file name without extension, but you can change it by adding contextRoot="mycontext" attribute.

How to Deploy a JBoss ESB on a Jboss AS

I am Trying to deploy Jboss esb over Jboss AS using Ant. but i am getting the following error and it is giving me a build fail. I certainly have changed the .Properties file with the correct Server home and server config paths.
Below is the error i am getting
Also I have Jboss 5.1.0 AS and Jbossesb 4.1.0
I am not sure what changes do i need to make with my build.xml file.
C:\jbossesb-4.10\install>ant deploy
Buildfile: C:\jbossesb-4.10\install\build.xml
check.deploy.props:
dependencies.source:
dependencies.jbossesb:
dependencies:
init.bindings.props:
undeploy.bindings:
undeploy.jbossas5:
undeploy.jbossas6:
undeploy:
BUILD FAILED
C:\jbossesb-4.10\install\build.xml:480: Directory does not exist: C:\jbossesb-4.10\install\jboss-5.1.0.GA\server\all\lib
You've probably set bad server path in property file. Did you unpack server to "C:\jbossesb-4.10\install\jboss-5.1.0.GA\" directory?
You need to set the path to jboss-as directory. Correct may be something like this.
C:\jbossesb-4.10\install\jboss-5.1.0.GA\jboss-as\
In order to deploy jboss-esb on to jboss-as you need to have deployment.properties file in
your install folder of jboss-esb (for ex: \jbossesb-4.6\jbossesb-4.6\install)
in that deployment properties file you need to set your jboss-as home
ex: org.jboss.esb.server.home=D:/J Boss Book Installs/jboss-5.1.0.GA-jdk6/jboss-5.1.0.GA
NOTE: the direction of slash is very important it should be forward slash(/) (as specified in example above) for it get indexed in to the given server.home location .
Otherwise you will get directory doesn't exist errors just like the one you specified above in your question .
Check your deployment.properties file and correct server.home it would probably resolve your error !!!

Netbeans and PHPUnit Skeletion Generator: No such file or directory

I use netbeans 7.2.1 and newest phpunit. When I want to generate a unit test in netbeans by right-clicking on the php class then Tools-> Create phpUnit test the Skeleton generator throws an error: No such file or directory.
require_once(/sharedResources/connection.inc.php): failed to open stream: No such file or directory
The issue is that the path displayed in require_once is wrong. It is generatedliek this:
$sharedResources = getenv("DOCUMENT_ROOT") . "/sharedResources";
and should resolve to the absolute file path. This works fine when application is running in apache. However it seems that getenv("DOCUMENT_ROOT") is just wrong when running from netbeans. My question is how I can set it correctly? My application is under
getenv("DOCUMENT_ROOT") . "/MyApp";
and the file I'm creating a test for is in
"MyApp/services"
Under Project properties there is an option web root but it is greyed out and it is impossible to set it to a folder one level higher than your application.
How can I solve this?
EDIT:
Further clarification:
I initially had a relative filepath to sharedResources which did not work also. the I changed to this one and of coruse ti makes sense it is not working as DOCUMENT_ROOT is set by apache and hence not set when running in netbeans. So a temprary fix is to add
$docRoot = getenv("DOCUMENT_ROOT");
if(empty($docRoot)){
putenv("DOCUMENT_ROOT=C:/xampp/htdocs");
}
to the head of every class. of course that is not a very practical or good solution. I would need to tell netbeans to set this environment variable or to use correct relative path.
Well here is my solution. It's not ideal but simple and works. The issue is that DOCUMENT_ROOT is obviously empty when script is not called by Apache but by netbeans. Hence it must somehow be set. To do that I edited the php file phpunit-skelgen(it does not have a file ending but it's a php file).
Below the license text as first php line I added
putenv("DOCUMENT_ROOT=C:/xampp/htdocs");
That did the trick.

Is there a way to get the absolute path of the context root in tomcat?

I have a problem that, after a lot of reading and research, seems like tomcat is running another instance of itself and thus serving an old version of my updated app (or somehow has cached an older version of my webapp somewhere only serves that.)
I work on the app in eclipse on a windows machine and deploy it on a Linux server as a ROOT app (Renaming the war file to a ROOT.war).
What I'd like to know is if there's a way to locate the older version that tomcat is serving by getting tomcat to log an output of the context root of the servlet that's serving the older version of the app.
As it stands it the moment any files created by the updated app get created in the right directory but because the app instances are different it can't access the files shortly after they're created.
Any help/hints would be welcomed
To answer the question in the title, let your code basically do the following:
System.out.println(getServletContext().getRealPath("/"));
To solve the problem described in the question, shutdown Tomcat and delete everything in its /work directory, delete the expanded WAR in /webapps and remove the /Catalina subdirectory of /conf directory (if any) and then restart.