Udayan Kumar

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

Recent posts by Udayan Kumar

All,

I am planning to implement a file watcher utility similar to one as mentioned in this link
http://download.oracle.com/javase/tutorial/essential/io/notification.html

My question is related to options in the java space on how do I keep this utility up and running all the time to listen to the file change events.
Should I create it as a web component and deploy it in a web/application server or resort to creating a java program configured to run in OS level scheduler.

Do post your thoughts on how to go about the scheduling aspect for this utility.

Thanks,
13 years ago
All,

For my new project we are using top-down approach to web service development and as we go about creating xml schemas and wsdl operations increasingly I feel OO concepts of polymorphism and inheritance will not fit in naturally. This is related to the inputs to wsdl operations. All inputs now don't extend any domain class. I am not sure there is a way to do it nor is that my question.
So as I go about creating/customizing the java code produced by the wsdl2java converter I see it difficult to fit the OO concepts and relying more on compose-always design paradigm.

Is this fine and good sign and also is it a generally preferred behavior with top-down implementation.

Let me know your thoughts

Regards,
13 years ago
Hi All,

I have a java batch which is a long running transaction. The feature I am trying to built is something like this.

In the event of jvm crash or process exit due to any reason I want to track the abrupt halt and store some information as part of the batch in a status table which will help in recovering the next time around the batch is resumed. Also is there a way to resume a batch operation in an application server environment.

I understand this can be done using Batch scheduler systems like AutoSys and Ctrl-M but I am looking for a solution in the java or java appserver space.

Let me know your thoughts on how best can this be handled.
13 years ago
Hi All,

I have been using web services for a while and have used both approaches bottom-up and top-down. In both cases we have deployed the web service to app server and release the URL which in-turn is used by the calling web service client. In all these cases client knows the actual URL of the web services they want to consume. Recently I read about location independent web services and dynamic discovery and would like to know how this is actually practiced in the real world.
How can I deploy my web service to be location independent and how clients can dynamically discover without having the knowledge of the existence and interface of the web service they are invoking. Is this something similar to the Service Locator design pattern

Let me know your thoughts.

Thanks.
13 years ago
Can someone respond.

The WSDL we have created in this scenario is a combinations of the WSDL's from two other web services. Is there a way where in we can provide an instruction to suppress the need for namespace in SOAP payloads or to automatically set the namespace attributes in the SOAP payloads.

When I use the underlying web service WSDL directly to generate the w/service client stubs and use the same from the java front end apps it seems to be generating the SOAP request payloads correctly.
14 years ago
All - I currently have to write a java client which consumes a RPC web service.

I did use the SOAPUI utility to verify the web service and I am able to see the response from the web service. But only when i pass the SOAP request and all the containing elements in the body contain namespace qualified attributes something like this

<com:testOperation>
<testInputObject xsi:type="ns1:com_example_app_model_TestInput" xmlns:ns1="http://com.example.app.facade/TestWebService1.xsd">
<scoreDto xsi:type="ns1:com_example_app_model_ScoreInput">
<requestType xsi:type="xsd:string">N</requestType>


If I don't provide the namespace attributes I run into "No Deserializer found error"

For the java web service client I am using generated stubs. How can I set the namespace attributes for each and every element I pass in the java equivalent of the SOAP request payload.

Do let me know your thoughts.

Thanks,
14 years ago
Sorry for the late reply.

Rather than executing an external batch file I want to offload the current task to a new instance of JVM as mentioned in your post to insulate the app server from disasters.
From the servlet I call a method in a class and want this entire process to be shifted to a new instance of JVM.

We have our workflows clearly defined when we want this sort of behavior in the web app.

I tried searching on this but did not get much info so If someone has implemented anything similar do share your thoughts


Thanks Again
14 years ago
May seem to be a dumb question but is there an option where a call can be initiated from the app server and the memory intensive task of running the actual java (long running batch) application can be offloaded to use another JVM on the same machine w/out interfering with the app server's resources.
14 years ago
All,

I have a scenario where in we have to run a java application as a batch operation. i.e. the java application will be executed a 100k or more times once a month.
The app in question is a core java application which makes use of few Apache utilities and Hibernate to communicate to the database.

