Re: Unable to classload servlet class using SharedLib GBean

2010-09-16 Thread Anil Chawla

Nevermind, the xmlns is wrong/out-dated. I changed it to "
http://geronimo.apache.org/xml/ns/deployment-1.2"; and was able to deploy
the XML file directly.


|>
| From:  |
|>
  
>--------|
  |Anil Chawla/Raleigh/i...@ibmus   
|
  
>|
|>
| To:|
|>
  
>|
  |user@geronimo.apache.org 
   |
  
>|
|>
| Date:  |
|>
  
>|
  |09/16/2010 11:39 AM  
   |
  
>|
|>
| Subject:   |
|>
  
>|
  |Re: Unable to classload servlet class using SharedLib GBean  
   |
  
>|





Ivan,
Thanks for your response - this sounds like a good option. I tried creating
a geronimo-service.xml according to some instructions I found (
http://www.chariotsolutions.com/geronimo/geronimo-1.1/gbeans-modules.html#id2646361
) but I'm getting the following error:

Deployment Failed
Cannot deploy the requested application module because no deployer is able
to handle it. This can happen if you have omitted the J2EE deployment
descriptor, disabled a deployer module, or if, for example, you are trying
to deploy an EJB module on a minimal Geronimo server that does not have EJB
support installed.

I used the following geronimo-service.xml and tried installing it directly
(without a JAR) and also packaging it in under META-INF in an empty JAR:


http://geronimo.apache.org/xml/ns/j2ee/deployment-1.2";>


MyApp
ClassPath
1.0
jar



org.apache.geronimo.configs

system-database
2.1.5
car



 org.apache.derby.jdbc.EmbeddedDataSource





/data/support,/data/MyApp/lib,/data/MyApp/libext


/data/support/conf,/data/MyApp/database,/data/MyApp/conf


ServerInfo




Am I going about this the right way? I appreciate any guidance you can
provide.

Inactive hide details for Ivan ---09/15/2010 09:16:04 PM---IIRC, the
SharedLib only takes affect on the runtime. One workaroundIvan
---09/15/2010 09:16:04 PM---IIRC, the SharedLib only takes affect on the
runtime. One workaround is that first deploy a geronimo
   
   
 From:   Ivan
   
   
 To: user@geronimo.apache.org  
   
   
 Date:   09/15/2010 09:16 PM   
   
   
 Subject:Re: Unable to classload servlet class using SharedLib 
 GBean 
   





IIRC, the SharedLib only takes affect on the runtime.
One workaround is that first deploy a geronimo service module which
contains the sharedlib gbean, and then add it as a dependency for your ear
application, it should work.

2010/9/15 Anil Chawla 
  Hi,
  We're trying to use the SharedLib GBean to classload *all* of the
  libraries for our application. This is because the libraries used by
  our applications in Geronimo are also needed by ou

Re: Unable to classload servlet class using SharedLib GBean

2010-09-16 Thread Anil Chawla

