This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes EJB, log4j, and access denied to Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB, log4j, and access denied to" Watch "EJB, log4j, and access denied to" New topic

EJB, log4j, and access denied to

nick Hussein

Joined: Nov 16, 2003
Posts: 4

I am tried to get to log4j to work with Sun's App Server, 1.3.1. The java
machine that I am running is 1.4.2_03. Linux is red had's linux 9.2.

I am getting an error :

.. access denied ( /tmp/ read).

The code that I have in my entity bean is placed in the ejbCreate():

PropertyConfigurator.configure ("/tmp/").

Additionally, I've modied the java machines' java.policy file in the home
directory of the java installation. Via the policytool I've the added line:

grant codeBase "file:/tmp/*" {

Any help is appreciated or if you have a differnt method to allow the App Server access to the I've also tried to place the file on the class path of the J2EE server. That did not work with but it gave me a different error:

log4j:WARN No Appenders could be found for logger...

If you got it working, I do appreciate your help.

nick Hussein

Joined: Nov 16, 2003
Posts: 4
I may answered my question. I've found the following comment on another conversation thread. According to this comment, what I am trying to do can not be done..Here is the comment that I've found:


EJB spec explicitly indicates that (section 24.1.2 Programming restrictions):

An enterprise bean must not use the package to attempt to access files and directories in the file system.
The file system APIs are not well-suited for business components to access data. Business components should use a resource manager API, such as JDBC, to store data.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: EJB, log4j, and access denied to
jQuery in Action, 3rd edition