I want to understand if it is ok to deploy such an application (batch intensive) on an application server. The plan is to provide a basic harness UI page to trigger the java batch operation. Is this inadvisable approach considering the impact on the performance of the app server as the batch operation would take quite a while?

The other option is to run the application as a standalone where in someone would have to trigger the application at periodic intervals. I looked at batch task utilities like Quartz but they don't run a job in auto schedule manner rather have to be chained with some batch initiating utility.

Another approach was to use Batch management system tools like Autosys or Ctrl-M but currently this option looks like a heavyweight solution for the problem scenario we are facing.

Let me know your thoughts.

Thanks
14 years ago
All,

I am new to JPA and using Toplink (Oracle's distribution of the open-source EclipseLink) with JPA annotations . I am a bit confused with the purpose of the orm.xml and persistence.xml.

All the JPA based java classes (representative of each underlying database table) should be cataloged in the orm.xml file or persistence.xml file.

I have seen examples on the internet which have entries sometimes in the orm file and sometimes in the persistence file.

Let me know.

Thanks..
All,


We implemented a web service from our java application (bottom-up). This worked well and we are able to integrate this web service with front-end client apps.
Now few of the client apps have come up with a new business scenario wherein they would pass multiple requests bundled as a collection in one fat request which effectively means we will have to handle this new request type via a new web service or a new operation within the same web service and trigger the main web service in a for loop (batch mode) for the number of entries in the collection (max=250), collate all the output and send it back to client web apps.

My question here is about calling the web service in batch mode. I tried to find some info on the same but could not find anything remotely close about batch calling of web services. Is it a common (good) practice to trigger web service in a batch type mode.

Let me know your thoughts.

-Uday
14 years ago
Hi All,

In my current app which is invoked by an external application the interface is a single method with a custom java object as its method parameter.
The first step in the implemenation code is to validate this custom java input object.

The custom object comprises of lot many attributes so accordingly our code looks something like this

if(Helper.isBlank(input.getAttrib1()) || input.getAttrib2 == null)
return false;

In all cases of input validation failure we are passing a generic message back to the external app like "Input validation failed". We want to send back a message something like "attrib 1 cannot be blank" or "attrib2 cannot be null" type of message.

How can I implement such a check in a generic fashion applicable to all attributes and not doing it per attribute basis.

Let me know your thoughts.

Thanks
Uday
15 years ago
Hi Martijn, instanceOf is what I want to avoid.
15 years ago
Hi there,

I have a current service which takes a generic parent object as an input. This service is invoked by an external app.
Now based on the child object passed i have to chart the future course

So say my parent object is Loan and child objects are personal loan, home loan and auto loan.
I don't think its a good idea to have if clause for each type. Saying that I would appreciate if you could provide what would constitute a better design approach over the usage of if condition.

So accordingly at the service layer i get a Loan object. I have to check if it is personal loan then I have to introspect the input for further info. if it is home loan i have to do a database pull for assembling extra info and in case of autoloan i have to look at user input as well the database lookup.

In all 3 cases we populate a common LoanDto and pass it to LoanService. The end result of all assembly ops is the same but its the input type depending on various assembly criteria which is causing some concern.
My confusion is over having the if condition to distinguish the type of input and choose appropriate assembly operation is what I want to avoid as I will have to add more if conditions when new types spring up. Since these are passed as the input by external app I don't want to embed logic of assembling additional info in these dto type container objects.

Kindly provide suggestions.


Uday
15 years ago
Hi All

The current jdk feature of Enums does not allow the enum to inherit an abstract class. I am aware about having an abstract method inside the enum and the enum instances providing implementation for the abstract enum method. But I am trying to find a solution using Enum/abstract class workaround to the below mentioned scenario.
The reason I ask this question is I don't want to break our existing design which has an abstract class and only one abstract method and the rest of the methods are implemented methods. This abstract method is to be overriden by the derived classes. So they also inherit the complete methods defined by the parent class.
I don't want to spawn multiple derived classes but keep the implementation concise in an Enum so all the instances in enum will override the abstract method from the aforementioned abstract class.
How can I achieve this?


Regards,


15 years ago