Ivan,
Thanks for your response - this sounds like a good option. I tried creating
a geronimo-service.xml according to some instructions I found (
http://www.chariotsolutions.com/geronimo/geronimo-1.1/gbeans-modules.html#id2646361)
 but I'm getting the following error:

Deployment Failed
Cannot deploy the requested application module because no deployer is able
to handle it.  This can happen if you have omitted the J2EE deployment
descriptor, disabled a deployer module, or if, for example, you are trying
to deploy an EJB module on a minimal Geronimo server that does not have EJB
support installed.

I used the following geronimo-service.xml and tried installing it directly
(without a JAR) and also packaging it in under META-INF in an empty JAR:


http://geronimo.apache.org/xml/ns/j2ee/deployment-1.2";>


MyApp
ClassPath
1.0
jar



org.apache.geronimo.configs

system-database
2.1.5
car




org.apache.derby.jdbc.EmbeddedDataSource





/data/support,/data/MyApp/lib,/data/MyApp/libext


/data/support/conf,/data/MyApp/database,/data/MyApp/conf


ServerInfo




Am I going about this the right way? I appreciate any guidance you can
provide.


|>
| From:  |
|>
  
>|
  |Ivan   
   |
  
>|
|>
| To:|
|>
  
>|
  |user@geronimo.apache.org 
   |
  
>|
|>
| Date:  |
|>
  
>|
  |09/15/2010 09:16 PM  
   |
  
>|
|>
| Subject:   |
|>
  
>|
  |Re: Unable to classload servlet class using SharedLib GBean  
   |
  
>|





IIRC, the SharedLib only takes affect on the runtime.
One workaround is that first deploy a geronimo service module which
contains the sharedlib gbean, and then add it as a dependency for your ear
application, it should work.

2010/9/15 Anil Chawla 
  Hi,
  We're trying to use the SharedLib GBean to classload *all* of the
  libraries for our application. This is because the libraries used by our
  applications in Geronimo are also needed by our stand-alone Java
  processes. We obviously don't want to duplicate the libraries for
  maintenance reasons. We have an EAR containing two WAR files (each
  requiring the same set of libraries), and we've defined the SharedLib
  reference within the EAR's geronimo-application.xml. The SharedLib works
  fine for all of our libraries except that it fails to classload the
  servlet file referenced in the web.xml of the two WARs. The only way
  we've been able to get it to work is to package the library containing
  our servlet class inside the EAR. Why can't the SharedLib load the
  servlet class?

  Here is the SharedLib entry in geronimo-application.xml:

  
  
  /data/support,/data/MyApp/lib,/data/MyApp/libext
  
  
  /data/support/conf,/data/MyApp/database,/data/MyApp/con

Unable to classload servlet class using SharedLib GBean

2010-09-15 Thread Anil Chawla


Hi,
We're trying to use the SharedLib GBean to classload *all* of the libraries
for our application. This is because the libraries used by our applications
in Geronimo are also needed by our stand-alone Java processes. We obviously
don't want to duplicate the libraries for maintenance reasons. We have an
EAR containing two WAR files (each requiring the same set of libraries),
and we've defined the SharedLib reference within the EAR's
geronimo-application.xml. The SharedLib works fine for all of our libraries
except that it fails to classload the servlet file referenced in the
web.xml of the two WARs. The only way we've been able to get it to work is
to package the library containing our servlet class inside the EAR. Why
can't the SharedLib load the servlet class?

Here is the SharedLib entry in geronimo-application.xml:



/data/support,/data/MyApp/lib,/data/MyApp/libext


/data/support/conf,/data/MyApp/database,/data/MyApp/conf


ServerInfo



And the servlet definition in web.xml:


front_controller

org.myapp.controller.FrontController


The "FrontController" class is defined in /data/MyApp/libext/myapp.jar.
When we deploy the EAR, we get the following exception:

Caused by: java.lang.ClassNotFoundException:
org.myapp.controller.FrontController in classloader
MyApp/application_frontend.war/1.0/car
at
org.apache.geronimo.kernel.config.MultiParentClassLoader.loadOptimizedClass
(MultiParentClassLoader.java:447)
at
org.apache.geronimo.kernel.config.MultiParentClassLoader.loadClass
(MultiParentClassLoader.java:281)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at
org.apache.geronimo.jaxws.builder.AdvancedWARWebServiceFinder.getPortInfo
(AdvancedWARWebServiceFinder.java:142)
... 22 more

Thanks for your help.

Anil Chawla

Re: Substitution variables in gbean attribute value

2010-08-25 Thread Anil Chawla

Ivan, thanks for the prompt response. Our intention is to provide our users
with a WAR/EAR file and perhaps a simple startup script that they can edit
to set the correct environment variables for their environment. It is good
to know that there is a work-around like this but it might be a little too
complicated for our users.

Is there any other option for configuring external folders in our classpath
without putting a fixed path in geronimo-web.xml? For example, is there an
easy way to append to the classpath of the server when running geronimo.sh?
If so, we can just ask our users to set APP_HOME as an environment variable
and provide a startup script that runs gernonimo.sh with the right
parameters.

Thanks,

Anil Chawla



|>
| From:  |
|>
  
>|
  |Ivan   
   |
  
>|
|>
| To:|
|>
  
>|
  |user@geronimo.apache.org 
   |
  
>|
|>
| Date:  |
|>
  
>|
  |08/25/2010 11:46 AM  
   |
  
>|
|>
| Subject:   |
|>
  
>|
  |Re: Substitution variables in gbean attribute value  
   |
  
>|





You could NOT use the substitution directly in geronimo-web.xml, but you
might try a workaround solution below, it should work :-)

a. After deploying your application into the server, then stop the server.
b. Open the var/config/config.xml, and find the segment for your
application.
c. Let's take the SharedLib as an example, add a xml fragment like :
    
    ${APP_HOME}/lib


${APP_HOME}/conf


    
d. add the APP_HOME and its real value in the
var/config/config-substitutions.properties
e. Start the server, now it should use the value configured in the
config-substitutions.properties.

