Rohit David

Greenhorn
+ Follow
since Feb 18, 2008
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 Rohit David

Guys thanks for your quick responses.
I definielty don't want to get tied into a legal issue over a small web application.
Well I shall try to seek for my info thru their website.
However if you or anyone else reading this has any other idea please do not hestiate to share.

Thank you,
9 years ago
Hello having searched extensively on Google without much help I have decided to post under the "advanced" section hoping to get help from the Java experts. I am building this web application which requires to get auto quotes based on a form filled by user. I was told (and haven't been able to confirm on this) that major insurance companies sell access to their quote system. My question
1) If I can bypass having to go though insurance companies that would be the best route. So can I some how access the quotes either thru http query or some free web service?? Has anyone done something like this?
2) If I have to go though major insurance companies, how do I start. For ex: who do I have to contact in Allstate to get info on accessing their quote system? Cost, etc.
Any help would be appreciated.

Thanks
9 years ago
nope. No one replied back. I am assuming you are trying to do something similar. However I found an alternative. I am configuring an env variable in the web xml. This url will offer more insight into this approach
http://wiki.metawerx.net/wiki/Web.xml.EnvEntry

After reading the url as string I conver it to a URL by doing a java.net.URL url = new URL (String value);

Hope this helps.
10 years ago
This would work great and i would have used this approach, but the problem is we have like 5 enviornments (dev, test, prod, train, stage) and each one has its own app server. It would just make it so much simple to load the file from a url. This way one copy of the prop is used in all 5 env. And this is what I am trying to do and would like some assistance. I have the code to load a prop file from url, but once I get access to this file how do I make the setting visibile to the application.

However thanks for your help.
10 years ago
I have figured out how to load a property file from a url and use the PropertyResourceBundle to get the properties. However once loaded how do I make this property file visible to the application? Is there some log4j object I can call and provide it with reference to the property file accessed from url? Any help would be appreciated.

The reason for me to do this is because its getting very inconvenient to make changes to log4j prop file from a WAR file and it always involved re-deploying and restarting application. Instead having a prop file in a remote location, which can be accessed by the application using url makes things much easier to use and make changes. If there is another approach to doing what I would like to do without using url methodology then kindly state.

I am currently using tomcat 5.5 and eventually I would be deploying this app to Websphere.

Thanks
10 years ago
I am trying to replicate the Websphere's URL Resource provider functionality in Tomcat, but haven't been really successful. So what I would like to do is access a properties file from a URL. This provides a convenient approach to modifying prop files as apposed to residing within WAR file. Anyway back to my question, I have taken a stab at this and below is how my meta-inf\context.xml, web.xml, and jndi code snippet looks.

CONTEXT.XML

code:
--------------------------------------------------------------------------------

<?xml version="1.0" encoding="UTF-8"?><Context> <Resource name="url/wfresource" auth="Container" type="java.net.URL" url="http://localhost:8080/ibi_html/wfresource.properties"/></Context>

--------------------------------------------------------------------------------



WEB.XML

code:
--------------------------------------------------------------------------------

<resource-env-ref> <description>Object factory for MyBean instances.</description> <resource-env-ref-name>url/wfresource</resource-env-ref-name> <resource-env-ref-type>java.net.URL</resource-env-ref-type></resource-env-ref>

--------------------------------------------------------------------------------



JNDI Lookup code snippet


code:
--------------------------------------------------------------------------------

//Get a handle to the JNDI environment naming contextContext env = (Context)new InitialContext().lookup("java:comp/env");//Get a single valuejava.net.URL destURL = (java.net.URL)env.lookup("url/wfresource");

--------------------------------------------------------------------------------



Its throwing an exception.

My question is if URL resource configuration is possible in Tomcat 5.5, and if so how.

thanks
10 years ago
I have figured out how to load a property file from a url and use the PropertyResourceBundle to get the properties. However once loaded how do I make this property file visible to the application? Is there some log4j object I can call and provide it with reference to the property file accessed from url? Any help would be appreciated.

The reason for me to do this is because its getting very inconvenient to make changes to log4j prop file from a WAR file and it always involved re-deploying and restarting application. Instead having a prop file in a remote location, which can be accessed by the application using url makes things much easier to use and make changes. If there is another approach to doing what I would like to do without using url methodology then kindly state.

I am currently using tomcat 5.5 and eventually I would be deploying this app to Websphere.

Thanks
10 years ago
I am trying to replicate the Websphere's URL Resource provider functionality in Tomcat, but haven't been really successful. So what I would like to do is access a properties file from a URL. This provides a convenient approach to modifying prop files as apposed to residing within WAR file. Anyway back to my question, I have taken a stab at this and below is how my meta-inf\context.xml, web.xml, and jndi code snippet looks.

CONTEXT.XML


WEB.XML


JNDI Lookup code snippet



Its throwing an exception.

My question is if URL resource configuration is possible in Tomcat 5.5, and if so how.

thanks
10 years ago
yes after giving it a thought thats what i plan on doing. Thanks all of you for all your help and assistance.
10 years ago
Thanks so much for your prompt reply, you do bring a good point forward security. Well this application is going to be limited to intranet only.
10 years ago
I am incorporating a third party API and in my WAR file I have a properties resource file which contains authentication and server access information. However having a resource file within a WAR is getting inconvenient because anytime server or authentication information changes, the prop file needs to be updated and the WAR needs to be redeployed.

Well I have figured out an easier way to access the prop file by invoking it from a url using the code below:

<code>
try{
URL destURL = new URL( "http", <IP address>, "/" + "MyRemote.Properies" );
URLConnection connection = destURL.openConnection();
InputStream is = connection.getInputStream();
PropertyResourceBundle MyBundle = new PropertyResourceBundle(is);
} catch ( java.util.MissingResourceException e ) {...}
catch (MalformedURLException e2) {...}
catch (IOException e1) {...}

</code>

However I do not like the idea of hard coding the url with my source code. I would like to make it more dynamic such that it can be accessed either from an environment variable or from the application server setting or some war file xml document. And this is where I need some advice and guidance. I am currently testing in Tomcat, but will be deploying eventually in Web sphere. So I would appreciate a answer which will be compatible with both app servers.

Thanks,
10 years ago
Hello, I am trying to find a solution to my perplexing Java web service issue. I have probably spent few days, search forums and Google, but haven�t found anything relevant. In addition, this is my first Web service. Therefore all you pros about there please �please� please be easy with the terminology.

First my development environment:
IDE: Eclipse JBOSS edition version 2/ Build: 2.0.0 Beta 2
Application Server: Tomcat v5.5
Web Service Run time: Apache Axis 1.3
JRE: Java 1.4
Web Standard Tool: v1.5

Problem:
When I test my Web Service using the Eclipse web Service Explorer, the issue I am facing is with custom Web Service accepting more than one parameter. For example, if I enter non-null values, and when I test my WS using the Explorer on the console I can see that the second parameter�s value always is null (when I explicitly specified a non-null value). And if there are 3,4,5,6,7� input parameters and if I enter non-null value for each, leaving the first one all get passed as null to the WS during run time.

This is getting very frustrating and I am losing my confidence with Java. However, I feel there is some setting I am probably over looking. The SOAP envelopes will provide insight as to what I am facing.

I don�t know why this happening, but my guess is its something to do with tomcat�s http max length and I have tried looking for this but couldn�t find anything relevant either.

Any help would be appreciated.

Below is how my sample class looks.
Also, I was invoking the setLatestStockData method from Eclipse WS explorer.

10 years ago