Simon Good

Ranch Hand
+ Follow
since Sep 19, 2002
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Simon Good

Does an ejb referred to in an ejb-jar.xml descriptor actually have to be in the ejb.jar?

By using the classpath, can the ejb class not exist in another jar and be referred to via the classpath? Would an entry in the manifest of the ejb.jar referencing the jar file containing the actual EJB class not suffice?

Thanks
If I was you I'd write my own implementation of a javax.security.auth.spi
LoginModule.

If you want some simple examples to mess about with and get some ideas of what to do look at these http://free.tagish.net/jaas/index.jsp.

Hope that's enough to get you started
19 years ago
Just finished writing a custom login module that I can deploy to my tomcat installation. I declared the datasource that the login module uses as a global resource in the server.xml and was trying to look it up in my login module when doing the Authentication / Authorisation stuff. The problem I had was that I couldn't find the datasource in the JNDI tree, I quickly realised this was because the login module was looking in the context for the web application and therefore I needed to create a link which I did it using a . So what I don't understand is why I needed to do this. Given that the login-module is actually part of the container rather than a specific web application why can it not see globally available resources. I just need a bit of clarification on this if anyone is willing to offer it up.
19 years ago
Trying to get JAAS up and running with JBOSS 3.2.6 (including tomcat),
I'm using FORM authentication, I've declared the login.jsp correctly, I've got my login-config.xml defined, I've declared the relevant security-constraint and the security role in web.xml, I've put the security-domain in the jboss-web.xml etc etc.
When I try to login using my login.jsp I always get the access denied page ie the authentication isn't working.
Everything that should happen seems to happen, I can see JBOSS attempting the authentication, the debug output is :


The application-policy declared in my login-config.xml uses DatabaseServerLoginModule and ClientLoginModule. I want to be able to call some EJBs following authentication and I understand that I need ClientLoginModule in order to avoid having to authenicate over again when I call something in the EJB container. The principlesQuery and rolesQuery are both correct. I know that the username password I'm supplying are valid because I've written some test code to see if I can login and when I look at the debug statements in my code I can clearly see a Subject populated with Principals one of which corresponds to the username password I'm supplying.

I'm unsure of the role of the auth.conf file in all of this, is it relevant when I'm using tomcat deployed inside JBOSS? Is there anything else I missed?
19 years ago
Worked it out

I already have a FileChannel open on the source file somewhere else in the code. Bit of a misleading message in the exception though.

Cheers
19 years ago
Yep, here ya go........

19 years ago
Why do I get this error

java.io.IOException: Error performing inpage operation

when I try to copy a file from a server to my local disk?

I'm using nio FileChannels

Someone help - please!
19 years ago
And there lies the problem........

I seem to be unable to delete or rename the file all the while I have a FileLock on that file. Is that the expected behaviour or am I possibly doing something wrong?
19 years ago
I've got a bunch of client apps all polling a single remote directory for new files, when one of the clients sees a new file it locks the file using a FileLock and copies it to another directory. Once that's done I need the client to delete the original file.

The problem is that unless I release the FileLock I can't delete the file, that's not ideal since another client could theoretically obtain a FileLock on the file before the first client gets a chance to delete.

Is there an obvious way round this?

Cheers
19 years ago
A user is using website 'X' that incorporates a number of pages that go into making up a complete business process. There is a dependancy upon, for example, page 'C' in as much as page 'A' and 'B' must have been completed. The user for some reason decides to put page C into their favourites. They complete the business process and go and away. At some point in the future they look in their favourites and choose to go to page 'C' of web site 'X'. Now obviously everything will fall a part when the request is made because they've jumped into the middle of a business process. So how does one get round this kind of thing?

I'm using struts so the user is actually booking marking a url that looks like http://www.mydomain/mywebapp/pageC.do. As soon as the user requests this URL there will be a load of RuntimeExceptions that occur because the information that should be in the session, application won't be there.

Are ExceptionHandlers of any use?

If I were using a security model this problem wouldn't exist since they wouldn't have authenticated and they'd be kicked out by the app server, but I'm not, so it does!

Hope that makes sense
20 years ago
Given that a user maybe stupid enough to book mark a jsp page that's midway through a business process, should I be writing code to handle this kind of thing.

Actually in my instance the user would be book marking a '.do'. Obviously they'll arrive at the action and that action is going to start throwing RuntimeExceptions because everyting that it expects to see in the request, session, application etc won't be there.

What's the general approach to this kind of thing? Use ExceptionHandler and forward to a standard error page
20 years ago
When I try to run a TestCase from within Eclipse it runs the setup() method for every test method within that TestCase. I'm sure this isn't the right behaviour, the setup method is causing a failure but only because it's being executed more than once.

Any ideas why this is? Presumably it's a config issue in Eclipse.

Cheers
20 years ago
Personally speaking, the justification for re-writing the app using struts is that I could then put it on my CV.
20 years ago
Hi
How do I go about calculating the number of days between two dates? Is there a simple way to do it?
Thanks
20 years ago
I set up my datasource when the context is created, then when ever I need a connection I get one from the datasource using getConnection(), use the connection, then close it.
If I create that connection from the init method of the servlet I'm now hogging a database connection for the lifetime of the servlet.
Maybe I've missed the point.