Joseph Marques

Greenhorn
+ Follow
since May 01, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Joseph Marques

JSF and other component-oriented technologies are the perfect market for AJAX. With more and more vendors selling catalogs of components and AJAX-enabling the transport of parameters to bind to them, I would think the developers would have great ease of use while the business quick time to market. What do you see as the future for JSF/AJAX? Do you see it getting stronger or weaker? Will there be more integration, and if so how quickly do you think it will take off?
Recently I came across a database developer that didn't like to normalize. I wanted to use Hibernate to create an object representation of that data, but it was extremely difficult because things were very flat. Are there any handy tricks that anyone knows of to overcome scenarios like this? Any insight would be appreciated.
What are some of the more interesting questions regarding security that you've either heard asked in an interview or that you've asked during an interview?
19 years ago
I actually solved my issues not too long after I made the post. Here's what worked for me.

Files Needed:
jakarta-tomcat-5.5.9.exe
jakarta-tomcat-5.5.9-admin.zip


1. Install tomcat
2. Unzip the admin package (we'll call it <admin> context)
3. Copy the entire directory <admin>/server/webapps/admin to <catalina_home>/server/webapps
4. Copy the file <admin>/conf/Catalina/localhost/admin.xml to <catalina_home>/conf/Catalina/localhost
5. Restart your server, if it was running


For some reason, I could have swore I did all of that at one point, but I still kept getting the error that I original posted. I suspect that in the course of messing around with server files, I accidentally did something that caused this correct solution not to work. At that point, being a relative novice, I simply uninstalled/reinstalled tomcat (as the simplest solution), and then followed my instructions from step 2.

Let me know if it works for you.

-joe
19 years ago
I'm running:

Eclipse 3.1
Tomcat 5.5.9
MySql 4.1

I've downloaded the eclipse plug-in for Tomcat (tomcatPluginV31beta.zip) from http://www.sysdeo.com/eclipse/tomcatplugin. I've installed it, and so far it's working pretty well, but I have a few questions.

As I understand it, this plug-in allows me to use my workspaces in eclipse to perform automated deployment to the Tomcat server. I did this so that I would not have to export the webapp as a WAR and install it in the server every time I made a code change. But how specifically does it work?

Here are my assumptions (correct me if I'm wrong):
<CATALINA_HOME>/webapps - contains apps that are currently installed
<CATALINA_HOME>/work/Catalina/localhost contains running/installed webapps

So does the plug-in then make the following substitutions?
workspace/<proj> - <CATALINA_HOME>/webapps/<proj>
workspace/<proj>/work - <CATALINA_HOME>/work/Catalina/localhost/<proj>

Also, there is the <CATALINA_HOME>/conf/Catalina/localhost directory to contend with. Normally, I would include a file called <proj>.xml in there, which configures the <proj> application. I've heard about a file in the eclipse workspace - META-INf/context.xml. Does the plug-in take this context.xml file, move it to the conf directory, and rename it <proj>.xml?

Thanks in advance,
-joe
What do you mean that "Tomcat" isn't sorting your directories? Are you trying to execute a piece of code, and that code isn't returning the directories in the order you desire? If so, please post the code fragment and I'll try to help.

-joe
19 years ago
I'm running:

Eclipse 3.1
Tomcat 5.5.9
MySql 4.1

I've downloaded the eclipse plug-in for Tomcat (tomcatPluginV31beta.zip) from http://www.sysdeo.com/eclipse/tomcatplugin. I've installed it, and so far it's working pretty well, but I have a few questions.

As I understand it, this plug-in allows me to use my workspaces in eclipse to perform automated deployment to the Tomcat server. I did this so that I would not have to export the webapp as a WAR and install it in the server every time I made a code change. But how specifically does it work?

Here are my assumptions (correct me if I'm wrong):
<CATALINA_HOME>/webapps - contains apps that are currently installed
<CATALINA_HOME>/work/Catalina/localhost contains running/installed webapps

So does the plug-in then make the following substitutions?
workspace/<proj> - <CATALINA_HOME>/webapps/<proj>
workspace/<proj>/work - <CATALINA_HOME>/work/Catalina/localhost/<proj>

Also, there is the <CATALINA_HOME>/conf/Catalina/localhost directory to contend with. Normally, I would include a file called <proj>.xml in there, which configures the <proj> application. I've heard about a file in the eclipse workspace - META-INf/context.xml. Does the plug-in take this context.xml file, move it to the conf directory, and rename it <proj>.xml?

Thanks in advance,
-joe
19 years ago
There are two ways that you can get connection pooling:

1) Write it yourself. This is pain-staking and requires you to create individual connections and manage the access to them yourself, coordinating threading issues, and generally making your job an annoyance.

2) Let your provider take care of it. Even cheapo jdbc/odbc provider implement some form of minimal connection pooling. Basically, when you call,

ds.getConnection()

you are getting one of the available connections from the pool. My suggestion would be to turn your DAO into a semi-cache, where you lookup the DataSource once from the context and cache it's value. Then, you have other methods that simply use the DataSource to get new connection instances.

Furthermore, you should know that when you call conn.close(), you aren't actually closing the connection, you're releasing it back to the pool.

-joe
19 years ago
Well of course

tomcatContext = (StandardContext) initialContext.lookup("java:comp/env");

compiles just fine. The lookup returns an object, and you're down-casting to some other type. A compiler does not konw what subtypes of objects were put into the context, and it can't possible know what the string "java:comp/env" will be mapped to in a target environment anyway.

Then, at runtime, the "java:comp/env" is mapped to one type of context object, but you're trying to cast it into another - ClassCastException.

My two cents,
-joe
19 years ago
I understand that in Tomcat 5.5 they decided not to install the admin app by default. So, I downloaded it separately (jakarta-tomcat-5.5.9-admin.zip) from the Windows installer (jakarta-tomcat-5.5.9.exe).

However, when I deposit the admin app's conf and server directories into Tomcat's respective directories, I can't access "/admin" in the browser. It reports the error "Tomcat's administration web application is no longer installed by default. Download and install the "admin" package to use it."

I'm wondering if there is something that I have to do to one or more of the configuration files (admin.xml or others) after putting them in the conf and server directories to get them to correctly map the "/admin" to the installed app.

Also, I performed a search for the exact text of the error, and found one file - index.html - in the {installDir}/webapps/ROOT/admin directory. I tried deleting this file, to see if it would give me a 404 error instead, but the browser just kept feeding me the same "...no longer installed by default..." error - so I'm stumped.

So I have a couple questions:

1) How do I correctly install the admin app for Tomcat 5.5.x?

