[Beginners Corner] - log4j: loggin to different files + sheduler
by Anna_Lut
I have pack: mypack.myclass
in jboss(3.2.1) I configure 2 shedulers, which call myclass method but with different parameters (parameters define log4j category for this sheduler)
scheduler-service.xml :
| <mbean code="org.jboss.varia.scheduler.Scheduler" name=":service=Scheduler1">
| ...
| <attribute name="SchedulableClass">mypack.myclass</attribute>
| <attribute name="SchedulableArguments">paramValue1</attribute>
| <attribute name="SchedulableArgumentTypes">java.lang.String</attribute>
| ....
| </mbean>
|
| <mbean code="org.jboss.varia.scheduler.Scheduler" name=":service=Scheduler2">
| ...
| <attribute name="SchedulableClass">mypack.myclass</attribute>
| <attribute name="SchedulableArguments">paramValue2</attribute>
| <attribute name="SchedulableArgumentTypes">java.lang.String</attribute>
| ....
| </mbean>
|
In mypack.myclass constructor I initialize log4j category, depending on input parameter:
| public class myclass{
| protected static Logger log;
|
| public myclass(String log4jcategory) {
| log = Logger.getLogger(log4jCategory);
| }
| ....
| }
|
in file all\conf\log4j.xml I describe this two categories:
| <appender name="LOG1" class="org.jboss.logging.appender.DailyRollingFileAppender">
| ....
| </appender>
| <appender name="LOG2" class="org.jboss.logging.appender.DailyRollingFileAppender">
| ....
| </appender>
|
| <category name="paramValue1">
| <appender-ref ref="LOG1"/>
| ...
| </category>
|
| <category name="paramValue2">
| <appender-ref ref="LOG2"/>
| ...
| </category>
|
But as a result, when sheduler starts .... from the begining log4j puts logdata into 2 different files, but at the 3-d itteration of sheduler all data writes to one file. And this one file choose randomly.
Why logdata is writtn to one log?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4127868#4127868
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4127868
18 years, 2 months
[JBossWS] - java.lang.LinkageError
by limousyf
Hello,
I have a weird error trying to use my newly generated WS.
The problem occurs on the client side :
| Caused by: java.lang.LinkageError: Class javax/xml/soap/AttachmentPart violates loader constraints
| at java.lang.ClassLoader.defineClass1(Native Method)
| at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
| at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
| at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1815)
| at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:869)
| at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1322)
| at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1201)
| at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
| at java.lang.Class.forName0(Native Method)
| at java.lang.Class.forName(Class.java:164)
| at $Proxy70.<clinit>(Unknown Source)
| at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
| at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
| at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
| at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
| at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:588)
| at org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl.createProxy(ServiceDelegateImpl.java:331)
| at org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl.getPortInternal(ServiceDelegateImpl.java:211)
| at org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl.getPort(ServiceDelegateImpl.java:148)
| at javax.xml.ws.Service.getPort(Service.java:116)
| at authentification.bean.session.AuthentificationService.getAuthentificationPort(AuthentificationService.java:56)
| at bsa.admin.view.StartBean.login(StartBean.java:114)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:132)
| ... 38 more
|
This linkage error results in a ClassNotFoundException.
Here is the code of my WebserviceClient:
| @WebServiceClient(name = "AuthentificationService", targetNamespace = "http://session.bean.authentification/", wsdlLocation = "http://localhost:8080/AuthentificationService/Authentification?wsdl")
| public class AuthentificationService
| extends Service
| {
|
| private final static URL AUTHENTIFICATIONSERVICE_WSDL_LOCATION;
|
| static {
| URL url = null;
| try {
| url = new URL("http://localhost:8080/AuthentificationService/Authentification?wsdl");
| } catch (MalformedURLException e) {
| e.printStackTrace();
| }
| AUTHENTIFICATIONSERVICE_WSDL_LOCATION = url;
| }
|
| public AuthentificationService(URL wsdlLocation, QName serviceName) {
| super(wsdlLocation, serviceName);
| }
|
| public AuthentificationService() {
| super(AUTHENTIFICATIONSERVICE_WSDL_LOCATION, new QName("http://session.bean.authentification/", "AuthentificationService"));
| }
|
| /**
| *
| * @return
| * returns Authentification
| */
| @WebEndpoint(name = "AuthentificationPort")
| public Authentification getAuthentificationPort() {
| return (Authentification)super.getPort(new QName("http://session.bean.authentification/", "AuthentificationPort"), Authentification.class);
| }
|
| }
|
And now the (supposely) not linked Authentification.class
| @WebService(name = "Authentification", targetNamespace = "http://session.bean.authentification/")
| @SOAPBinding(style = SOAPBinding.Style.RPC)
| public interface Authentification {
|
|
| /**
| *
| * @param arg1
| * @param arg0
| * @return
| * returns authentification.bean.session.User
| */
| @WebMethod
| @WebResult(partName = "return")
| public User authenticate(
| @WebParam(name = "arg0", partName = "arg0")
| String arg0,
| @WebParam(name = "arg1", partName = "arg1")
| String arg1);
|
| /**
| *
| * @param arg1
| * @param arg0
| * @return
| * returns net.java.dev.jaxb.array.StringArray
| */
| @WebMethod
| @WebResult(partName = "return")
| public StringArray getRoles(
| @WebParam(name = "arg0", partName = "arg0")
| int arg0,
| @WebParam(name = "arg1", partName = "arg1")
| int arg1);
|
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4127865#4127865
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4127865
18 years, 2 months
[JBoss Seam] - s:decorate question
by bsmithjj
I've been trying to use s:decorate in a form. Here is the fragment I am using to 'decorate':
| <ui:composition ...>
|
| <s:div id="#{id}" style="margin-bottom:9px;">
| <label class="topLabel">
| <ui:insert name="label">Field Label</ui:insert>
| </label>
| <div>
| <ui:insert name="field">Form Field</ui:insert>
| <s:span styleClass="required" rendered="#{required}">*</s:span>
| </div>
| <s:message styleClass="invalid"/>
| </s:div>
| </ui:composition>
|
and in my form, I'm using this with s:decorate like such:
| <a4j:form id="newApplication">
|
| <h:messages/>
|
| <s:decorate template="/WEB-INF/view/components/label-on-top-fieldset.xhtml">
| <ui:param name="id" value="nameRow"/>
| <ui:define name="label">Name:</ui:define>
| <ui:define name="field">
| <h:inputText id="name" value="#{appToEdit.name}"
| styleClass="textField" style="font-weight:bold;"
| size="32" required="true"/>
| </ui:define>
| </s:decorate>
|
| ....
|
|
The problem I am having is that in addition to a submit button, I want to use a cancel button (or link); no matter which technique (button or link) I use, validation is invoked and thus I can never 'cancel' out of my form.
Is there a way to tell s:decorate to not invoke validate for a JSF request?
Thanks,
Brad Smith
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4127863#4127863
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4127863
18 years, 2 months