[EJB/JBoss] - Jboss / Stateless Session EJB/ Flash Remoting / Flash Media
by kistler59
Hello,
We have a problem with an application we are developing and deploying to jboss 4.0.3.
We have a SLSB on a jbossAS for the backend. The UI is a flash front end, that communicates with jboss via Flash Media Server and then to flash remoting (Flash client -> Flash Media Server -> Flash Remoting -> SLSB)
The client makes calls to jboss by notifying flash media server, which makes a call to flash remoting, which in turn calls my ejb. So far this works about 95% The problem surfaces when the flash client is left idle for about 30 minutes and the binding with the ejb (or flash remoting) appears to become unbound and results in an exception being returned to our flash clients and no exception written to the jboss logs. It's not an application level error but it appears that some type of timeout, such as maybe flash media server losing its connection or timing out.
I'm not really sure where I'm going with this other than anyone else with similar experience that could offer some advice on how to either increase this timeout (wherever it is.. i've looked everywhere) or rebind this connection...
thanks
-keith
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961923#3961923
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961923
18 years, 6 months
[Installation, Configuration & Deployment] - Configuring a DataSource for remote usage
by KenRoberts
Sorry if this is a sore topic.
All the forum/wiki searches I've thought up to remotely connect to a data source seem to configure a data source which is remote to the app server, usable by the JVM that the app server is running in.
The subject of this post gets one hit so far, and the issue it discusses is exactly what I want to accomplish. I want to set up a connection pool via the standard means, which will be accessible to servlets, beans, etc. I also want to be able to use that same pool from an applet which thinks it has a JDBC driver.
There are some goals here:
- Support a couple large, preexisting 2-tier applications which use their own JDBC connections
- Create support for new N-tier new components
- Migrate the 2-tier apps to N-tier
- To follow standard practice in the newly changed/created code.
- Define the data sources only once
The ConfigDataSource wiki page suggests using a session bean facade instead of a data source. My questions:
- Is there a JDBC proxy class already in existence, or a remote session bean facade that emulates jdbc?
- If that does not work, can my application read its own configuration and programmatically create a connection pool on the app server for other apps to use?
Thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961922#3961922
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961922
18 years, 6 months
[JBoss/Spring Integration] - Re: Is it SpringLifecycleInterceptor or just me?
by Arno Werr
Ales,
I am reading your article 'Spring and EJB 3.0 in Harmony'
Quote:
anonymous wrote :
| However, one big problem with EJB 3.0 dependency injection is that there's no way of configuring, defining, and injecting plain Java beans.
| You can only inject Java EE component types and <env-entry> only lets you inject primitive types. Sure, EJBs look a lot like POJOs and JBoss has the concept of a @Service bean, which is a singleton, but do we really have to define and inject these component objects that have to run in containers?
| And what about beans from third-party libraries and pre-existing code.
|
Well, how about this?
| @Stateless
| public class OrderEntryBean implements OrderEntry {
|
| @PersistenceContext(unitName = "titan")
| private EntityManager manager;
|
| private PersonDao personDao;
|
| @Resource(name = "personDaoImplName")
| private String personDaoImplName;
|
| @PostConstruct
| public void postConstruct() {
| try {
| personDao = (PersonDao) (Class.forName(personDaoImplName))
| .newInstance();
| } catch (Exception e) {
| throw new ValidationException(e);
| }
| personDao.setManager(manager);
| }
| }
|
| <enterprise-beans>
| <session>
| <ejb-name>OrderEntryBean</ejb-name>
| <env-entry> <env-entry-name>personDaoImplName</env-entry-name>
| <env-entry-type>java.lang.String</env-entry-type>
| <env-entry-value>
| com.arno.dao.impl.PersonDaoImpl
| </env-entry-value>
| </env-entry>
| </session>
| </enterprise-beans>
|
It might be heavy, it might be not-elegant the way Spring provides solution (LOC), injected object cannot be configured externally. But to all practical purposes as long as a class has an interface it can be injected into EJB and serve the purpose of injection - runtime definition of implementation. Not so? ;)
Cheers,
Arno
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961917#3961917
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961917
18 years, 6 months
[JBoss Getting Started Documentation] - Getting AccessControlException from Applet trying to call EJ
by rmalhotr
I am getting the following exception while trying to access EJB deployed on JBoss 4.0.3SP1 from an Applet:
| java.lang.ExceptionInitializerError
| at org.jboss.proxy.SecurityInterceptor$3.run(SecurityInterceptor.java:87)
| ......
| ......
| Caused by:java.security.AccessControlException:access denied (java.util.PropoertyPermission org.jboss.security.SecurityAssociation.ThreadLocal read)
| .....
|
The exception is thrown from the line "inBox = inBoxHome.create();" in the following block of code:
| /**
| *
| * @return a InBoxBean object
| * @throws java.lang.Exception
| */
| public InBox getInBoxBean() throws Exception
| {
| InBox inBox = null;
| try
| {
| Object ref = null;
| try
| {
| //look up jndi name
| ref = _context.lookup("InBoxBean");
| }
| catch (Exception ex)
| {
| System.out.println("_context.lookup('InBoxBean') failed with: "+ ex);
| //look up jndi name again
| ref = _context.lookup("InBoxBean");
| System.out.println("_context.lookup('InBoxBean') succeeded:");
| }
| //then cast to Home interface
| InBoxHome inBoxHome = (InBoxHome)PortableRemoteObject.narrow(ref, InBoxHome.class);
| // use Home interface to create remote interface
| inBox = inBoxHome.create();
| }
| catch (Exception e)
| {
| throw e;
| }
| return inBox;
| }
|
The only way I have been able make this work is by running the Java Plug-in on the client with security manager with the following policy:
| grant {
| permission java.util.PropertyPermission "org.jboss.security.SecurityAssociation.ThreadLocal", "read";
| permission java.lang.RuntimePermission "org.jboss.security.SecurityAssociation.getPrincipalInfo";
| permission java.io.SerializablePermission "enableSubstitution";
| };
|
Is there a way to make this work without have to do anything special on the client plug-in.
Thanks,
Rajeev
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961914#3961914
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961914
18 years, 6 months