Avinash Ramana

Greenhorn
+ Follow
since Jul 31, 2006
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
(keep public parts private until JForum day)
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt
Moderation Tools

Recent posts by Avinash Ramana

Peter,

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!

-Avi
8 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")
@Local(ProductManagerLocal.class)
@Remote(ProductManagerRemote.class)
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);
System.out.println(productManagerRemote.getProductManager().getName());

-Avi
8 years ago
http://java.sun.com/developer/technicalArticles/Programming/serialization/

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

http://www.javaworld.com/javaworld/jw-02-2006/jw-0227-control.html
10 years ago
You'll need to modify your server.xml to

Usually located here :
$JBOSS/server/default/deploy/jboss-web.deployer/server.xml

Search for 8080

You'll find that it says something like ..



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

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

-Avinash
10 years ago
I'm not 100% sure what your current setup looks like..so 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 this..you 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.

Also..how 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,
Avinash
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?

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

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

-Avinash
11 years ago