[JBoss Seam] - Re: Captcha - custom message
by michael.c.small
I was looking to do the same thing but didn't even realize that the CaptchaResponse annotation existed. My guess is that you need to create a getter method (with above annotation) on the Seam Component that handles the form you are associating the captcha input with.
Because I was unaware of the annotation, I found another solution. If you are using the <s:validate/>/<s:decorate> in combination with the <h:inputText/> for the captcha input, you can use a custom message from your own message bundle:
| <s:decorate id="captchaDecor">
| <h:inputText value="#{captcah.response}" required="true">
| <s:validate/>
| </h:inputText>
| <s:span rendered="#{invalid}">
| <h:outputText value="#{messages.invalidCaptcha}"/>
| </s:span>
| </s:decorate>
|
Note that "invalidCaptcha" should be whatever you named your property in your message bundle.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4046840#4046840
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4046840
18 years, 11 months
[Beginners Corner] - javax.naming.CommunicationException: Could not obtain connec
by kbird
hi call i was trying a sample program ejb3,
i am using the database mysql, ejb 3 deployed to jboss 4.0.4
but in jboss cmd, i got some thing like this as well.
-----------------------------------------------------------
--- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
ObjectName: jboss:service=Naming
State: FAILED
Reason: java.rmi.server.ExportException: Port already in use: 1098; nested exception is:
java.net.BindException: Address already in use: JVM_Bind
I Depend On:
jboss.system:service=ThreadPool
Depends On Me:
jboss.ws:service=WebServiceClientDeployer
jboss.ws.eventing:service=SubscriptionManager
jboss.mq:service=DestinationManager
jboss.mq:service=Invoker
jboss.mq:service=InvocationLayer,type=UIL
jboss.mq:service=InvocationLayer,type=UILXA
jboss.mq:service=InvocationLayer,type=UIL2,alias=UIL2ConnectionFactory
jboss.mq:service=InvocationLayer,type=UIL2XA,alias=UIL2XAConnectionFactory
jboss.jms:alias=QueueConnectionFactory
jboss.jms:alias=TopicConnectionFactory
jboss.jmx:type=adaptor,name=Invoker,protocol=jrmp,service=proxyFactory
jboss.jmx:alias=jmx/rmi/RMIAdaptor
jboss:service=TransactionManager
ObjectName: jboss.jca:service=RARDeployment,name='jboss-local-jdbc.rar'
State: NOTYETINSTALLED
Depends On Me:
jboss.jca:service=ManagedConnectionFactory,name=DefaultDS
jboss.jca:service=ManagedConnectionFactory,name=MySqlDS
ObjectName: jboss.jca:service=RARDeployment,name='jms-ra.rar'
State: NOTYETINSTALLED
Depends On Me:
jboss.jca:service=ManagedConnectionFactory,name=JmsXA
-----------------------------------------------------------
my client code,
---------------------------
Properties prop = new Properties();
prop.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
prop.put(Context.PROVIDER_URL, "localhost:1099");
Context initial;
try {
initial = new InitialContext(prop);
Calculator beanRemote = (Calculator)initial.lookup("EJB3Sample/EntityCalculator");
beanRemote.addFund("abc",0.1);
beanRemote.addFund("Blaze",0.2);
beanRemote.addFund("Apocalips",0.05);
beanRemote.addInvestor("El DeCarcia",25,55);
beanRemote.addInvestor("Marlon Brandes",20,60);
for (int i = 1; i < 4; i++) {
beanRemote.calculate(i,4-i,i*100*0.8);
}
beanRemote.getRecords();
} catch (NamingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
---------------------------
when i tried to run the code, i got the following error, Can any one tell me whats going wrong
----------------------------------------------------------------
[java] javax.naming.CommunicationException: Could not obtain connection to any of these urls: 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 localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused: connect]]]
[java] at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1414)
[java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:594)
[java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
[java] at javax.naming.InitialContext.lookup(Unknown Source)
[java] at test.com.samples.entity.basic.Client.main(Unknown Source)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[java] at java.lang.reflect.Method.invoke(Unknown Source)
[java] at org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:202)
[java] at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:134)
[java] at org.apache.tools.ant.taskdefs.Java.run(Java.java:710)
[java] at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:178)
[java] at org.apache.tools.ant.taskdefs.Java.execute(Java.java:84)
[java] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
[java] at org.apache.tools.ant.Task.perform(Task.java:364)
[java] at org.apache.tools.ant.Target.execute(Target.java:341)
[java] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[java] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
[java] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
[java] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
[java] at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
[java] at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
[java] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
[java] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
[java] Caused by: javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused: connect]]
[java] at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:269)
[java] at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1385)
[java] ... 24 more
[java] Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused: connect]
[java] at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:243)
[java] ... 25 more
[java] Caused by: java.net.ConnectException: Connection refused: connect
[java] at java.net.PlainSocketImpl.socketConnect(Native Method)
[java] at java.net.PlainSocketImpl.doConnect(Unknown Source)
[java] at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
[java] at java.net.PlainSocketImpl.connect(Unknown Source)
[java] at java.net.SocksSocketImpl.connect(Unknown Source)
[java] at java.net.Socket.connect(Unknown Source)
[java] at java.net.Socket.connect(Unknown Source)
[java] at java.net.Socket.(Unknown Source)
[java] at java.net.Socket.(Unknown Source)
[java] at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:84)
[java] at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:77)
[java] at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:239)
[java] ... 25 more
-------------------------------------------------------
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4046839#4046839
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4046839
18 years, 11 months
[Installation, Configuration & Deployment] - Help Deploying .war :: javax.xml.ws.WebServiceException
by yamasaki
Hello all,
I've used Netbeans v5.5 IDE w/JBoss 4.0.5-GA running on my desktop to create a simple web service that works great on my desktop PC (JAX-WS).
I then installed JBoss-4.0.5-GA on a linux box (using same JDK version) and set up my Oracle datasource on the linux box. Jboss starts up great, no errors.
I then tried to drop the .war file in my dist folder on my PC into the $JBOSS_HOME/server/default/deploy folder
Jboss server.log file shows it pick up the .war file and read the wsdl descriptor. i can even telnet directly to my jboss port and manually type a GET request that returns the wsdl file.
that's about as far as i'm able to get though.
if i try to create a web service client to consume the service, i keep getting the following exception when i try to run it (i does successfully build a reference to the service though):
Compiling 6 source files to C:\JBossProjects\JavaApplication27\build\classes
compile:
run:
javax.xml.ws.WebServiceException: HTTP Status-Code 404: Not Found - Not Found
at com.sun.xml.ws.util.SOAPConnectionUtil.getSOAPMessage(SOAPConnectionUtil.java:81)
at com.sun.xml.ws.encoding.soap.client.SOAPXMLDecoder.toSOAPMessage(SOAPXMLDecoder.java:100)
at com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.receive(SOAPMessageDispatcher.java:438)
at com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.doSend(SOAPMessageDispatcher.java:258)
at com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.send(SOAPMessageDispatcher.java:137)
at com.sun.xml.ws.encoding.soap.internal.DelegateBase.send(DelegateBase.java:84)
at com.sun.xml.ws.client.EndpointIFInvocationHandler.implementSEIMethod(EndpointIFInvocationHandler.java:172)
at com.sun.xml.ws.client.EndpointIFInvocationHandler.invoke(EndpointIFInvocationHandler.java:106)
at $Proxy16.byUseridShort(Unknown Source)
at javaapplication27.Main.main(Main.java:43)
Caused by: HTTP Status-Code 404: Not Found - Not Found
at com.sun.xml.ws.transport.http.client.HttpClientTransport.checkResponseCode(HttpClientTransport.java:290)
at com.sun.xml.ws.transport.http.client.HttpClientTransport.getHeaders(HttpClientTransport.java:158)
at com.sun.xml.ws.util.SOAPConnectionUtil.getSOAPMessage(SOAPConnectionUtil.java:57)
... 9 more
BUILD SUCCESSFUL (total time: 3 seconds)
This happens both if i try to create the service running netbeans straight off the linux box and using localhost, or whether i try to access the service from my local netbeans install on my pc.
The part where it builds the service reference works great. it's just when i try to access it that i get the error.
fwiw, i did an "all" installation on my PC, and an "EJB3" install on the linux server.
Thanks in advance for your help everyone.
I'm so close i can almost taste it!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4046833#4046833
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4046833
18 years, 11 months