JBoss Startup Problem - jboss-4.2.x

When I start the JBoss server to run my JSP page, it gives the error as:
Failed to create directory structure: C:\Program Files\jboss-4.2.2.GA\server\default\log
and then a pop-up appears saying
Starting JBoss v4.2 at localhost has encountered a problem.
Server JBoss v4.2 at localhost failed to start.
Please tell me what to do?

When starting for the first time for a certain configuration (here being default, if they are not already present, JBoss creates the directories:
$JBOSS_HOME\server\default\data
$JBOSS_HOME\server\default\log
$JBOSS_HOME\server\default\tmp
$JBOSS_HOME\server\default\work
These are used to store and write logs, temporary files and other various files generated.
There is obviously an error when it tries to create the log folder and this is most likely because it does not have permissions to write and create folders. ( Though you would get this every time since JBoss likes to write a lot of logs all the time ).
In Windows Vista/7, the Program Files folder is not (usually) write-able, so an application started by the user cannot create or modify anything there. You could run JBoss as Administrator but DON'T, it's a bad idea. All files which need to be created/modified by an application should usually be stored in the user's folder, Application Data or somewhere else on the hard drive.
Possible solutions:
Either install your JBoss server somewhere else where you have write access. ( It needs this also when running normally like for storing logs )
Configure JBoss to store logs and other files in different directories, outside of your normal Program Files one. For example to specify a different directory for logs you can set the JVM startup property jboss.server.log.dir ( Specify it at startup by using java -Djboss.server.log.dir=C:/I_can_write_here/. You can find the properties for other directories (and a lot more) at http://community.jboss.org/wiki/JBossProperties

The obvious thing to check is which, if any, of the directories in the quoted path are missing:
C:\Program Files\jboss-4.2.2.GA\server\default\log
Obviously, you have bigger problems than just this if C:\Program Files\ is missing, but you may have other directories missing.
You may need to run an initialize step to validate your configuration and create the directories.

Related

Renaming executable's image name is giving it write permission

Dear community members,
We have three of same hardware Windows 7 Professional computers. No one of them is connected to a domain or directory service etc.
We run same executable image on all three computers. In one of them, I had to rename it. Because, with my application's original filename, it has no write access to it's working directory.
I setup full access permisions to USER group in working directory manually but this did not solve.
I suspect some kind of deny mechanism in Windows based on executable's name.
I searched the registry for executable's name but I did not find something relevant or meaningfull.
This situation occured after lot of crashes and updates of my program on that computer (I am a developer). One day, it suddenly started not to open files. I did not touch registry or did not change something other on OS.
My executable's name is karbon_tart.exe
When it start, it calls CreateFile (open mode if exist or create mode if not exist) to open karbon_tart.log file and karbon_tart.ini file.
With the files are exist and without the file exists, I tried two times and none of them, the program can open the files.
But if I just rename the name to karbon_tart_a.exe, program can open files no matter if they are exist or not.
Thank you for your interest
Regards
Ömür Ölmez.
I figured out at the end.
It is because of an old copy of my application in Virtual Store.

Tomcat Server creating Directories in tmp

Everytime my embedded virtual tomcat server is ran (spring boot) it creates a directory structure in /tmp/ that is named tomcat.##########################.8080 (I am guessing 8080 is for port or something but the 8080 is consistent). This structure does not take up much space alone but after running the tomcat server often over time this can fill up. Can I prevent this from happening as a configurable option?
An example of the path created can look something like:
/tmp/tomcat.1185139485157901.8080/work/Tomcat/localhost/_/
SESSIONS.ser
WEB-INF/ etc. etc. etc.
Unfortunately, both embedded and non-embedded Tomcat needs to have a directory to store temporary files. This is not configurable, however, you can specify the directory in which Tomcat stores these temporary files using setBaseDir.
This should be the first method called public void setBaseDir(String basedir) and if it is not specified in your code it will look for it in
system properties - catalina.base, catalina.home - $HOME/tomcat.$PORT
By knowing the location I recommend writing a simple scheduled script that checks every so often and removes the files under that directory.

source code location for debugging multiple instance of an application

Hi have an application running separateley (1 instance for customer) in different folders, 1 per each customer.
Each customer is a separate user on my machine.
At the moment I have the source code in each of these folders where I rebuild the code per each instance. Would it be better if I do something like the following?
create a shared folder where I build the code
deploy the binary in each user folder.
allow permission for each user to access the source code in READ ONLY mode.
when it is time to debug, by using gdb in each user folder will allow to read the source code and debug will happen.
Do you think that this could be a better approach or there are better practice?
My only concern is that each user has the chance to read the source code, but since the user will not access directly his folder (it is in my control) this should not trouble me.
I am using CENTOS 6.4, SVN and G++/GDB.
in different folders
There are no "folders" on UNIX, they are called directories.
I rebuild the code per each instance
Why would you do that?
Is the code identical (it sounds like it is)? If so, build the application once. There is no reason at all to have multiple copies of the resulting binary, or the sources.
If you make the directory with sources and binaries world-readable, then every user will be able to debug it independently.

log4j:WARN Please initialize the log4j system properly; still Log file created,but not in UNIX

I'm developing web application which has commons-logging.jar and for logging log4j.jar.
I got the following message when server start up.
log4j:WARN No appenders could be found for logger (org.apache.struts.util.PropertyMessageResources).
log4j:WARN Please initialize the log4j system properly.
But still log file is created and the format also same as specified in the log4j.properties.
The application log file is creating in Windows environment, But not in Unix environment.
Why it is not creating log file in UNIX ? Folder has write permissions..
Any idea?
Laxman Chowdary
The message you get on server startup is just a warning, your log file should be created inspite of it (you can find an explanation for the message in this post).
Why the file is created in Windows but it doesn't get created in Unix could be caused by lots of reasons: permissions for the user under which your application is running are first, maybe the configured path is still a Windows path (e.g. containing C:\ maybe), perhaps you meant to use an absolute path and forgot to prepend the / to it...
it's hard to say without seeing your configuration. Check these first and maybe update the question with the configs you are using.
Sometimes what can happen is that you use a relative path for the file and the file gets created relative to some folder in Windows and you expect it to be the same in Unix. But the "current folder" might be another in Unix. Maybe the file gets created but it's located in another place? Try searching for it on disk...

Not able to delete directory

I am having a frequent problems with my web hosting (its shared)
I am not able to delete or change permission for a particular directory. The response is,
Cannot delete. Directory may not be empty
I checked the permissions and it looks OK. There are 100's of files in this folder which I don't want.
I contacted my support and they solved it saying it was permission issue. But it reappeared. Any suggestions?
The server is Linux.
You can't rmdir a directory with files in it. You must first rm all files and subdirectories. Many times, the easiest solution is:
$ rm -rf old_directory
It's entirely possible that some of the files or subdirectories have permission limitations that might prevent them from being removed. Occasionally, this can be solved with:
$ chmod -R +w old_directory
But I suspect that's what your support people did earlier.
This could also be because your FTP client might not be showing the hidden files (like cache, or any hiddn files that your application might create), while the hidden files are preventing you from deleting the directory. (though, in your case, I am not sure if this is the cause .. .it could be permission issue with your hosting provider.. Webserver running as another user (like apache or www) combined with your directories having global write perms).
I assume that's a response from an FTP server?
Usually, a message from an FTP server really means it. If it says the directory is not empty, there might be certain files you cannot see that exists in the directory which maybe one of:
Your PHP/JSP/ASP/whatever scripts may run under a different user account thus creating files which you may not be able to see/delete
Is your hosting's web interface run under your FTP account? There might be conflicting permissions there if you manage some files from the web interface and then later via FTP.
Hosting server/operating system files created unintentionally e.g. from the hosting's web interface
If it comes from a script, write a one-time throw-away script that delete the files and that directory and then uploads and executes it.
And just to be sure, some FTP server doesn't support direct directory deletion, you need all the files first, is that the case?

Resources