Win a copy of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java this week in the Agile and Other Processes forum!

Tripp Bishop

Greenhorn
+ Follow
since Aug 23, 2002
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
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 Tripp Bishop

David,

put your bean into the request object like so:

Object mybean = someobject;

request.setAttribute("mybean", mybean);

Then, on the JSP you can access the bean like so:

<bean efine id="thebean" name="mybean" scope="request" />

Make sure that you've included the struts bean tld in the JSP. Look in the struts docs for more info about the bean tags.

Cheers,

Tripp
15 years ago
Hmmm. I wonder if it has anything to do with Tomcat being embedded in JBoss. We never same the request.getSession() = null before we did that. The missing beans is something that we did see before. The question is what configuration setting(s) would even affect this?

Cheers,

Tripp
15 years ago
We're just calling request.getSession() and it is most definitely returning null (but only occasionally. The same action object will work fine and handle plenty of requests correctly, then all of a sudden it appears unable to find the session object).

On the second case there is no validation as there's nothing to validate. We're simply taking a DTO, calling request.setAttribute("blah", blah); and forwarding to the correct JSP. The JSP is unable to find bean "blah" in any scope. If you hit refresh, voila, the bean is magically there.

These are definitely sporadic problems. The same JSP finds the bean most of the time. Based on the other problem I'm inclined to thing that it's the request object in the action class that's causing the problems. I believe the JSP when it says it can't find the object.

Does this make it more clear?

Cheers,

Tripp
15 years ago
Howdy all,

occasionally it seems that from within our action classes calls to request.getSession() return a null value. Now, if a session hasn't already been established then that's expected behavior. However, we're getting this error after a session has definitely been established. Has anyone seen similar behavior or know why this is happening and how to prevent it?

We're also seeing Servlet exceptions in our JSPs complaining about beans not being found in any scope. The action classes are putting beans into request scope for the pages to use. If the user hits "refresh", magically the bean is found. This is a sporadic error. We know that the name of the attribute is correct in the request object.

We're using Struts 1.1 along with Tiles and Tomcat 4.1.27 embedded in JBoss 3.2.2.

Any help would be greatly appreciated.

Cheers,

Tripp
15 years ago
Howdy all,

I hope someone can offer me some advice on this as it's driving me crazy. A review of our server logs indicates that rather frequently our pages are throwing "Cannot find bean blah in any scope" errors. However, if the page is refreshed, the bean is magically found and the page works fine. Every so ofter, it would seem, the JSP is unable to find one bean or another on a page (the beans are put there by struts action classes). There error is sporadic so it's not that the bean name was misspelled. Most of the time it works. Is this a load issue? Is struts not robust enough to handle what is a very moderate load? Any help would be greatly appreciated!

Cheers,

Tripp
15 years ago
Howdy all. We recently moved our JBOSS application server onto a new box. We literally copied the jboss directory and all of its contents. We noticed the following stack trace when starting up JBOSS:

2004-10-21 13:21:11,782 WARN [org.jboss.ejb.EjbModule] Could not load the org.j
boss.resource.connectionmanager.CachedConnectionInterceptor interceptor for this
container
java.lang.ClassNotFoundException: org.jboss.resource.connectionmanager.CachedCon
nectionInterceptor
at java.net.URLClassLoader.findClass(URLClassLoader.java(Compiled Code))
at java.lang.ClassLoader.loadClass(ClassLoader.java(Compiled Code))
at java.lang.ClassLoader.loadClass(ClassLoader.java(Compiled Code))
at org.jboss.ejb.EjbModule.addInterceptors(EjbModule.java:803)
at org.jboss.ejb.EjbModule.initializeContainer(EjbModule.java:690)
at org.jboss.ejb.EjbModule.createStatelessSessionContainer(EjbModule.jav
a:494)
at org.jboss.ejb.EjbModule.createContain ...


And so forth. We finally tracked the class
org.jboss.resource.connectionmanager.CachedConnectionInterceptor down in the jboss-jca.sar. We also noticed that in the server.log it appears that this sar is loaded AFTER our code. Later, JBOSS reloads this SAR file but throws errors complaining about things that are already loaded.

One difference we noticed is that on our development server the jboss-jca.sar is one of the first things to be loaded. Is there a way to specify the order of things during the loading process?

