[EJB/JBoss] - Executing Remote-Method with Swing Client fails
by empinator
Hello,
I'm using JBoss 4.0.5GA as ApplicationServer
having a Swing Client receiving the Business Logic through EJB.
Both running with Java 1.6.
They client-application is downloaded via WebStart containing all its neccassary libraries in the codebase folder
| <jnlp
| spec="1.5+"
| codebase="http://localhost:8080/tima-client/application"
| href="launch.jnlp">
| <security>
| <all-permissions/>
| </security>
| <resources>
| <j2se version="1.6+"
| href="http://java.sun.com/products/autodl/j2se"
| java-vm-args="-Xmx250M" />
| <jar href="binding-1.3.1.jar"/>
| <jar href="jboss-aop-jdk50.jar"/>
| ...
| </jnlp>
|
Receiving the Remote-Bean is successful, but when I'm trying to execute a specific method of this bean, my application stalls without throwing an Exception.
However this phenomen doesn't occur while running my client with eclipse.
Here's my code:
|
| public class RemoteBeanUtil {
|
| /** Login */
| private final static String sLoginUc = "LoginUcImpl";
|
| private static InitialContext getInitialContext() throws NamingException {
| Properties lP = new Properties();
| lP.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
| lP.put(Context.URL_PKG_PREFIXES, " org.jboss.naming:org.jnp.interfaces");
| lP.put(Context.PROVIDER_URL, "jnp://antonius:1099");
| return new InitialContext(lP);
| }
|
|
| private static Object getBean(String pBeanName,
| Class<? extends Object> pName) throws NamingException
| {
| Object lRef = null;
| InitialContext lInitialContext = getInitialContext();
| lRef = lInitialContext.lookup(pBeanName + "/remote");
|
| return PortableRemoteObject.narrow(lRef, pName);
| }
|
| public static LoginUc getLoginUc() throws Exception {
| return (LoginUc) getBean(sLoginUc, LoginUc.class);
| }
| }
|
| @Stateless
| public class LoginUcImpl extends UcImplBase implements LoginUc {
|
| public Benutzer authenticate(String pUser, String pPass) {
| // Businesslogic
| }
|
| }
|
| // Client
| LoginUc lLuc = RemoteBeanUtil.getLoginUc();
| if(lLuc == null) {
| System.out.println("not here!");
| }
| Benutzer lBen = lLuc.authenticate(pUser, lPw);
| System.out.println("here!"); // <-- unreached code!!
|
|
Any help, hints or suggestions are welcome!!
Thanks a lot
empi
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4081820#4081820
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4081820
18 years, 7 months
[JBoss Seam] - Re: General Performance concerns on presentation and busines
by fhh
Well, I am not a Seam developer but my stance on these issues is this:
anonymous wrote : - security: presentation layer is the only one that gets exposed to the internet and it take hackers more layer to crack.
|
Once the machine hosting the view is hacked your are usually lost anyway. You usually need some direct access between the view layer and the database (fast lane pattern, authentification ...). Once they can hijack a machine with a ddatabase connecetion everything is lost ...
anonymous wrote : - scalability: easier to scale either/both presentation and business layer if they are separated.
In 99% of all projects improving the code has a far more dramatic effect than simply scaling out a poorly designed and implemented project. So it is usually not necessary to distribute the layers over different machines. If it is it is usually possible to cut the application into different functional units that can be distributed over different machines.
Even once these options show to be insufficient the costs of RMI make (IMHO) distributing view layer and business code over different machines hardly worthwhile. Simply scaling out the combined view/business layer is (IMHO) the simpler approach.
anonymous wrote : - easier division of labor: presentation and business-logic developers only care about their components and they can become more skillful/specialized in their area.
Ease of division of labour is an issue of good design which should take place before the actual implementation is happening. A good design can not and should not enforced by choosing a certain technology.
Regards
Felix
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4081819#4081819
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4081819
18 years, 7 months
[Tomcat, HTTPD, Servlets & JSP] - Re: DataSource Problem JBoss/Tomcat Only Configuration
by kdolan
I still could figure out how to configure Tomcat in JBoss to recognize my database. So, I compared what components the JEMS installer installs for the "tomcat" option vs. the "default" option. I noticed a component named "jboss-ds". So, I tried using the JEMS installer to install JBoss.
1. I chose the "default" option.
2. I de-selected (unchecked) every component that is not installed with the "tomcat" option.
3. I re-selected the jboss-ds component (and the ones on which it is dependent - jboss-ha-local-jdbc, jboss-ha-xa-jdbc, jboss-local-jdbc, jboss-xa-jdbc, jca-service, jdbc-metadata-service)
This worked! I was able to deploy my .war file and my -ds.xml file.
Also, I looked at both the disk space and memory footprint of adding these components and they are negligible (vs. running the entire "default" option). Now I need to confirm I am allowed to install these components.
Kelly
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4081817#4081817
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4081817
18 years, 7 months