2010/8/25 Anil Chawla 
  Hi,
  Is there a way to use substitution variables when defining gbeans in
  geronimo-web.xml? For example, I would like to define a SharedLib for our
  application with an APP_HOME variable that points to the actual location
  of files on the user's filesystem:

  
  ${APP_HOME}/lib
  ${APP_HOME}/conf
  
  ServerInfo
  
  

  I've tried setting an APP_HOME environment variable as well as passing
  APP_HOME as a Java system property. I even tried
  org.apache.geronimo.config.substitution.APP_HOME but that seems to be
  specific to config.xml.

  Thanks,

  Anil Chawla





--
Ivan

<><>

Substitution variables in gbean attribute value

2010-08-25 Thread Anil Chawla


Hi,
Is there a way to use substitution variables when defining gbeans in
geronimo-web.xml? For example, I would like to define a SharedLib for our
application with an APP_HOME variable that points to the actual location of
files on the user's filesystem:

  
   ${APP_HOME}/lib
${APP_HOME}/conf

ServerInfo

  

I've tried setting an APP_HOME environment variable as well as passing
APP_HOME as a Java system property. I even tried
org.apache.geronimo.config.substitution.APP_HOME but that seems to be
specific to config.xml.

Thanks,

Anil Chawla

Re: Issue regarding GeronimoLog

2010-08-20 Thread Anil Chawla

Ivan, thanks for the pointer. I was able to fix the issue by adding the
following to the deployment plan:


org.apache.geronimo.kernel.log.GeronimoLogFactory

META-INF/services/org.apache.commons.logging.LogFactory



Note that, even with the class filters, I had to add the
 property to prevent commons logging from picking up
GeronimoLogFactory from the parent classloader.

Anil Chawla



|>
| From:  |
|>
  
>|
  |Ivan   
   |
  
>|
|>
| To:|
|>
  
>|
  |user@geronimo.apache.org 
   |
  
>|
|>
| Date:  |
|>
  
>|
  |08/19/2010 09:36 PM  
   |
  
>|
|>
| Subject:   |
|>
  
>|
  |Re: Issue regarding GeronimoLog  
   |
  
>|





Hi,
    Refer to this thread, it should be helpful.

http://apache-geronimo.328035.n3.nabble.com/Application-specific-log4j-issue-tc863758.html#a863758



2010/8/19 Anil Chawla 
  Hi,
  We are moving our application to Geronimo and are encountering an issue
  with GeronimoLog. The core problem is that we are using the Apache Pig
  library and need to serialize objects created by that library. The Pig
  classes use the commons logging framework and unfortunately maintain Log
  references as instance fields rather than static fields -- which means
  that the Log field is also serialized when the object is serialized. This
  causes a failure on Geronimo when trying to serialize the Pig objects
  because the GeronimoLog implementation is not serializable. We are trying
  to find a solution without modifying all of the Pig classes.

  The only solution we have found so far is to dynamically set the
  "org.apache.commons.logging.LogFactory" system property when our
  application starts in order to replace the GeronimoLogFactory
  implementation with our own custom LogFactory implementation. Our custom
  LogFactory wraps GeronimoLog in order to make it serializable without
  breaking the normal server logging behavior. The problem with this
  approach is that it changes the LogFactory implementation for the entire
  VM and our classes are not available to other applications in the
  container.

  * Is there a way to replace the LogFactory/Log implementation but isolate
  that change to a specific WAR/EAR within Geronimo?

  * Are there any other ideas on how we might work around this issue?

  Thanks so much!

  Anil Chawla





--
Ivan

<><>

Issue regarding GeronimoLog

2010-08-19 Thread Anil Chawla


Hi,
We are moving our application to Geronimo and are encountering an issue
with GeronimoLog. The core problem is that we are using the Apache Pig
library and need to serialize objects created by that library. The Pig
classes use the commons logging framework and unfortunately maintain Log
references as instance fields rather than static fields -- which means that
the Log field is also serialized when the object is serialized. This causes
a failure on Geronimo when trying to serialize the Pig objects because the
GeronimoLog implementation is not serializable. We are trying to find a
solution without modifying all of the Pig classes.

The only solution we have found so far is to dynamically set the
"org.apache.commons.logging.LogFactory" system property when our
application starts in order to replace the GeronimoLogFactory
implementation with our own custom LogFactory implementation. Our custom
LogFactory wraps GeronimoLog in order to make it serializable without
breaking the normal server logging behavior. The problem with this approach
is that it changes the LogFactory implementation for the entire VM and our
classes are not available to other applications in the container.

* Is there a way to replace the LogFactory/Log implementation but isolate
that change to a specific WAR/EAR within Geronimo?

* Are there  any other ideas on how we might work around this issue?

Thanks so much!

Anil Chawla