[JBoss Remoting] - Jboss 4.2.3.GA Configuration for client to call ejb
by David Chokhonelidze
David Chokhonelidze [http://community.jboss.org/people/dato.java] created the discussion
"Jboss 4.2.3.GA Configuration for client to call ejb"
To view the discussion, visit: http://community.jboss.org/message/569919#569919
--------------------------------------------------------------
Hello,
I am using following environment in my project:
* JBoss AS 4.2.3.GA
* JBoss ejb 2.x (but on 3 is the same problem i have)
* Swing for client
Server and client are running on different machines in local network. The main problem is that server needs specific configuration to connect from client to that machine and call ejbs remotelly. I have some workarounds that works:
1. In run.bat file i added following string:*set JAVA_OPTS=%JAVA_OPTS% -Djava.rmi.server.hostname=IP Where jboss runs -Djava.rmi.server.useLocalHostname=false*
2. In jboss-service.xml i configured this : *<!––<attribute name="clientConnectAddress">IP Where jboss runs</attribute>––>*
*
*
After this configuration everything works. I also start jboss with parameter -b 0.0.0.0,but this does not help. From Swing client *without configuration* when i try to lookup ejb with this properties :
InitialContext jndi=fina2.Main.getJndiContext();
Object ref = jndi.lookup("fina2/i18n/LanguageSession");
*Properties p=new Properties();*
*
*
* * *p.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.NamingContextFactory");*
** *p.setProperty(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");*
** *p.setProperty(Context.PROVIDER_URL, "jnp://***IP Where jboss runs***:1099");*
*
*
* InitialContext jndi=new InitialContext(props);
*
**
**
** *Object ref = jndi.lookup("....");*
*
*
The following exception is thrown:
javax.naming.CommunicationException: Could not obtain connection to any of these urls: *IP Where jboss runs* and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.CommunicationException: Failed to connect to server *IP Where jboss runs*:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server *IP Where jboss runs*:1099 [Root exception is java.net.ConnectException: Connection refused: connect]]]
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1562)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:634)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
at javax.naming.InitialContext.lookup(Unknown Source)
at fina2.login.LoginFrame.loadLanguageList(LoginFrame.java:127)
at fina2.login.LoginFrame.languagesPopupMenuWillBecomeVisible(LoginFrame.java:426)
at fina2.login.LoginFrame$5.popupMenuWillBecomeVisible(LoginFrame.java:233)
at javax.swing.JComboBox.firePopupMenuWillBecomeVisible(Unknown Source)
at javax.swing.plaf.basic.BasicComboPopup.firePopupMenuWillBecomeVisible(Unknown Source)
at javax.swing.JPopupMenu.setVisible(Unknown Source)
at javax.swing.JPopupMenu.show(Unknown Source)
at javax.swing.plaf.basic.BasicComboPopup.show(Unknown Source)
at javax.swing.plaf.basic.BasicComboPopup.togglePopup(Unknown Source)
at javax.swing.plaf.basic.BasicComboPopup$Handler.mousePressed(Unknown Source)
at java.awt.AWTEventMulticaster.mousePressed(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: javax.naming.CommunicationException: Failed to connect to server *IP Where jboss runs*:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server *IP Where jboss runs*:1099 [Root exception is java.net.ConnectException: Connection refused: connect]]
at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:274)
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1533)
... 34 more
Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server *IP Where jboss runs*:1099 [Root exception is java.net.ConnectException: Connection refused: connect]
at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:248)
... 35 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:84)
at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:77)
at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:244)
... 35 more
*It worked fine on Jboss 4.0.5 without configuration.*
*
*
Can anyone tell me some kind of workaround so that to not to configure ip address ? ,because its not good that for every machine i manually change ips.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/569919#569919]
Start a new discussion in JBoss Remoting at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 4 months
[JBoss Remoting] - JBoss Remoting and JBoss AS 6
by Ian Mitchell
Ian Mitchell [http://community.jboss.org/people/imitchell] created the discussion
"JBoss Remoting and JBoss AS 6"
To view the discussion, visit: http://community.jboss.org/message/566107#566107
--------------------------------------------------------------
Hi folks,
I'd like to investigate the use of Remoting on JBoss for a large project with many different technologies.
We are currently using JBoss AS 6 but it looks like there is no Remoting available for JBoss AS 6.
I have found the following information JBoss Remoting site:
For Remoting 2:
2.5.3.SP1: Versions 2.5.x are targeted to JBoss Application Server 5.0/5.1 and EAP 5.0/5.1
2.2.3.SP2: Versions 2.2.x are targeted to JBoss Application Server 4.2 and EAP 4.2/4.3
For Remoting 3:
Remoting 3 is the next generation of Remoting.
It will support a variety of modules in JBoss Application Server 6.
But... I also find this:
3.1.0.Beta2 Beta - NOT for production systems
Does Remoting 2.5.x work with JBoss AS 6?
As anyone tried this before?
Any hints on making it work?
Thanks,
Ian
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/566107#566107]
Start a new discussion in JBoss Remoting at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 4 months
[JBoss Web Services] - EJB3 JBossWS Authentication in 5.1.0 GA not working
by Judes Tumuhairwe
Judes Tumuhairwe [http://community.jboss.org/people/tumuhairwe] created the discussion
"EJB3 JBossWS Authentication in 5.1.0 GA not working"
To view the discussion, visit: http://community.jboss.org/message/565984#565984
--------------------------------------------------------------
Hi
I've read this [1] and [2] and [3] and a whole bunch of others (including the JBoss In Action book) and they all say the same thing:
1. Configure a data-source (*-ds.xml file)
2. Define a domain (conf/login-config.xml)
3. Tell the app about it:
a. put the <security-domain> in jboss-web.xml and in the
b. META-INF/jboss.xml
c. add a security constraint in web.xml
4. Annotate the EJB/Web-service with the security annotations (@SecurityDomain, @WebContext and @RolesAllowed in addition to @Stateless and @Webservice)
5. build, package & deploy as an ear
6. Add the values to the request-context map of the BindingProvider when calling...and everything should work.
But nothing is working for me i.e. I keep getting a 401 error (Unauthorized). (I've been struggling with this for days now) Question is can anyone see what I'm doing wrong.
Environment: Java version: 1.5.0_22, JBoss 5.1.0 GA, JBoss Web Services - Stack Native Core (3.1.2.GA)
conf/login-config.xml (fragment)
[still gives a HTTP 401 even if I use the default JBossWS]
The datasource (I've verified that this works)
jboss-web.xml (the article [1] says its only for POJO's but it doesn't make a difference if I remove the <security-domain> tag)
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
<class-loading java2ClassLoadingCompliance="false">
<loader-repository>
<loader-repository-config>
java2ParentDelegation=false
</loader-repository-config>
</loader-repository>
</class-loading>
<context-root>/verifiq</context-root>
<security-domain flushOnSessionInvalidation="false">verifiq-domain</security-domain>
</jboss-web>
jboss.xml (in the ejb jar's META-INF) Same as above i.e. doesn't make a difference if I uncomment.
<?xml version="1.0" encoding="UTF-8"?>
<jboss>
<security-domain>verifiq-domain</security-domain>
<!--
<webservices>
<context-root>/service</context-root>
</webservices>
<enterprise-beans>
<session>
<ejb-name>ExpulsionStatusBean</ejb-name>
<jndi-name>ExpulsionStatusBean</jndi-name>
<security-domain>verifiq-domain</security-domain>
<port-component>
<port-component-name>ExplusionStatusServicePort</port-component-name>
<port-component-uri>/ExplusionStatusBeanPort</port-component-uri>
<auth-method>BASIC</auth-method>
<transport-guarantee>NONE</transport-guarantee>
<secure-wsdl-access>false</secure-wsdl-access>
</port-component>
-->
<!--
<resource-ref>
<res-ref-name>jdbc/postgresql</res-ref-name>
<jndi-name>java:/VerifiqDS</jndi-name>
</resource-ref>
-->
<!--
<clustered>true</clustered>
<cluster-config>
<partition-name>DefaultPartition</partition-name>
<load-balance-policy>org.jboss.ha.framework.interfaces.RandomRobin</load-balance-policy>
</cluster-config>
-->
<!--
</session>
</enterprise-beans>
-->
</jboss>
ExpulsionStatusBean.java [intentionally skipped the contextRoot in @WebContext because:
1. it puts the context (e.g. /service) outside the app's (/verifiq) i.e. security-constraint definitions in web.xml become useless since we now have localhost:8080/services and localhost:8080/verifiq.
2. It applies that service to all the web-services in that ejb jar (even though I've explicitly asked for a different contextRoot on another web-service)
Either way, even when I access them at a different location /services/serviceName?wsdl the result is the same i.e. HTTP 401]
@Stateless
@WebService
@Local(ExplusionStatusService.class)
@SecurityDomain(value="JBossWS")
@RolesAllowed("friend")
@WebContext(authMethod="BASIC", transportGuarantee="NONE", secureWSDLAccess=false)
public class ExplusionStatusBean implements ExplusionStatusService, Serializable {
@Resource
private SessionContext context;
@WebMethod
public String expell(@WebParam(name="person") Person person) {
String retVal = "Expelling " + person.getSchoolAssignedID();
System.out.println("ExplusionStatusBean.expell(): invoked");
System.out.println("ExplusionStatusBean.expell(): Student: " + person);
System.out.println("ExplusionStatusBean.expell(): caller: " + context.getCallerPrincipal());
System.out.println("ExplusionStatusBean.expell(): returning " + retVal);
return retVal;
}
}
Expeller.java (snipped just main() )
public static void main(String[] args) {
try {
log.info("Constructing...");
ExplusionStatusBeanService esb = new ExplusionStatusBeanService(new URL("http://127.0.0.1:8080/verifiq-verifiq-ejb/ExplusionStatusBean?wsdl"));
ExplusionStatusBean service = esb.getExplusionStatusBeanPort();
log.info("Computing password");
String password = "thefrog";
//password = DigestUtils.md5Hex(password);
//String pass =
log.info("Setting authentication info");
//BindingProvider bp = (BindingProvider)service;
//Map<String, Object> authentication = bp.getRequestContext();
((BindingProvider)service).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "kermit");
((BindingProvider)service).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, password);
System.out.println("Using username kermit and password=" + password);
log.info("Invoking...");
Person person = getJudes(); // Person is just a regular JPA pojo (mapped) (with name & schoolId)
String response = service.expell(person);
log.info("Response receieved successfully! " + response);
} catch (Exception ex) {
ex.printStackTrace();
log.log(Level.SEVERE, null, ex);
}
}
server.log
(I'm 100% certain the user kermit->thefrog exists in both the props/jbossws-*.properties file (when I use the default JBossWS) and in the database.)
2010-10-12 01:09:07,797 DEBUG org.jboss.security.auth.spi.DatabaseServerLoginModule org.jboss.security.auth.spi.DatabaseServerLoginModule (http-127.0.0.1-8080-1) Bad password for username=kermit
2010-10-12 01:09:07,797 DEBUG org.jboss.security.auth.spi.DatabaseServerLoginModule org.jboss.security.auth.spi.DatabaseServerLoginModule (http-127.0.0.1-8080-1) Bad password for username=kermit
Like I said, I'm 100% certain the kermit exists & has the role 'friend' (see attached screenshot)
Is there anything I'm missing?
web.xml (supposedly for POJOs only but I've included a snippet anyway. Doesn't matter if I comment or uncomment it out. Same result "Bad password" error)
<security-constraint>
<web-resource-collection>
<web-resource-name>All webservices</web-resource-name>
<description>Protects all webservices</description>
<url-pattern>/service</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>admissions-viewer</role-name>
<role-name>friend</role-name>
</auth-constraint>
</security-constraint>
<security-role>
<role-name>admissions-viewer</role-name>
</security-role>
<security-role>
<role-name>friend</role-name>
</security-role>
<security-role>
<role-name>admissions-manager</role-name>
</security-role>
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>Verifiq Webservices Realm</realm-name>
</login-config>
I've gone over it countless times & I'm just frustrated. It really shouldn't be that hard to get it to work...in theory :-)
Is there anything I'm missing?
TIA,
Judes Tumuhairwe
References:
[1] http://community.jboss.org/docs/DOC-13533 http://community.jboss.org/wiki/JBossWS-Authentication
[2] http://www.coderanch.com/t/477889/JBoss/Securing-Application-JBoss http://www.coderanch.com/t/477889/JBoss/Securing-Application-JBoss
[3] http://thatjavathing.blogspot.com/2009/05/authentication-and-authorizatio... http://thatjavathing.blogspot.com/2009/05/authentication-and-authorizatio...
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/565984#565984]
Start a new discussion in JBoss Web Services at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 4 months
[jBPM] - jbpm5 and maven
by michael melsen
michael melsen [http://community.jboss.org/people/piratew] created the discussion
"jbpm5 and maven"
To view the discussion, visit: http://community.jboss.org/message/573733#573733
--------------------------------------------------------------
Hi everyone,
I'm hoping any one of you guys can help me out and that my question isn't a bit too noobish ;) . I'm trying to run jbmp5 in a test setup. After using the jbpm5 installer and the ant script everything works quite well. However I'm trying to setup a new jbpm5 / maven project to start a prototype. Unfortunately after finding and adding the dependency jpbm 5.0-Snapshot my pom editor in eclipse keep stating that it is missing artifact org.jbpm:jbpm:pom:5.0-SNAPSHOT:compile. Older versions of jbpm work like a charm.
Is there anybody who knows what I'm doing wrong or is there a problem related to the repository itself?
thanks in advance,
Michael
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/573733#573733]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 4 months