Km Mahesh

+ Follow
since Nov 24, 2005
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Km Mahesh

I have two classes, say Product and ProductTO :
Other than fields, Product class also have several other different classes present as Collection (oneToMany), same goes with ProductTO.
When I use Dozer for mapping fields from entity Product to ProductTO, Dozer by default does copy all fields having same field names, but I don't want to copy all fields. Rather I will define a mehtod findFinishedProduct(), which will copy selected fields from Product to ProductTO while another method findScrapMaterial() will copy different set of fields from Product to ProductTO.
Is there any way to define a set of fields, say in xml configuration file, which I can refer in different methods while copying. How can I accomplish this with Dozer efficiently ?
Here is the client code calling the createReport() method...

Is anything going wrong here?

Dan Kempten wrote:
You should put the @EJB above an instance variable that represents the Bean you wish to inject.
And keep it inside the class.

As I already explained above, that I don't want to inject the ejb. (For there is no way to inject the ejb conditionally.)
That's why I am using the JNDI lookup.

Dan Kempten wrote:
I use it in a web app or a client app to replace this code :

Does your above code works? Where did you define the JNDI name "MyJNDINameOfMyBean"?
Or did you replace the above code b'coz it was not working?

Dan Kempten wrote:
with this code :

By this you are actually injecting the bean, which I don't want to.
If this optional element "mappedName" is not defined, still the ejb does gets injected.
Is there any specific reason for defining this element?

Finally I want to get the ejb reference through JNDI lookup and not by DI.
Hello All!

Can anybody please explain me why the JNDI lookup method is not able to find the the local interface reference which is defined through annotation in another ebj?
Any help would be appreciated.

Thnx & Rgds,
1) Local Interface

2) Remote Interface

3) EJB

4) Registring a reference to CircuitServiceSLSB EJB under the logical name CircuitServicesRef
In the ReportingServiceSlsb EJB, I am trying to lookup the local ejb interface CircuitServiceLocal.

Here in the createReport() method the lookup fails throwing the NameNotFoundException. (try catch is there in the code but not shown.)
In createReport() method I want the reference of the CircuitService EJB (local).

javax.naming.NameNotFoundException: java:comp/env/CircuitServicesRef not found in ReportingServiceSlsb

Can anybody explain what is going wrong here.
I am using OC4J and JDK 1.5.0_16

I know here I can inject the ejb using @EJB annotation, (and that works fine in my code) but for different reason, I have to use the JNDI lookup method.

One more thing is that I am using the lookup method to lookup the remote interface by passing the ejb name CircuitServiceSLSB, it is working fine.

the remote Lookup

Thanks & Regards,

I am new to Hibernate.
I am using Hibernate 3.2.0 with Spring framework and Oracle9i database.

I need to save files (pdf/xls/doc) using hibernate as blob datatype in oracle.

I tried google but was confused to get the exact solution with the technologies I am using, so thought to put a question here.

Does anybody have the sample code or reference links, which explains in detail to save blob datatype using above mentioned technologies?

Let me know if any more inputs are needed.

Thanks in advance.
Thanks Joe, the problem gets solved after removing the reference to the declared DTD.
12 years ago
Okay....the problem is not with URL passed to a build() method. Actually the
build() method of SAXBuilder class can take a File object, a URL of a File object and as well as a String object containing the File path.

The problem was with the XML file (web.xml) i was trying to load, here is the code snippet:

After I tried to load a new simple XML file, it works fine...code snippet :

Since i am newbie to XML, wondering what's wrong with the web.xml file? Is there any other way to load a XML file in jDOM?
12 years ago
I am getting above exception when i tried to access a local file through my application. Here is the code:

String filename = "C:\\users\\mahesh\\jDOM\\test.xml"; //args[0];
try {
// Build the document with SAX and Xerces, no validation
SAXBuilder builder = new SAXBuilder();
// Create the document
Document doc = File(filename).toURL());
// Output the document, use standard formatter
XMLOutputter fmt = new XMLOutputter();
fmt.output(doc, System.out);

DocType docType = doc.getDocType();
System.out.println("Element: " + docType.getElementName());
System.out.println("Public ID: " + docType.getPublicID());
System.out.println("System ID: " + docType.getSystemID());

} catch (Exception e) {

And here is the stack of error: No route to host: connect
at Method)
at Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at<init>(Unknown Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(Unknown Source)
at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at xmleditor.XmlEdit.main(

Any help appreciated.
12 years ago