2) What is the special ROOT directory under {installDir}/webapps used for?

3) What is the difference between the {installDir}/webapps directory and the {installDir}/server/webapps directory?


Any and all help is appreciated.

Thanks in advance,

-joe
19 years ago
I had success in connection to Remote MQ box from my local WSAD Test server.

>> I'm trying to connect to MQ on the same box, which is why "bindings" mode is allowed, instead of "client" mode. Bindings then relieve the administrator from providing a channel, port, and host.

JMS radio button has to be disabled in WSAD Test Server configurations. All other configurations.

>> Yup, everything is definitely disabled on the JMS tab in the server configuration.

You need at a minimal MQ Client (not full client and Server) in your local machine to connect to remote MQ box.

>> Hmm...this makes me question something: How exactly does the app server communicate to MQ if they are both on the same box? I would like to assume that it shouldn't need the client to be installed at all, but I suppose I should look it up just to be sure.

All configurations in WSAD have to be done via Admin console. Thhe configuratiuons necessary in WSAD is the same as if you were using WAS box instead to connect to remote queue.
Settings required are:
A) Disable JMS in WSAD Test Server.
B) Enable Admin console in WSAD Test Server.

>> yup, did that

Open Admin Console of WSAd Test Server. Do the following configurations:

1) Add a Variable to point to the location of MQ Client in your local box(need to install MQ client in local WSAD/WAS box).
2) Add Message Listener though Listener Port link
3) Configure Connection Factory
4) Configure Queue

>> Yup, I did all of that too. One question: is it OK if the location of my MQ variable has spaces in the directory name?

You need to know Channel information.

The same setting can be done in WAS box (also in WSAD) to connect to remote queue.
My system is as follows:
WSADIE v5.1.1 with WMQ 5.3.9

I want to set up my development environment to use external MQ. However, when I configure the queue and queue manager resources I get the following nested exceptions:

J2CA0020E: The Connection Pool Manager could not allocate a Managed Connection:
...
javax.resource.spi.ResourceAllocationException: createQueueConnection failed
...
javax.resource.spi.ResourceAdapterInternalException: createQueueConnection failed
...
javax.jms.JMSException: MQJMS2005: failed to create MQQueueManager for 'localhost:WAS_localhost_server1'
...
com.ibm.mq.MQException: MQJE001: An MQException occurred: Completion Code 2, Reason 2059
...
MQJE011: Socket connection attempt refused
...
Caused by: com.ibm.mqservices.MQInternalException: MQJE001: An MQException occurred: Completion Code 2, Reason 2059
...
MQJE011: Socket connection attempt refused

Since the dev env and the MQ are both on the same box, I know they can communicate in a simplified way. So, when I created these resources I left the channel, host, and port all empty, because I did not need to switch from bindings to client mode.

Now, I even tried the suggestion from glbondy, but that didn't seen to help, so I ended up changing my queue manager from host_name to localhost.

One question I have is why the name of the queue manager in the exception is 'localhost:WAS_localhost_server1' instead of simply 'WAS_localhost_server1'.

On last thing, I have operating system security turned on. But, again, I think this issue falls away because I'm using the pieces all on the same box. WMQ should assume that, since the request isn't coming across from a remote client, that the caller is already authenticated.

Any and all help would be greatly appreciated.

-joe