[JNDI/Naming/Network] - Re: NameNotFoundException in Web-Application for 'java:comp/
by hiro.protagonist
I could isolate the problem a little more. I had the Web Application deployed through a context definition in jbossweb-tomcat55.sar/server.xml to a directory outside of the JBoss Installation. This way the web application was not deployed by [TomcatDeployer] and whenever an application does not get deployed by [TomcatDeployer] there will be no ENC [java:comp/env] for this web application, as it seems.
Now I tried the following: I deployed my Web Application in deploy/mywebapp.war and put the following context.xml into the WEB-INF directory:
| <Context debug="0" reloadable="true" swallowOutput="true">
| <Parameter name="log4j" override="false" value="/usr/share/config/log4j.properties"/>
| <Environment name="ecms/configfile" override="false" type="java.lang.String" value="/usr/share/config/service.properties" />
| </Context>
|
Now something really funny happens. The web application gets deployed by [TomcatDeployer], it can read the ServletContext Init-Parameter "log4j" as expected. it gets an ENC [java:comp/env], but the Environment parameter defined in the context.xml won't appear under [java:comp/env/ecms/configfile] as expected. In fact it doesn't appear anywhere.
Can any of the JBoss Gurus enlighten me, why JBoss is unable to setup Environment Parameters defined in a context.xml file?
My feelings are, that Tomcat uses a different JNDI Implementation then JBoss itself, so its Environment Definitions won't affect the JBoss JNDI Naming Contexts ...
Eventually I need a way to setup this ENC entry outside of the web application war file. But even the inside context.xml does not work as expected.
Any help would be really appreciated ...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4088876#4088876
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4088876
18 years, 7 months
[JBossWS] - Problems in the comunication of a WebService and a client
by Fantagir
Hi!
I'm implementing a webservice using Jbossws and jax-rpc. I develop the next one service:
package edu.campus.osid.authentication.client;
import java.rmi.Remote;
import java.rmi.RemoteException;
public interface IAuthenticationComponent extends Remote{
public boolean isUserAuthenticated(org.osid.OsidContext ctx) throws RemoteException;
}
package edu.campus.osid.authentication.client;
import java.rmi.RemoteException;
import org.osid.OsidContext;
import org.osid.OsidException;
public class AuthenticationComponent implements IAuthenticationComponent {
public boolean isUserAuthenticated(OsidContext ctx) throws RemoteException{
String str;
try {
str = (String) ctx.getContext("iduser");
int iId = Integer.parseInt(str);
if (iId ==1) return true;
else return false;
} catch (OsidException e) {
// TODO Auto-generated catch block
e.printStackTrace();
System.out.println("Error AuthenticationComponentServer/Osid: "+e.getMessage());
throw new RemoteException();
}
}
}
I have the OsidContext class in a .jar that I add in the Java Buid Path of my project. When I build the project no errors appears. But when I want to publish the service (generate the .war of the webservice, generate file .wsdl, mapping.xml) the wstools said that cant find the ?OsidContext? class.
If I unzip the .jar in the directory /bin of my project wstools can fing the classes.
There is another way of to solve this problem? What I have to do?
An other problem is in the client. I develop the client for this webservice and when I execute the next errors appears ?Cannot obtain java type mapping for: {urn:types}OsidContext?
My client code is the next one:
public class Main {
public static void main( String[] args ) throws Exception {
if( args.length < 1 )
{
System.out.println( "Usage: Id name" );
System.exit( 0 );
}
String argument = args[ 0 ];
OsidContext ctx = new OsidContext();
ctx.assignContext("iduser", argument);
//CollectionProperties propietats = new CollectionProperties();
String urlstr = CollectionProperties.getPropiedad("service.url");
String nameServiceStr = CollectionProperties.getPropiedad("service.name");
String namespaceServiceStr = CollectionProperties.getPropiedad("service.namespace");
System.out.println( "Contacting webservice at " + urlstr );
URL url = new URL(urlstr);
//se indican el namespace en el que se encuentra el servicio y su nombre
//(esto se puede ver en el WSDL)
QName qname = new QName(namespaceServiceStr,
nameServiceStr);
ServiceFactory factory = ServiceFactory.newInstance();
Service service = factory.createService( url, qname );
I AuthenticationComponent age = ( I AuthenticationComponent ) service.getPort( IAuthenticationComponent.class );
System.out.println( "age.age(" + id + ")" );
System.out.println( "output:" + age.isUserAuthenticated ( ctx ) );
}
}
What can I do? I have the .jar that contains the class OsidContext in this project as well in the project of the Webservice
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4088870#4088870
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4088870
18 years, 7 months
[JBoss Seam] - Re: seam don't set the invalid after an ajax request
by wuhaixing
thanks,I had figure it out.and there is the code can do it's work!
in the form:
| <s:decorate id="emailFormRow" template="/layout/formRow.xhtml">
| <ui:define name="label">
| <h:outputLabel for="email" value="#{messages['register.email']}"/>
| </ui:define>
| <ui:define name="field">
| <h:inputText id="email" value="#{member.email}" required="true"
| onfocus="emailHelperShow({duration:0.5,from:0.0,to:1.0})"
| onblur="emailHelperHide({duration:0.7})">
| <a4j:support event="onchange" reRender="emailFormRow" requestDelay="0" ajaxSingle="true"/>
| </h:inputText>
| </ui:define>
| <ui:param name="fieldId" value="email"/>
| <ui:param name="validateMessage" value="#{register.emailMessage}"/>
| <ui:param name="helperContent" value="tip.email"/>
| </s:decorate>
|
it's the template
| <a4j:region id="#{fieldId}Field" selfRendered="true" regionRenderOnly="true">
| <a4j:outputPanel id="#{fieldId}Block" layout="block" styleClass="formRow">
| <ui:insert/>
| <a4j:outputPanel id="#{fieldId}Label" layout="block" styleClass="formlabel #{invalid?'errlabel':''} #{required?'required':''}">
| <ui:insert name="label"/>
| </a4j:outputPanel>
|
| <a4j:outputPanel id="#{fieldId}Input" layout="block" styleClass="formfield #{invalid?'flderr':''}">
| <ui:insert name="field"/>
| <a4j:status for="#{fieldId}Field">
| <f:facet name="start">
| <h:graphicImage value="/img/icons/ajax_process.gif"/>
| </f:facet>
| </a4j:status>
| </a4j:outputPanel>
|
| <a4j:outputPanel id="#{fieldId}Helper" layout="block" rendered="#{not empty helperContent}"
| style="left:368px;display:none;" styleClass="helpMsg helperBlock" >
| <h:outputText escape="false" value="#{messages[helperContent]}"/>
| </a4j:outputPanel>
| <rich:effect name="#{fieldId}HelperHide" for="#{fieldId}Helper" type="Fade" rendered="#{not empty helperContent}"/>
| <rich:effect name="#{fieldId}HelperShow" for="#{fieldId}Helper" type="Appear" rendered="#{not empty helperContent}"/>
| <a4j:outputPanel id="#{fieldId}MessageBlock" layout="block" styleClass="errorMsg" ajaxRendered="true" rendered="#{invalid}">
| <s:message for="#{fieldId}" globalOnly="false"/>
| </a4j:outputPanel>
| </a4j:outputPanel>
| </a4j:region>
|
I also replace div with outputPanel,put the region as the wrapper to keep the style
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4088868#4088868
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4088868
18 years, 7 months