Re: J2EE Connector deployment problem
Here is a good article for the logging in Geronimo http://www.ibm.com/developerworks/websphere/tutorials/0903_madgula/index.html?ca=drs- 2009/7/10 David Jencks > > On Jul 10, 2009, at 12:36 AM, johnxmas wrote: > > >> try the following code: >> >> > class="org.apache.geronimo.system.logging.log4j.ApplicationLog4jConfigurationGBean" >> name="DirectoryLog4jConfiguration"> >> META-INF/log4j.properties >> ServerInfo >> >> >> anything else, let us know. >> >> Jeff C >> >> >> In this case, I get >> org.apache.geronimo.kernel.config.LifecycleException: start of >> com.scort.demos/vscics/1.0/ear failed >> // >> Caused by: org.apache.geronimo.gbean.InvalidConfigurationException: >> Configuration com.scort.demos/vscics/1.0/ear failed to start due to the >> following reasons: >> The service >> J2EEApplication=com.scort.demos/vscics/1.0/ear,j2eeType=SystemLog,name=DirectoryLog4jConfiguration >> did not start because >> D:\geronimo-tomcat6-javaee5-2.1.3\META-INF\log4j.properties (Le fichier >> spécifié est introuvable) >> > > That would work if you put your log4j properties file there as your > configuration says you have. If you use a file outside the rar I strongly > recommend putting it in var/your-app/log4j.properties. If you are building > a geronimo plugin using the car-maven-plugin you can easily pack the > properties file into the plugin and arrange for it to be unpacked on > installation. I receommend this kind of file based approach since it lets > users edit the config file easily. > > >> If i put log4.properties at the root of my rar and modifies >> gerionimo-ra.xml >> > class="org.apache.geronimo.system.logging.log4j.ApplicationLog4jConfigurationGBean" >> name="DirectoryLog4jConfiguration"> >> log4j.properties >> ServerInfo >> >> >> I get >> >> org.apache.geronimo.kernel.config.LifecycleException: start of >> com.scort.demos/vscics/1.0/ear failed >> >> // >> Caused by: org.apache.geronimo.gbean.InvalidConfigurationException: >> Configuration com.scort.demos/vscics/1.0/ear failed to start due to the >> following reasons: >> The service >> J2EEApplication=com.scort.demos/vscics/1.0/ear,j2eeType=SystemLog,name=DirectoryLog4jConfiguration >> did not start because D:\geronimo-tomcat6-javaee5-2.1.3\log4j.properties (Le >> fichier spécifié est introuvable) >> >> So where must I put the properties file ? (BTW, another question: may I >> use a log4j.xml file ?) >> > > If you want to keep the log.4j properties in the rar you need to get it on > the classpath so it can be found by the classloader. I.e., put it in the > classes jar inside the rar. Then you need to use the log4jResource > attribute and leave out the ServerInfo reference. Since this will make it > nearly impossible to edit the log4j.properties I can't really recommend this > variant. > > AFAIK log4j.xml files are not supported right now. I haven't tried them or > investigated what would be needed to support them, it might be very easy > patches welcome! > > thanks > david jencks > > -- Ivan
Re: J2EE Connector deployment problem
On Jul 10, 2009, at 12:36 AM, johnxmas wrote: try the following code: class = "org .apache .geronimo.system.logging.log4j.ApplicationLog4jConfigurationGBean" name="DirectoryLog4jConfiguration"> META-INF/log4j.properties ServerInfo anything else, let us know. Jeff C In this case, I get org.apache.geronimo.kernel.config.LifecycleException: start of com.scort.demos/vscics/1.0/ear failed // Caused by: org.apache.geronimo.gbean.InvalidConfigurationException: Configuration com.scort.demos/vscics/1.0/ear failed to start due to the following reasons: The service J2EEApplication=com.scort.demos/vscics/1.0/ ear,j2eeType=SystemLog,name=DirectoryLog4jConfiguration did not start because D:\geronimo-tomcat6-javaee5-2.1.3\META-INF \log4j.properties (Le fichier spécifié est introuvable) That would work if you put your log4j properties file there as your configuration says you have. If you use a file outside the rar I strongly recommend putting it in var/your-app/log4j.properties. If you are building a geronimo plugin using the car-maven-plugin you can easily pack the properties file into the plugin and arrange for it to be unpacked on installation. I receommend this kind of file based approach since it lets users edit the config file easily. If i put log4.properties at the root of my rar and modifies gerionimo-ra.xml class = "org .apache .geronimo.system.logging.log4j.ApplicationLog4jConfigurationGBean" name="DirectoryLog4jConfiguration"> log4j.properties ServerInfo I get org.apache.geronimo.kernel.config.LifecycleException: start of com.scort.demos/vscics/1.0/ear failed // Caused by: org.apache.geronimo.gbean.InvalidConfigurationException: Configuration com.scort.demos/vscics/1.0/ear failed to start due to the following reasons: The service J2EEApplication=com.scort.demos/vscics/1.0/ ear,j2eeType=SystemLog,name=DirectoryLog4jConfiguration did not start because D:\geronimo-tomcat6-javaee5-2.1.3\log4j.properties (Le fichier spécifié est introuvable) So where must I put the properties file ? (BTW, another question: may I use a log4j.xml file ?) If you want to keep the log.4j properties in the rar you need to get it on the classpath so it can be found by the classloader. I.e., put it in the classes jar inside the rar. Then you need to use the log4jResource attribute and leave out the ServerInfo reference. Since this will make it nearly impossible to edit the log4j.properties I can't really recommend this variant. AFAIK log4j.xml files are not supported right now. I haven't tried them or investigated what would be needed to support them, it might be very easy patches welcome! thanks david jencks
Re: Re: Re: J2EE Connector deployment problem
try the following code: META-INF/log4j.properties ServerInfo anything else, let us know. Jeff C In this case, I get org.apache.geronimo.kernel.config.LifecycleException: start of com.scort.demos/vscics/1.0/ear failed // Caused by: org.apache.geronimo.gbean.InvalidConfigurationException: Configuration com.scort.demos/vscics/1.0/ear failed to start due to the following reasons: The service J2EEApplication=com.scort.demos/vscics/1.0/ear,j2eeType=SystemLog,name=DirectoryLog4jConfiguration did not start because D:\geronimo-tomcat6-javaee5-2.1.3\META-INF\log4j.properties (Le fichier spécifié est introuvable) If i put log4.properties at the root of my rar and modifies gerionimo-ra.xml log4j.properties ServerInfo I get org.apache.geronimo.kernel.config.LifecycleException: start of com.scort.demos/vscics/1.0/ear failed // Caused by: org.apache.geronimo.gbean.InvalidConfigurationException: Configuration com.scort.demos/vscics/1.0/ear failed to start due to the following reasons: The service J2EEApplication=com.scort.demos/vscics/1.0/ear,j2eeType=SystemLog,name=DirectoryLog4jConfiguration did not start because D:\geronimo-tomcat6-javaee5-2.1.3\log4j.properties (Le fichier spécifié est introuvable) So where must I put the properties file ? (BTW, another question: may I use a log4j.xml file ?)
Re: Fw: Re: Re: J2EE Connector deployment problem
try the following code: META-INF/log4j.properties ServerInfo anything else, let us know. Jeff C On Thu, Jul 9, 2009 at 4:38 PM, johnxmas wrote: > After adding > > class="org.apache.geronimo.system.logging.log4j.ApplicationLog4jConfigurationGBean"> > name="log4jResource">META-INF/log4j.properties > > > to my geronimo-ra.xml, I get the following exception > 16:25:37,156 ERROR [GBeanInstanceState] Error while starting; GBean is now > in the FAILED state: > abstractName="com.scort.demos/vscics/1.0/ear?J2EEApplication=com.scort.demos/vscics/1.0/ear,j2eeType=SystemLog,name=DirectoryLog4jConfiguration" > java.lang.NullPointerException > at > org.apache.geronimo.system.logging.log4j.ApplicationLog4jConfigurationGBean.(ApplicationLog4jConfigurationGBean.java:52) > 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 > org.apache.geronimo.gbean.runtime.GBeanInstance.createInstance(GBeanInstance.java:948) > at > org.apache.geronimo.gbean.runtime.GBeanInstanceState.attemptFullStart(GBeanInstanceState.java:268) > at > org.apache.geronimo.gbean.runtime.GBeanInstanceState.start(GBeanInstanceState.java:102) > at > org.apache.geronimo.gbean.runtime.GBeanInstanceState.startRecursive(GBeanInstanceState.java:124) > at > org.apache.geronimo.gbean.runtime.GBeanInstance.startRecursive(GBeanInstance.java:555) > at > org.apache.geronimo.kernel.basic.BasicKernel.startRecursiveGBean(BasicKernel.java:379) > at > org.apache.geronimo.kernel.config.ConfigurationUtil.startConfigurationGBeans(ConfigurationUtil.java:456) > at > org.apache.geronimo.kernel.config.KernelConfigurationManager.start(KernelConfigurationManager.java:188) > at > org.apache.geronimo.kernel.config.SimpleConfigurationManager.startConfiguration(SimpleConfigurationManager.java:562) > at > org.apache.geronimo.kernel.config.SimpleConfigurationManager.startConfiguration(SimpleConfigurationManager.java:543) > 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.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34) > at > org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124) > at > org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:832) > at org.apache.geronimo.gbean.runtime.RawInvoker.invoke(RawInvoker.java:57) > at > org.apache.geronimo.kernel.basic.RawOperationInvoker.invoke(RawOperationInvoker.java:35) > at > org.apache.geronimo.kernel.basic.ProxyMethodInterceptor.intercept(ProxyMethodInterceptor.java:96) > at > org.apache.geronimo.kernel.config.EditableConfigurationManager$$EnhancerByCGLIB$$df9048d.startConfiguration() > at > org.apache.geronimo.deployment.plugin.local.StartCommand.run(StartCommand.java:67) > at java.lang.Thread.run(Thread.java:595) > -- >
Fw: Re: Re: J2EE Connector deployment problem
After adding META-INF/log4j.properties to my geronimo-ra.xml, I get the following exception 16:25:37,156 ERROR [GBeanInstanceState] Error while starting; GBean is now in the FAILED state: abstractName="com.scort.demos/vscics/1.0/ear?J2EEApplication=com.scort.demos/vscics/1.0/ear,j2eeType=SystemLog,name=DirectoryLog4jConfiguration" java.lang.NullPointerException at org.apache.geronimo.system.logging.log4j.ApplicationLog4jConfigurationGBean.(ApplicationLog4jConfigurationGBean.java:52) 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 org.apache.geronimo.gbean.runtime.GBeanInstance.createInstance(GBeanInstance.java:948) at org.apache.geronimo.gbean.runtime.GBeanInstanceState.attemptFullStart(GBeanInstanceState.java:268) at org.apache.geronimo.gbean.runtime.GBeanInstanceState.start(GBeanInstanceState.java:102) at org.apache.geronimo.gbean.runtime.GBeanInstanceState.startRecursive(GBeanInstanceState.java:124) at org.apache.geronimo.gbean.runtime.GBeanInstance.startRecursive(GBeanInstance.java:555) at org.apache.geronimo.kernel.basic.BasicKernel.startRecursiveGBean(BasicKernel.java:379) at org.apache.geronimo.kernel.config.ConfigurationUtil.startConfigurationGBeans(ConfigurationUtil.java:456) at org.apache.geronimo.kernel.config.KernelConfigurationManager.start(KernelConfigurationManager.java:188) at org.apache.geronimo.kernel.config.SimpleConfigurationManager.startConfiguration(SimpleConfigurationManager.java:562) at org.apache.geronimo.kernel.config.SimpleConfigurationManager.startConfiguration(SimpleConfigurationManager.java:543) 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.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34) at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124) at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:832) at org.apache.geronimo.gbean.runtime.RawInvoker.invoke(RawInvoker.java:57) at org.apache.geronimo.kernel.basic.RawOperationInvoker.invoke(RawOperationInvoker.java:35) at org.apache.geronimo.kernel.basic.ProxyMethodInterceptor.intercept(ProxyMethodInterceptor.java:96) at org.apache.geronimo.kernel.config.EditableConfigurationManager$$EnhancerByCGLIB$$df9048d.startConfiguration() at org.apache.geronimo.deployment.plugin.local.StartCommand.run(StartCommand.java:67) at java.lang.Thread.run(Thread.java:595)
Re: J2EE Connector deployment problem
Try to remove the element, just leave definition. Forrest
J2EE Connector deployment problem
Hi, I'm trying to add a GBean for log4j in a resource adapter, but I get the following error: jar:file:/D:/geronimo-tomcat6-javaee5-2.1.3/var/temp/geronimo-deploymentUtil45578.rar!/META-INF/geronimo-ra.xml:58:3: error: cvc-complex-type.2.4a: Expected element 'resourceadap...@http://geronimo.apache.org/xml/ns/j2ee/connector-1.2' instead of 'serv...@http://geronimo.apache.org/xml/ns/j2ee/connector-1.2' here in element connec...@http://geronimo.apache.org/xml/ns/j2ee/connector-1.2 My geronimo-ra.xml looks like that // // META-INF/log4j.properties Where must I include the GBean element ? Thanks for your help Jean-Noël