Travis Hein

Ranch Hand
+ Follow
since Jun 06, 2006
Merit badge: grant badges
For More
http://www.travnet.org
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Travis Hein

I guess your applet could on boot up do a fetch, such as from URL the rampart and addressing mar files, and then stuff them into a local temporary folder.

for example.
* create a temporary folder on the local machine (e.g. File.createTempFile)
* pull down the mar files from the URL on the server into these machines.
* configure the axis2 context to refer to this temporary folder as the modules folder.

Other than that, I guess it might be possible to instruct axis2 to use a custom URL class loader which would load the modules directly from the URL, but doing that is not clear to me at this time.
12 years ago
In that case, if you are using that web.xml security role policy things, you might need to find some kind of container provided mechanism to ensure the request object has the user principal and roles populated before the web application is invoked.

That is, one of the realm implementations that come with tomcat (see http://tomcat.apache.org/tomcat-5.5-doc/realm-howto.html) so the user is authenticated and roles are populated into the request before your webapp is invoked.

I created my filter as a work around to having to make use of the container provider realms. Where I stuff in the user principle and roles into the request object with this filer, after I have looked them up in my own mechanism. This was suitable for my use as the application also worked with a 'profile manager' outside of a web application container, so I didn't want to get into contain-specific realm configurations.

Though that also likely makes this filter not compatible with standard web.xml realm and security configurations.
13 years ago
Right, this filter to fetch the authenticated user's role would be mapped to urls of the pages you want protected.

The login page should not be protected by this user role filter, so as to allow the login handler retrieve the user profile and stuff it into session attributes, or how ever you implemented my sample above filter to find the user information to stuff it into the UserRoleRequestWrapper

Additionally, since this filter only makes the user principle available, but does not do any policing logic, perhaps another filter that is also mapped to these role protected pages after this one, that would redirect you to the login page if the user principal is not found in the request, or display an error if the user does not have sufficient role privileges.
13 years ago
It's possible that tomcat has the java standard tag library (JSTL) bundled with it, in it's lib folder, so the web application deployed into tomcat just works. Where weblogic might not have the JSTL library, or possibly a different version and that URL is not finding it.

You can try to add the JSTL .jar files (such as jakarta standard tags http://tomcat.apache.org/taglibs/index.html) into your WEB-INF/lib inside the .war file, so that when this application is deployed into webspehere, it should just find these. This should also still allow it to work when deployed into a tomcat instance.

14 years ago
The junit cookbook is pretty good.

http://junit.sourceforge.net/

Most of my use is to use the JUnit 1.4 annotations, which works on any method, such as maybe one in your class, instead of needing to create a separate class that extends their test case, for example.

14 years ago
in windows, use the delimiter for classpath is semicolin (;)

So specify each path to be used, maybe use quotes if the path has spaces in it.

And to have the javac placed into the output folder, the -d parameter to javac to have it output into the desired output folder



Or, you should be able to specify the -sourcepath "C:\MyDir\src" as well to have it know to look in the src folder.

It has been so long since I have done anything with javac, years ago I started using Ant, the XML build file makes sense as it saves a lot of time typing all that stuff in, it reduces the chances of me typing it in incorrectly, and it is cross platform .
Maybe make the Role and Person beans also implement Serializable interface. The RolePk bean does.
I am confused why you would 'boot up' an application context from inside an action handle method like this, in this case, the path is a constant string (not dynamic based on request parameters), why would you not have the spring context servlet listener start it up for you when the web application starts up ?


ApplicationContext context = new ClassPathXmlApplicationContext("E:/Program Files/Apache Software Foundation/Tomcat 6.0/webapps/springhibernate/src/beans.xml");



But this current error here is because you are usung a ClassPathXmlApplicationContext, which wants the String constructor argument to be an expression to some place on the CLASSPATH, for example "/com/mycompany/myapp/beans.xml", where here, this "E:/Apache....src/beans.xml" thing is a file system path,

so try to use the FileSystemApplicationContext here instead.


14 years ago
In that first sample class, the class was modified by making it implement the Comparable interface, and thus the compareTo method.

The example there doesn't show a second class implemented differently. but assuming instead of wanting to have many instances of this class sorted by the property sorted here, we could subclass it and override the compareTo method.

in this example, it doesn't really show why we would do that, consider a class that had more than one string property, maybe an id, an age, a name. So the compareTo in this person class might by default sort by name. Now if we created a subclass birthday list entry say, to have it sort by age instead.

so jamming the object instances into something that naturally sorts, such as a TreeSet, or using a sort operation on the colletion, would cause the instances of person class to be sorted differently from the instances of birthday list class. I guess we could have some configurable external proparty that each object instance would know how to retreive somehow so that we could configure sorting by different properties in the one class, where this variable would drive the compareTo method implemented here, that would not need to have a new object type subclassed etc to have different sorting.

in that second example, you seem to be wanting to compare something that implements a comparable interface with something that does not. in that case you would have to come up with your own code that meticulously inspects each property in the A, and B ones, so that you end up coming with something that returns -1, 0,or +1 in a manner like the built in compare thingie would, but in this case, unless you made this logic into a wrapper class that implements Comparable interface, the Java built int utilities for comparing (or sorting) would not be able to make use of this.
well, in modern servlet specifications (what is it, 2.4 I think?) it is possible to use JSP syntax in a file to create a tag library, that is instead of creating Java class that extends the Tag support class and creating a .tld descriptor XML file, it is possible to create a WEB-INF/tags folder,and inside there, create a folder for each tag library (prefix), and a JSP-syntax file, with the ".tag" extension, that will be compiled into a Java class that extends the JSP tag support class, instead of a servlet.

See also: http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSPTags5.html
I still love to read their HTML manual, the one page edition online.

http://www.springsource.org/documentation

Good amount of examples in there.
14 years ago
if this is a JDBC data source set up into the JNDI namespace, using the context.xml in the webapp (and possibly deployed into conf/Catalina/localhost or something like that).. or maybe it is defined in the conf/server.xml itself, there is an option in the commons-dbcp (what is used to create the JDBC connection pool), to specify maxActive="nnn" where nnn is the maximum active connections allowed.. If this is not set, set it to something like 20 for now, if it is set, try increasing it.

Though usually the problem of running out of JDBC connections is not due to heavy concurrent load, but a problem (e.g. bug) in the application, where connections are obtained but not being released, that is, there is likely no close() being called somewhere inside a finally block, like

14 years ago
the apache 2.2 or even 2.0 will work. 2.2 is probably default install for most modern linux distributions. usually there is even a package to have this installed.

then to connect apache to tomcat, you will want the mod_jk apache module, which usually also is available as a pre-built package for your distribution.

I recommend trying to work within the package manager builds if this is your first time getting this set up, it is possible to compile apache and mod_jk from their sources too, but usually this would be only required to enable support for special modules not in the default distribution, or to have a hardened locked down build with some features removed, or to have everything exist in a non-standard prefix.
14 years ago
I remember when in runlevel 4, the X11 mode, it sometimes turns off the other TTY terminals, leaving F7 for the X manager, and F6 for one shell.

After logging in on one of them, can you try to "telinit 3" to change to runlevel 3.

if the terminals start up again on the 1-4, then check the inittab to make sure the entries are enabled for run level 4 as well.

14 years ago
final generally means "cannot be changed"
static generally means "exists outside of an instance of an object".