Win a copy of Rust Web Development this week in the Other Languages forum!

Avinash Ramana

+ Follow
since Jul 31, 2006
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 Avinash Ramana


Is there a way to have the Spring bean a Proxy that implements its interface? For some reason, I thought that the JBoss proxied remote EJB could make calls to any implementation given that it implements an interface.

What would you recommend if I want to expose Spring beans to JNDI and be able to use them remotely through their interface without requiring the implementation be on the client jar?

Thank you so much BTW!

12 years ago
I have a WAR that exposes some beans over to JNDI. I then have a Stateless SB that returns an interface to the Spring bean.

The Spring bean is :

ProductManagerImpl which implements IProductManager

The EJB is :

@javax.ejb.Stateless(name = "ProductManagerEJB")
public class ProductManagerBean implements ProductManagerLocal, ProductManagerRemote {
public IProductManager getProductManager() {
IProductManager productManager=null;
try {
InitialContext context = new InitialContext();
productManager = (IProductManager) context.lookup("ProductManager"); //This is bound using Spring

} catch (NamingException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
return productManager;

When lookup the bean on JNDI, I get a ClassNotFoundException for ProductManagerBeanImpl (the actual implementation). Is this needed at the client side? I'm trying to not have too much that is needed at the client side. The Jboss documentation is all very confusing to me.

InitialContext initialContext = new InitialContext();
ProductManagerRemote productManagerRemote = (ProductManagerRemote) initialContext.lookup(G_EJB_BRIDGE_PRODUCT_MANAGER_EJB_REMOTE);

12 years ago

Excellent article.

I've actually been working a lot with serialization in conjunction with Quartz Scheduler. I'm basically putting a serialized class(x.y.Clazz) into the database (blob) and then when it gets pulled to execute the x.y.Clazz , the version has changed because I updated it while x.y.Clazz was persisted.

I solved it by other means. But I realized the solution would be to start using XML because it's easier to manage certain aspects like not knowing where our classes were going..

Check this out for future gotchas
14 years ago
You'll need to modify your server.xml to

Usually located here :

Search for 8080

You'll find that it says something like ..

Change 8080 to 80
14 years ago
Couldn't you watch for the "\n" in ASCII?

It's "A" in hex..for the newline.

14 years ago
I'm not 100% sure what your current setup looks I hope none of this is way off..

From what I can gather, your Hibernate setup is being done client side? I would expose the `dao` or `service` through JNDI on JBoss. This can be tightly integrated into JBoss. The client could then access the JNDI over HTTP(S) using the HTTP Invoker.

Of course, in all could just as easily expose a web-service or use something like Hessian. Either way, you've got options

I would not expose my SessionFactory because that would mean managing the sessions over the client. Managing the session (lazy load errors) is tough enough

I hope this provided at least a little bit of insight. Feel free to clarify the current way the application is being implemented. are you trying to "limit their access" to the "database"? Couldn't you just make the user only have local priviledges in your DBMS? Clarify what local means?

Best of luck,
The OSIV pattern can be easily implemented by using OpenSessionInView{Filter|Interceptor}. By using the OSIV pattern, you essentially couple the service layer to the view layer. This may or may not be a problem in the future. I've used OSIV for a number of applications without problems.

If you don't want to use OSIV, some people on the Spring board have "iterated" through a collection to initialize them. This method works well in addition to OSIV. I have not heard of someone trying to use one-to-one in order to get around the lazy loading issue. I always look at lazy loading as a good thing!

If you want much more "code" type examples, you should search the Spring forums.

-Avinash R.

Is this an example of what you need?

You probably want to create a WAR and copy that into the tomcat deployment folder.

Consider AJAX yet? This seems to be a hot thing with the now numerous frameworks.

15 years ago