[JBossWS] - Newbie question: Just a first webservice client
by NautilusIII
Hi!
I have developed my very first webservice with JSR181:
| /**
| * SimpleWebServiceImpl.java
| *
| * This file was auto-generated from WSDL
| * by the Apache Axis 1.3 Oct 05, 2005 (05:23:37 EDT) WSDL2Java emitter.
| */
|
| package ws;
|
| import javax.jws.WebMethod;
| import javax.jws.WebService;
| import javax.jws.soap.SOAPBinding;
|
| @WebService
| @SOAPBinding(style = SOAPBinding.Style.RPC)
| public class SimpleWebService
| {
| @WebMethod
| public int add(int a, int b)
| {
| return a+b;
| }
|
| @WebMethod
| public int sub(int a, int b)
| {
| return a-b;
| }
|
| @WebMethod
| public int mul(int a, int b)
| {
| return a*b;
| }
|
| @WebMethod
| public double div(int a, int b)
| {
| return a/b;
| }
| }
|
The webservice is deployed and I can fetch the wsdl via specifying the appropriate URL in the browser.
| http://localhost:8080/ws2/webservices/SimpleWebService?wsdl
|
But I cannot manage it to develop a simple standalone client...
I tried this here:
| package ws;
|
| import javax.xml.ws.WebServiceRef;
|
| public class SimpleWebServiceClient
| {
| @WebServiceRef(wsdlLocation = "http://localhost:8080/ws2/webservices/SimpleWebService?wsdl")
| static SimpleWebService service;
|
| public static void main(String[] args)
| {
| System.out.println(service.add(2,3));
| }
| }
|
I doing all these from within Eclipse with Lomboz...
I referenced the project containg the service from within my client project and just executed the client from within Eclipse...
But I always get a NullPtrExc because the variable service is always null in
| System.out.println(service.add(2,3));
|
What am I doing wrong?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3967950#3967950
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3967950
19 years, 8 months
[JBoss Portal] - Link paths in CMS content
by PeterJ
I was just now playing with the quickstart.zip file, going through the steps in section 4.4, Content Management. The very last paragraph of that section implies that the links were "corrected" as part of the upload so that they now work within the portal. At least, that is the impressio nthat I had when I first read through this section.
However, while the links for the uploaded quickstart work fine in the portal, they do not work at all if I simply unzip the zip file and try to access the html pages with my browser. It appears that the links have been "corrected" manually (yeah, you probbaly have s script that does it for you) before the zip archive was created.
Are there any plans to provide link massaging (or correcting) when uploading archives? If that was done automatically as part of the upload, then I could build some static web content using the tool of my choice, use a browser to verify the content, then package it as a zip and upload it and be confident it still works in the portal.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3967949#3967949
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3967949
19 years, 8 months
[Beginners Corner] - Re: JBossIDE-Tutorial problem.
by Kentzhou
After deploying the app, the info as
18:20:14,687 INFO [EjbModule] Deploying Fibo
18:20:14,906 INFO [ProxyFactory] Bound EJB Home 'Fibo' to jndi 'ejb/Fibo'
18:20:14,906 INFO [EJBDeployer] Deployed: file:/C:/jboss-4.0.4/server/all/tmp/deploy/tmp38102FiboApp.ear-contents/FiboEJB.jar
18:20:14,968 INFO [TomcatDeployer] deploy, ctxPath=/fibo, warUrl=.../tmp/deploy/tmp38102FiboApp.ear-contents/FiboWeb-exp.war/
18:20:15,406 INFO [JBossCacheManager] init(): replicationGranularity_ is 0 and invaldateSessionPolicy is 2
18:20:15,484 INFO [JBossCacheManager] Starting JBossManager
18:20:15,593 INFO [EARDeployer] Started J2EE application: file:/C:/jboss-4.0.4/server/all/deploy/FiboApp.ear
ejb/Fibo already there, why servlet can not reference it in following code?
Object ref = context.lookup("java:/comp/env/ejb/Fibo");
OR
Object ref = context.lookup("ejb/Fibo");
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3967948#3967948
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3967948
19 years, 8 months
[JBoss jBPM] - Re: jBPM 3.1 beta 2 is not thread safe !
by jonabbey
"falazar" wrote : This is not corrected in the 3.2 CVS?
|
| jpdl/jar/src/main/java/org/jbpm/configuration/ObjectFactoryImpl.java: public synchronized Object createObject(String name) {
| jpdl/jar/src/main/java/org/jbpm/configuration/ObjectFactoryImpl.java: public Object createObject(int index) {
| jpdl/jar/src/main/java/org/jbpm/configuration/ObjectFactoryImpl.java: public Object createObject(ObjectInfo objectInfo) {
|
| We have setup an RMI call, and are gettting the closed multiple times error as well.
|
| James
It appears that the problem is that the JbpmConfiguration class uses ThreadLocalStorage for the jbpmContextStacks.. If we attempt to hold a context open and call it from multiple threads, we'll see this error.
Since RMI is not designed to map all calls from a client into a single thread, this means we can't reliably call JBPM methods without creating a worker thread on the server and using that for all processing from a single client.
I presume something similar is happening on the servlet side, where multiple servlet calls are winding up executing on different threads.
I don't understand how this design feature can really work in a J2EE environment. Far better to give each client context its own JbpmContext object, synchronize the methods, and then let anyone call close() on it, without regard to what thread is doing the work.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3967947#3967947
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3967947
19 years, 8 months
[JNDI/Naming/Network] - java.naming.provider.url parsing problem?
by csturtz
I'm running integration tests from outside of the JBoss AS and am using the "jndi.properties" file to access the context.
I'm unable to ever get the connection because it seems there's a problem parsing the java.naming.provider.url value. I've tried many different values that i've found on the net.
if i use "jnp://localhost:1099":
anonymous wrote : javax.naming.CommunicationException: Could not obtain connection to any of these urls: "jnp://localhost:1099" 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 "jnp:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server "jnp:1099 [Root exception is java.net.UnknownHostException: "jnp: "jnp]]]
| at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1414)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:594)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
| at javax.naming.InitialContext.lookup(Unknown Source)
| at com.gestalt.gccsa.fp.adhoc.db.objectmanager.ws.FunctGroupObjectManager.getConnection(FunctGroupObjectManager.java:866)
| at com.gestalt.gccsa.fp.adhoc.db.objectmanager.ws.FunctGroupObjectManager.saveFunctGroupVersionObject(FunctGroupObjectManager.java:305)
| at com.gestalt.gccsa.fp.adhoc.db.objectmanager.ws.SqlQueryManagerTest.(SqlQueryManagerTest.java:34)
| at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
| at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
| at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
| at java.lang.reflect.Constructor.newInstance(Unknown Source)
| at junit.framework.TestSuite.createTest(TestSuite.java:56)
| at junit.framework.TestSuite.addTestMethod(TestSuite.java:279)
| at junit.framework.TestSuite.(TestSuite.java:142)
| at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
| at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
| at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
| at java.lang.reflect.Constructor.newInstance(Unknown Source)
| at org.apache.maven.surefire.junit.JUnitTestSet.constructTestObject(JUnitTestSet.java:148)
| at org.apache.maven.surefire.junit.JUnitTestSet.getTestCount(JUnitTestSet.java:244)
| at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.locateTestSets(AbstractDirectoryTestSuite.java:101)
| at org.apache.maven.surefire.Surefire.createSuiteFromDefinition(Surefire.java:147)
| at org.apache.maven.surefire.Surefire.run(Surefire.java:108)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
| at java.lang.reflect.Method.invoke(Unknown Source)
| at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:225)
| at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:747)
| Caused by: javax.naming.CommunicationException: Failed to connect to server "jnp:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server "jnp:1099 [Root exception is java.net.UnknownHostException: "jnp: "jnp]]
| at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:269)
| at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1385)
| ... 28 more
| Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server "jnp:1099 [Root exception is java.net.UnknownHostException: "jnp: "jnp]
| at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:243)
| ... 29 more
| Caused by: java.net.UnknownHostException: "jnp: "jnp
| at java.net.InetAddress.getAllByName0(Unknown Source)
| at java.net.InetAddress.getAllByName0(Unknown Source)
| at java.net.InetAddress.getAllByName(Unknown Source)
| at java.net.InetAddress.getByName(Unknown Source)
| at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:76)
| at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:239)
what happend to the url for it to print this: [Root exception is java.net.UnknownHostException: "jnp: "jnp] ???
I can list all the other values i've tried and their corresponding results, but that would take more time than i have right now. Before i go to all that trouble, are there any known problems with this? Is there something i'm missing?
jndi.properties
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.provider.url=jnp://localhost:1099
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3967946#3967946
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3967946
19 years, 8 months
[Beginners Corner] - Re: JBossIDE-Tutorial problem.
by Kentzhou
After removing FiboEJB-client.jar form FiboWeb.war, I still got the error as below:
18:13:40,968 ERROR [[compute]] Allocate exception for servlet compute
javax.servlet.ServletException: Lookup of java:/comp/env/ failed
at myweb.web.computeServlet.init(computeServlet.java:57)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1105)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:757)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:130)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
at org.jboss.web.tomcat.tc5.session.ClusteredSessionValve.invoke(ClusteredSessionValve.java:95)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:595)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3967945#3967945
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3967945
19 years, 8 months
[Security & JAAS/JBoss] - LdapLoginModule and role attribute not retrieved
by l.pasquinelli
Hi all,
It's about 2 days that i'm not able to resolve this problem. I'm trying to configure jboss to work with a webapplication that actually run under tomcat 5.5, but i'm not able to to configure LdapLoginModule.
The page that should appear after login is in a protected area associated with a role "Cataloguer". This role is associated in LDAP tree, as an attribute of each users as value of field initials.
When I try to login I receive an error 403 as the user isn't in the correct role.
I trace in a public jsp request.getUserPrincipal().getName() and request.isUserInRole("Cataloguer"), and I call this page after my login. I see that the user Principal is correct but the condition isUserInRole return false.
I activate trace information in log4j.xml for category "org.jboss.security.auth.spi" and this is the output .
2006-08-28 23:37:04,015 DEBUG [org.jboss.security.plugins.JaasSecurityManagerService] Added ldap-pdil, org.jboss.security.plugins.SecurityDomainContext@bc448b to map
2006-08-28 23:37:04,031 TRACE [org.jboss.security.auth.spi.LdapLoginModule] initialize, instance=@30675222
2006-08-28 23:37:04,031 TRACE [org.jboss.security.auth.spi.LdapLoginModule] login
2006-08-28 23:37:04,031 TRACE [org.jboss.security.auth.spi.LdapLoginModule] Logging into LDAP server, env={java.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory, principalDNPrefix=cn=, java.naming.security.principal=cn=Cataloguer_1,ou=people,dc=mycompany,dc=com, roleAttributeID=initials, matchOnUserDN=false, principalDNSuffix=,ou=people,dc=soloreti,dc=net, allowEmptyPasswords=false, java.naming.provider.url=ldap://localhost:389/, roleAttributeIsDN=false, java.naming.security.authentication=simple, java.naming.security.credentials=***}
2006-08-28 23:37:04,078 TRACE [org.jboss.security.auth.spi.LdapLoginModule] Logged into LDAP server, javax.naming.ldap.InitialLdapContext@1ff83
2006-08-28 23:37:04,078 TRACE [org.jboss.security.auth.spi.LdapLoginModule] Rebind SECURITY_PRINCIPAL to: cn=Manager,dc=mycompany,dc=com2006-08-28 23:37:04,078 TRACE [org.jboss.security.auth.spi.LdapLoginModule] User 'Cataloguer_1' authenticated, loginOk=true
2006-08-28 23:37:04,078 TRACE [org.jboss.security.auth.spi.LdapLoginModule] commit, loginOk=true
My application define 4 private area, each of them are associated to a role; in my LDAP role information is the attribute "initials" of the user.
I configure an application policy under login-config.xml
<application-policy name="ldap-pdil">
<!--<login-module code="org.jboss.security.auth.spi.LdapLoginModule" flag="required">-->
<login-module code="org.jboss.security.auth.spi.LdapExtLoginModule" flag="required">-->
<module-option name="java.naming.factory.initial">com.sun.jndi.ldap.LdapCtxFactory</module-option>
<module-option name="java.naming.provider.url">ldap://localhost:389/</module-option>
<module-option name="java.naming.security.authentication">simple</module-option>
<module-option name="java.naming.security.principal">cn=Manager,dc=mycompany,dc=com/module-option>
<module-option name="java.naming.security.credentials">secret</module-option>
<module-option name="principalDNPrefix">cn=</module-option>
<module-option name="principalDNSuffix">,ou=people,dc=mycompany,dc=com</module-option>
<module-option name="matchOnUserDN">true</module-option>
<module-option name="roleAttributeID">initials</module-option>
<module-option name="roleAttributeIsDN">false</module-option>
<module-option name="allowEmptyPasswords">false</module-option>
</login-module>
</application-policy>
and i referenced it in my login module
<login-config>
<auth-method>FORM</auth-method>
<realm-name>ldap-pdil</realm-name>
<form-login-config>
<form-login-page>/login.jsp</form-login-page>
<form-error-page>/errors/loginFailedError.jsp</form-error-page>
</form-login-config>
</login-config>
I think that i don't configure correctly these module option "matchOnUserDN", "roleAttributeID", "roleAttributeIsDN" : I try different value but the result is the same!
Some one can help me?
Why the user successfully login, but no role information are available?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3967944#3967944
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3967944
19 years, 8 months