J2EE ,EJB,Servlets:
> I am working on a J2EE applications which deploy servlets and EJB.
> I am implementing a logHandler which will log messages/events occuring on
> servlet as well as EJB.This logHandler is a class that implements
> runnable.
> * public class GolfLinkLogManager implements Runnable {}
> I have put some static methods in this class.( for example logMesg()).
>
> While deployment i included the class in both the WAR component and the
> JAR component.
> When i am instatiating the logHandler class in the servlet(WAR component)
> and then calling the static methods of the class in the servlet, the
> logHandler is working fine and messages are getting logged on a flat file.
> This is how i am doing this:
> public void init(ServletConfig config) throws
> ServletException{ //Servlet Code
>
> synchronized(this) {
> if (logManager == null)
> logManager = new LogManager();
> }
>
> LogManager.logMessages(0, "GolfLinkSystem",
> "sessionId", // logMessages is a static method
> 1,
> "GolfLinkCendantSystem",
>
> "Initializing the GolfLink System");
> }
> Eveything is working fine here.
>
> Now since the instance is availble and the methods of the logHandler are
> static, i am directly invoking
> LogManager.logMessages(0, "GolfLinkSystem", "sessionId",
> 1,
> "GolfLinkCendantSystem",
>
> "Initializing the GolfLink System");
> in the EJB(JAR component).Here the class is not recognised and no message
> is logged into the flat file.
> Also when i tried doing
> System.load(LogManager)
> this is returning an error saying : java.security.checkPermission
> error.Access Denied.
> Why is this happenning?
>
> Also since the instance i have already created in my WAR component will i
> have to pass the instance to EJB to call the static methods.
>
> What can be done here?
>
> Regards,
> Ritesh
>
>
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".