Help coderanch get a
new server
by contributing to the fundraiser

Siva Prasad Reddy Katamreddy

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

Recent posts by Siva Prasad Reddy Katamreddy

Hi,
I developed a Simple WebService using JDK6's in-built JAX-WS support and deployed on Tomcat6 as a Web Project.
For that I need to copy jaxws-api.jar in TOMCAT_HOME/endorsed directory (due to some class loader issues) and some JAX-WS RI jars in WEB-INF/lib and finally it is working fine.

Now I need to write a Client for some other JAX-WS webservice deployed somewhere else and call it from my Web App that I created.

Here I am getting errors because of having the JAX-WS jars in my WEB-INF/lib folder.
I am able to call the webservice from a standalone java project without having JAX-WS RI jars on my classpath.

Can someone tell me how can I deploy a Web Project which is a WebService Provider and WebService Consumer as well?

Thanks,
Siva
12 years ago
Hi,
Can someone explain me what will happen when an Object is created or removed from memory at runtime?

Say for example, I just instantiated an Employee Object. Then what will happen in Memory?

Here I am putting my understanding on it.

First some memory will be reserved for the newly created Employee object in Heap memory, then initialize and store its defaults properties values, then a pointer to this memory location will be stored in Stack memory as a reference.

Suppose When an object is eligible for garbage collection and GC runs what is going to happen?

Will it remove the Object reference from Stack and clear the memory allocated on Heap?
If it cleans the Employee object from heap what exactly it will do on that memory location?

Can someone please explain whats really happening behind the scenes?

Thanks,
Siva
13 years ago
Hi,
I have a Quart job to be scheduled at two different timings.
ie First at every hour+25min and hr+55min from 8 AM till 6 PM and at 6:05, 6:25 and 6:35 PM.
We can create CRON expressions separately for those two timings as : 0 25,55 8-18 * * ? and 0 5,25,35 18 * * ?

Is there a way to create a single CRON expression that can trigger the job at both the timings mentioned in the two separate schedules?

Thanks,
Siva
13 years ago
Hi,
Spring Recipes is the best book for Spring.

Thanks,
Siva
13 years ago
Hi,

I mean sending the object with all the properties in relational way would me more meaningful.

Like

<customer>
<id>100</id>
<name>John</name>
<address>
<line1>aaaa</line1>
<line2>aaaa</line2>
</address>
</customer>

would be more meaningful than

<customer>
<id>100</id>
<name>John</name>
<address_line1>aaaa</address_line1>
<address_line2>aaaa</address_line2>
</customer>

But for JAX-RS, to send the customer data through Request Parameters we can send all by strings in flat way.

Thanks,
Siva
13 years ago
Hi,

Thanks for your reply.

I started playing with Jersy for a couple of hours and its really really easy to start with Jersy if you want to work with JAX-RS.

Based on my initial understanding, with JAX-RS we need to send the data through URL or as HttpServletRequest parameters for POST/PUT requests. But in realtime we may need to send a complex objects to consume the Web Services. It may not be practically feasible to send the data as a flat URL or Request parameters. We may want to send it as an Object(A complex object represing the business model object).

With JAX-WS we can prepare SOAP message for any complex request and send across to the Web Service provider.

Could you please clarify me in what scenarios we can go for Jax-RS and for JAX-WS??

For suppose if we are building a system to provide financial services to the world. Out Web Serice will take the Customer Identity information and provide their Account details, or do some transactions etc.

In such a case which one will you prefer?

Thanks,
Siva
13 years ago
Hi,

I have some basic idea on web services but never implemented in any of real time projects.
Now i want to learn java web service development and i got plenty of options when i googled for available java webservice frameworks.

Now the list i have with me is JAX-WS, JAX-RS(Jersy, RestEasy), Axis2, Apache CXF, Spring-WS .

Can anybody give me an idea on which one is better to start with and which is being used widely these days??

Thanks in advance
Siva :
13 years ago
Hi,

I have a table with 3 date columns and i want to find the maximum of 3 columns.

For Ex:
Table : EMPLOYEE(ID, Date1, Date2, Date3)

Now i want to execute the query:
SELECT ID, GREATEST(DATE1,, Date2, Date3) MAX_DATE FROM EMPLOYEE;

But Informix doesn't have support for GREATEST() function.

How can i do it in Informix?

Thanks,
Siva
Hi,

But even though we use Spring Remoting we should deploy the Spring Service jar file either in a .war or in a .ear file and in servlet startup we should instantiate the ApplicationContext. Am I right?

Thanks,
Siva
14 years ago
Hi,

We are planning to develop a web application following 3-tier architecture.
The web application will be deployed on Tomcat Server and I want to write my Services as POJO Services and wire them up using Spring and will be deployed on a JBoss server probably on some other machine. My DB server(MySQL) will be on some other machine.

Now my question is when we develop our service layer using EJB's we will make a jar file and put it in deploy(jboss) folder and when the JBoss server is started it will automatically scan through the jar and EJBs will be created by the JBoss itself. Now i can get an EJB by doing a JNDI lookup.

Now if i write my service layer using Spring POJO approach, i have my services ready (as a jar file) how can deploy/use these services from some other JVM/webapplication?

Thanks.
14 years ago
Hi,

The following code is giving the count value after for loop is 0. Can someone please explain me why?

14 years ago
Hi,

I got your point. You mean to say instead of storing 'ACTIVE', 'PROCESSING' etc it is better to store 1,2 etc where 1 mean 'ACTIVE', 2 mean 'PROCESSING' etc...

Nice solution if the DB design is in our hands. But if we have to interact with legacy DB design where in it is storing STRING status values the above mentioned CASE-WHEN approach might be the way to go...

Thanks,
Siva
Hi,

One solution which comes to my mind is as follows:

In my HQL i will write it as:

SELECT
CASE
WHEN emp.status='ACTIVE' THEN '1'
WHEN emp.status='PROCESSING' THEN '2'
WHEN emp.status='COMPLETED ' THEN '3'
WHEN emp.status='TERMINATED' THEN '4'
END status
FROM employee emp
ORDER BY status ASC

I hope it should work.

Thanks,
Siva

The other solution is cleaner, easier, and more extensible.



What is that solution??

Thanks,
Siva
Hi,

Once we got all the records we can sort it by using a Comparator.
But my question is how to implement it in Database side only?

Thanks,
Siva