Cheers,

Tripp
15 years ago
Nevermind. I was yet again the victim of "Cut and Paste". Turns out that I had opened the folder in READ_ONLY mode. Strangely, the folder doesn't throw an exception in this case.

-- T
15 years ago
Howdy all,

I've got a question about deleting messages. I'm marking a message to be deleted like so:

message.setFlag(Flag.Flags.DELETE, true);

Then, when I'm done I close the folder like so:

folder.close(true);

From everything that I've read this should be enough to delete the message from the POP3 server. I don't get any exceptions thrown but the message is still on the server.

Any ideas why this wouldn't be working?

Cheers,

Tripp
15 years ago
Joe,

I would recommend making an executable JAR. You'll obviously need the JRE installed on the client machine but you'll be able to just double click an Icon to start it up (assuming, of course, that you're in a GUI enviroment). Just do a quick search on google and you should find all the info you need to get going.

Cheers,

Tripp
15 years ago
Howdy all,

Is there a way to set the SMTP envelope's "From" address. I need to specify a value for this that is different from the "From:" header address. The reason that I want to do this is so that mails that bounce can be routed to special mailboxes that I want to monitor so that I can correct the recipient's address (or at least try). I know there's gotta be a way to do this (it's easy in PERL) but I havn't had any luck finding the answer or an example. Does anybody out there know how this is done?

Thanks in advance,

Tripp
15 years ago
Howdy all,
It seems like struts is losing the cookies used to maintain sessions. The problem seems to be random. It happens every so often but not in any reproducable way. Sometimes this happens in the action classes and other times in the jsps that make up our pages (we're using tiles). Has anyone seen anything like this before. It's quite maddening to us (the developers) and to our users.
Thanks,
Tripp
15 years ago
It's the browsers that are causing the problem. When the string is generated the format is correct. A lot of the time the links work. Other times I can see the data in the location bar change to the nonsafe format, then the operation fails. It's kinda odd. Not something that fails everytime.
-- T
Howdy all,
I've got an MD5 hash that I URL encode and put in a querystring. When the + character is in the hash I escape it with %2B. This seems to work fine except sometimes the browser will change it back to a + character. Then, the URL decoding turns it into a space and things break. Other times the browser (IE and Mozilla) will leave it alone (as %2B). Anyone know a fix for this???
Thanks
Tripp
Howdy all,
Here's my question. Given the following code:
Connection conn = null;
SavePoint savepoint = null;

try {
conn = ConnectionPool.getConnection();
dao mydao = new mydao();
mydao.task(conn);
savepoint = conn.setSavepoint("Beginning");
conn.commit();
mydao.anotherTask(conn);
conn.commit();
mydao.finalTask(conn);
conn.commit();
} catch(Exception e) {
conn.rollback(savepoint); // try/catch removed for clarity
} finally {
conn.close(); // try/catch removed for clarity
}
If I were to rollback to this save point (which is actually back to before the first command) and then closed the connection, would the transaction be terminated or would it be dangling on the database server, waiting for a commit() or rollback() to take place?
Thanks,
Tripp
Howdy all,
I'm trying to use the JDBCAppender that is supplied by the Log4j package to collect log entries in a db (naturally). However, I haven't come across a good example of the log4j.xml that shows what I need to create an appender of the JDBC variety. Everything looks right but since nothing seems to be happening I'm assuming that I've messed something up.
here's the appender snippet I'm using:
<appender name="JDBC" class="org.apache.log4j.jdbc.JDBCAppender">


<param name="url" value="jdbc:mysql://localhost/logs" />
<param name="user" value="test" />
<param name="password" value="test" />

<param name="sql" value="INSERT INTO LOG (log_dt, log_level, msg) VALUES ('test', 'test', 'test')" />
<param name="driver" value="com.mysql.jdbc.Driver" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%m" />
</layout>
</appender>
I then have the category entry as follows:
<category name="com.myclasses">
<priority value="DEBUG" />
<appender-ref ref="JDBC" />
</category>
Nothing is getting inserted into the database, but I can't find any errors in the server logs. I'm using Log4j 1.2.7 with JBoss.
Any ideas?
Thanks,
Tripp