Re: Cocoon 2.2 WebApp in JBoss 7

2013-03-11 Thread Fawzib Rojas
ctory.doGetBean(AbstractBeanFactory.java:292) 
[spring-beans-3.2.1.RELEASE.jar:3.2.1.RELEASE]
at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) 
[spring-beans-3.2.1.RELEASE.jar:3.2.1.RELEASE]
at 
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:323) 
[spring-beans-3.2.1.RELEASE.jar:3.2.1.RELEASE]

... 25 more
Caused by: java.net.MalformedURLException: Could not resolve 
blockcontext:/webapp-logger/ due to java.net.MalformedURLException: 
Unknown block name webapp-logger in block context uri 
blockcontext:/webapp-logger/
at 
org.apache.cocoon.servletservice.spring.ServletFactoryBean.init(ServletFactoryBean.java:111) 
[cocoon-servlet-service-impl-1.0.0.jar:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
[rt.jar:1.6.0_18]
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
[rt.jar:1.6.0_18]
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
[rt.jar:1.6.0_18]

at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_18]
at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1612) 
[spring-beans-3.2.1.RELEASE.jar:3.2.1.RELEASE]
at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1553) 
[spring-beans-3.2.1.RELEASE.jar:3.2.1.RELEASE]
at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1483) 
[spring-beans-3.2.1.RELEASE.jar:3.2.1.RELEASE]

... 32 more


On 3/11/2013 10:18 AM, Fawzib Rojas wrote:
Ok, commented the OSGI stuff out (shouldnt it check if it is an OSGI 
bundle before deploying as such?) and now is deploying but with a ton 
of Spring errors:


10:04:24,163 DEBUG 
[org.springframework.core.io.support.PathMatchingResourcePatternResolver] 
(MSC service thread 1-2) Cannot search for matching files underneath 
URL 
[vfs:/C:/jboss-as-7.1.1.Final/bin/content/spectron.war/WEB-INF/lib/cocoon-expression-language-impl-1.0.0.jar/META-INF/cocoon/spring/] 
because it does not correspond to a directory in the file system: 
java.io.FileNotFoundException: URL 
[vfs:/C:/jboss-as-7.1.1.Final/bin/content/spectron.war/WEB-INF/lib/cocoon-expression-language-impl-1.0.0.jar/META-INF/cocoon/spring/] 
cannot be resolved to absolute file path because it does not reside in 
the file system: 
vfs:/C:/jboss-as-7.1.1.Final/bin/content/spectron.war/WEB-INF/lib/cocoon-expression-language-impl-1.0.0.jar/META-INF/cocoon/spring/
at 
org.springframework.util.ResourceUtils.getFile(ResourceUtils.java:198) 
[spring-core-2.5.1.jar:2.5.1]



On 3/8/2013 3:09 PM, gelo1234 wrote:
In every jar file :) But I don't think that such procedure will make 
your app work. Apparently its not OSGi app :)


It looks to me that your jBoss is starting up in default OSGi mode or 
is treating your war file as an OSGi bundle.


You can fix this:
1. either by removing OSGI-specific info in every jar file 
(META-INF/MANIFEST.MF) - so jBoss wont recognize them as OSGi bundles
2. or comment out the OSGi subsystem in jBoss if you dont plan to use 
it at all:

in jBoss standalone.xml file comment out:
|

||

|
or remove it and RESTART the jBoss server. Now your war file should 
be recognized as a standard JEE war file.


Greetings,
-Greg








Re: Cocoon 2.2 WebApp in JBoss 7

2013-03-11 Thread Fawzib Rojas
Ok, commented the OSGI stuff out (shouldnt it check if it is an OSGI 
bundle before deploying as such?) and now is deploying but with a ton of 
Spring errors:


10:04:24,163 DEBUG 
[org.springframework.core.io.support.PathMatchingResourcePatternResolver] (MSC 
service thread 1-2) Cannot search for matching files underneath URL 
[vfs:/C:/jboss-as-7.1.1.Final/bin/content/spectron.war/WEB-INF/lib/cocoon-expression-language-impl-1.0.0.jar/META-INF/cocoon/spring/] 
because it does not correspond to a directory in the file system: 
java.io.FileNotFoundException: URL 
[vfs:/C:/jboss-as-7.1.1.Final/bin/content/spectron.war/WEB-INF/lib/cocoon-expression-language-impl-1.0.0.jar/META-INF/cocoon/spring/] 
cannot be resolved to absolute file path because it does not reside in 
the file system: 
vfs:/C:/jboss-as-7.1.1.Final/bin/content/spectron.war/WEB-INF/lib/cocoon-expression-language-impl-1.0.0.jar/META-INF/cocoon/spring/
at 
org.springframework.util.ResourceUtils.getFile(ResourceUtils.java:198) 
[spring-core-2.5.1.jar:2.5.1]
at 
org.springframework.core.io.UrlResource.getFile(UrlResource.java:156) 
[spring-core-2.5.1.jar:2.5.1]
at 
org.springframework.core.io.support.PathMatchingResourcePatternResolver.doFindPathMatchingFileResources(PathMatchingResourcePatternResolver.java:457) 
[spring-core-2.5.1.jar:2.5.1]
at 
org.springframework.web.context.support.ServletContextResourcePatternResolver.doFindPathMatchingFileResources(ServletContextResourcePatternResolver.java:80) 
[spring-web-2.5.1.jar:2.5.1]
at 
org.springframework.core.io.support.PathMatchingResourcePatternResolver.findPathMatchingResources(PathMatchingResourcePatternResolver.java:323) 
[spring-core-2.5.1.jar:2.5.1]
at 
org.springframework.core.io.support.PathMatchingResourcePatternResolver.getResources(PathMatchingResourcePatternResolver.java:244) 
[spring-core-2.5.1.jar:2.5.1]
at 
org.springframework.context.support.AbstractApplicationContext.getResources(AbstractApplicationContext.java:1026) 
[spring-context-2.5.1.jar:2.5.1]
at 
org.apache.cocoon.spring.configurator.impl.AbstractSettingsElementParser.handleBeanInclude(AbstractSettingsElementParser.java:184) 
[cocoon-spring-configurator-1.0.2.jar:]
at 
org.apache.cocoon.spring.configurator.impl.AbstractSettingsElementParser.parse(AbstractSettingsElementParser.java:145) 
[cocoon-spring-configurator-1.0.2.jar:]
at 
org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:69) 
[spring-beans-2.5.1.jar:2.5.1]
at 
org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1246) 
[spring-beans-2.5.1.jar:2.5.1]
at 
org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1236) 
[spring-beans-2.5.1.jar:2.5.1]
at 
org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135) 
[spring-beans-2.5.1.jar:2.5.1]
at 
org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92) 
[spring-beans-2.5.1.jar:2.5.1]
at 
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:488) 
[spring-beans-2.5.1.jar:2.5.1]
at 
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:383) 
[spring-beans-2.5.1.jar:2.5.1]
at 
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:327) 
[spring-beans-2.5.1.jar:2.5.1]
at 
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:295) 
[spring-beans-2.5.1.jar:2.5.1]
at 
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143) 
[spring-beans-2.5.1.jar:2.5.1]
at 
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178) 
[spring-beans-2.5.1.jar:2.5.1]
at 
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149) 
[spring-beans-2.5.1.jar:2.5.1]
at 
org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124) 
[spring-web-2.5.1.jar:2.5.1]
at 
org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92) 
[spring-web-2.5.1.jar:2.5.1]
at 
org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:97) 
[spring-context-2.5.1.jar:2.5.1]
at 
org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:411) 
[spring-

Re: Cocoon 2.2 WebApp in JBoss 7

2013-03-08 Thread Fawzib Rojas

In every jar in the war archive? I hope not. Maybe another question:

I'm putting the war in the standalone/deployments directory so it gets 
autodeployed. Is there a way to deploy in Jboss and tell it "It is a 
war, not osgi bundle"?


On 3/8/2013 2:29 PM, gelo1234 wrote:

Hi Fawzib,

Looks like you are trying to deploy spectron.war as an OSGi 
bundle/application, so you need OSGi-compatible META-INF/MANIFEST

file in every .jar

Greetings,
Greg


2013/3/8 Fawzib Rojas <mailto:f_ro...@spectron-msim.com>>


Anyone tried running a cocoon 2.2 webapp (war) in JBoss 7? I have
run a simple cocoon 2.2 app (just says Cocoon 2.2 runs!) in
Glassfish and Jetty8 but is giving me an error in JBoss 7.1.1

10:45:26,737 DEBUG
[org.jboss.osgi.framework.internal.AbstractFrameworkService] (MSC
service thread 1-1) Starting: service jbosgi.Framework.ACTIVATOR
in mode ON_DEMAND

10:45:26,741 DEBUG [org.jboss.as.osgi] (MSC service thread 1-6)
Starting: service jboss.osgi.deployment."spectron.war" in mode ACTIVE
10:45:26,746 ERROR [org.jboss.msc.service.fail] (MSC service
thread 1-6) MSC1: Failed to start service
jboss.osgi.deployment."spectron.war":
org.jboss.msc.service.StartException in service
jboss.osgi.deployment."spectron.war": JBAS011966: Failed to
install deployment: [:1.0.0,location=spectron.war]
at

org.jboss.as.osgi.deployment.BundleInstallService.start(BundleInstallService.java:100)

at

org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
[jboss-msc-1.0.2.GA.jar:1.0.2.GA <http://1.0.2.GA>]
at

org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
[jboss-msc-1.0.2.GA.jar:1.0.2.GA <http://1.0.2.GA>]
at

java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
[rt.jar:1.6.0_18]
at

java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
[rt.jar:1.6.0_18]at java.lang.Thread.run(Thread.java:619)
[rt.jar:1.6.0_18]
Caused by: java.lang.IllegalArgumentException: Empty name segment
is not allowed for 8
at org.jboss.msc.service.ServiceName.of(ServiceName.java:85)
[jboss-msc-1.0.2.GA.jar:1.0.2.GA <http://1.0.2.GA>]
at

org.jboss.osgi.framework.internal.BundleManager.getServiceNameInternal(BundleManager.java:245)

at

org.jboss.osgi.framework.internal.BundleManager.getServiceName(BundleManager.java:234)

at

org.jboss.osgi.framework.internal.HostBundleInstalledService.addService(HostBundleInstalledService.java:39)

at

org.jboss.osgi.framework.internal.BundleManager.installBundle(BundleManager.java:392)

at

org.jboss.as.osgi.deployment.BundleInstallService.start(BundleInstallService.java:97)
... 5 more

10:45:26,776 INFO  [org.jboss.as.server]
(DeploymentScanner-threads - 2) JBAS015870: Deploy of deployment
"spectron.war" was rolled back with failure message {"JBAS014671:
Failed services" => {"jboss.osgi.deployment.\"spectron.war\"" =>
"org.jboss.msc.service.StartException in service
jboss.osgi.deployment.\"spectron.war\": JBAS011966: Failed to
install deployment: [:1.0.0,location=spectron.war]"}}

10:45:26,783 ERROR [org.jboss.as.server.deployment] (MSC service
thread 1-5) JBAS015892: Deployment unit processor
org.jboss.as.jpa.processor.PersistenceProviderProcessor@43285f7a
unexpectedly threw an exception during undeploy phase INSTALL of
deployment "spectron.war": java.lang.NullPointerException
at

org.jboss.as.jpa.processor.PersistenceProviderProcessor.allDeploymentModuleClassLoaders(PersistenceProviderProcessor.java:138)
at

org.jboss.as.jpa.processor.PersistenceProviderProcessor.undeploy(PersistenceProviderProcessor.java:122)
at

org.jboss.as.server.deployment.DeploymentUnitPhaseService.safeUndeploy(DeploymentUnitPhaseService.java:167)
[jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at

org.jboss.as.server.deployment.DeploymentUnitPhaseService.stop(DeploymentUnitPhaseService.java:161)
[jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at

org.jboss.msc.service.ServiceControllerImpl$StopTask.stopService(ServiceControllerImpl.java:1911)
[jboss-msc-1.0.2.GA.jar:1.0.2.GA <http://1.0.2.GA>]
at

org.jboss.msc.service.ServiceControllerImpl$StopTask.run(ServiceControllerImpl.java:1874)
[jboss-msc-1.0.2.GA.jar:1.0.2.GA <http://1.0.2.GA>]
at

java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
[rt.jar:1.6.0_18]
at

java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
[rt.jar:1.6.0_18]
at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_18]

Cocoon 2.2 WebApp in JBoss 7

2013-03-08 Thread Fawzib Rojas
Anyone tried running a cocoon 2.2 webapp (war) in JBoss 7? I have run a 
simple cocoon 2.2 app (just says Cocoon 2.2 runs!) in Glassfish and 
Jetty8 but is giving me an error in JBoss 7.1.1


10:45:26,737 DEBUG 
[org.jboss.osgi.framework.internal.AbstractFrameworkService] (MSC 
service thread 1-1) Starting: service jbosgi.Framework.ACTIVATOR in mode 
ON_DEMAND


10:45:26,741 DEBUG [org.jboss.as.osgi] (MSC service thread 1-6) 
Starting: service jboss.osgi.deployment."spectron.war" in mode ACTIVE
10:45:26,746 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-6) 
MSC1: Failed to start service jboss.osgi.deployment."spectron.war": 
org.jboss.msc.service.StartException in service 
jboss.osgi.deployment."spectron.war": JBAS011966: Failed to install 
deployment: [:1.0.0,location=spectron.war]
at 
org.jboss.as.osgi.deployment.BundleInstallService.start(BundleInstallService.java:100) 

at 
org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) 
[jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at 
org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) 
[jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) 
[rt.jar:1.6.0_18]
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) 
[rt.jar:1.6.0_18]at java.lang.Thread.run(Thread.java:619) 
[rt.jar:1.6.0_18]
Caused by: java.lang.IllegalArgumentException: Empty name segment is not 
allowed for 8
at org.jboss.msc.service.ServiceName.of(ServiceName.java:85) 
[jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at 
org.jboss.osgi.framework.internal.BundleManager.getServiceNameInternal(BundleManager.java:245) 

at 
org.jboss.osgi.framework.internal.BundleManager.getServiceName(BundleManager.java:234) 

at 
org.jboss.osgi.framework.internal.HostBundleInstalledService.addService(HostBundleInstalledService.java:39) 

at 
org.jboss.osgi.framework.internal.BundleManager.installBundle(BundleManager.java:392) 

at 
org.jboss.as.osgi.deployment.BundleInstallService.start(BundleInstallService.java:97)

... 5 more

10:45:26,776 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) 
JBAS015870: Deploy of deployment "spectron.war" was rolled back with 
failure message {"JBAS014671: Failed services" => 
{"jboss.osgi.deployment.\"spectron.war\"" => 
"org.jboss.msc.service.StartException in service 
jboss.osgi.deployment.\"spectron.war\": JBAS011966: Failed to install 
deployment: [:1.0.0,location=spectron.war]"}}


10:45:26,783 ERROR [org.jboss.as.server.deployment] (MSC service thread 
1-5) JBAS015892: Deployment unit processor 
org.jboss.as.jpa.processor.PersistenceProviderProcessor@43285f7a 
unexpectedly threw an exception during undeploy phase INSTALL of 
deployment "spectron.war": java.lang.NullPointerException
at 
org.jboss.as.jpa.processor.PersistenceProviderProcessor.allDeploymentModuleClassLoaders(PersistenceProviderProcessor.java:138)
at 
org.jboss.as.jpa.processor.PersistenceProviderProcessor.undeploy(PersistenceProviderProcessor.java:122)
at 
org.jboss.as.server.deployment.DeploymentUnitPhaseService.safeUndeploy(DeploymentUnitPhaseService.java:167) 
[jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at 
org.jboss.as.server.deployment.DeploymentUnitPhaseService.stop(DeploymentUnitPhaseService.java:161) 
[jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at 
org.jboss.msc.service.ServiceControllerImpl$StopTask.stopService(ServiceControllerImpl.java:1911) 
[jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at 
org.jboss.msc.service.ServiceControllerImpl$StopTask.run(ServiceControllerImpl.java:1874) 
[jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) 
[rt.jar:1.6.0_18]
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) 
[rt.jar:1.6.0_18]

at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_18]

10:45:26,862 INFO  [org.jboss.as.server.deployment] (MSC service thread 
1-1) JBAS015877: Stopped deployment spectron.war in 84ms
10:45:26,866 INFO  [org.jboss.as.controller] (DeploymentScanner-threads 
- 2) JBAS014774: Service status report
JBAS014777:   Services which failed to start:  service 
jboss.osgi.deployment."spectron.war": 
org.jboss.msc.service.StartException in service 
jboss.osgi.deployment."spectron.war": JBAS011966: Failed to install 
deployment: [:1.0.0,location=spectron.war]
10:45:26,874 ERROR [org.jboss.as.server.deployment.scanner] 
(DeploymentScanner-threads - 1) {"JBAS014653: Composite operation failed 
and was rolled back. Steps that failed:" => {"Operation step-2" => 
{"JBAS014671: Failed services" => 
{"jboss.osgi.deployment.\"spectron.war\"" => 
"org.jboss.msc.service.StartException in service 
jboss.osgi.deployment.\"spectron.war\": JBAS011966: Failed to install 
deployment: [:1.0.0,location=spectron.war]"


-
jetty.xml
-


jdbc/

Cocoon App as a Web Application Bundle (WAB)

2012-04-17 Thread Fawzib Rojas
Are there any instructions around on how to make a cocoon application in 
a web application bundle to install in an OSGI container?


I have an application with 3 blocks: web-app (block1,block2,block3). I 
imagine I have to create an activator but was wondering if someone has 
already done this.


-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Cocoon 2.1/2.2 API Docs?

2012-03-19 Thread Fawzib Rojas
Where are the Cocoon API docs? All the links I've clicked at Apache 
Cocoon site send me to a 'Not Found' page...


-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Weird I18NTransformer problem (Cocoon 2.2)

2012-03-14 Thread Fawzib Rojas
I Cocoon 2.2 running on Glassfish 3.1 and I'm using the I18nTransformer 
and I'm using a generator to create the translation files (see pipelines 
and transformer config below), my problem is thet when I use the 
DerbyEmbedded database, the transformer does not work, I can call the 
pipelines ok so is a transformer+DerbyEmbedded problem. It works with 
DerbyNetworkServer and MSSQL.


Transformer config:

src="org.apache.cocoon.transformation.I18nTransformer">




untranslated
true


Dictionary pipelines:




















-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: Cocoon 2.2 and OSGI

2012-03-12 Thread Fawzib Rojas

On 3/2/2012 11:20 AM, Fawzib Rojas wrote:
I have been working in Glassfish and OSGI and was wondering, did 
Cocoon 2.2 was ever made into an OSGI bundle? I googled some info 
about it and all I saw was some messages from 2005-2008 talking about 
it and a wiki page about "experimenting" with it, last edited on 2009.


-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org


So no info on this?

-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Cocoon 2.2 and OSGI

2012-03-02 Thread Fawzib Rojas
I have been working in Glassfish and OSGI and was wondering, did Cocoon 
2.2 was ever made into an OSGI bundle? I googled some info about it and 
all I saw was some messages from 2005-2008 talking about it and a wiki 
page about "experimenting" with it, last edited on 2009.


-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: Tomcat 64 bit

2011-10-11 Thread Fawzib Rojas
If you run Tomcat from said folder (C:\Program Files\Apache Software 
Foundation\apache-tomcat-7.0.22\) all u need is to find the current 
working directory.


I think System.out.println(new File(".").getAbsolutePath()) will print 
the working directory. It will have the "." at the end (at least in 
windows), remember to remove it.


On 10/11/2011 1:28 PM, Paul Joseph wrote:

Hi Andy,

Thank you very much for your crystal clear explanation, I get it now.

Following your suggestion, I traced back the code and find that the 
function below is the culprit.  I wrote it in an attempt to return the 
"root directory" of the Tomcat application, and it has somehow managed 
to work in 32 bit Tomcat over numerous installations.


i.e. the function below, typically returns: "C:\Program Files\Apache 
Software Foundation\apache-tomcat-7.0.22\", but is not working 
apparently for this present 64 bit install, though on looking at it 
after seven years, I must say I wonder how it has worked so long.


Is there a more direct way to get this same info.?  Once I get this 
string, I simply tack on the remaining part of the path to where I 
would like to write the file.


Thanks much!
Paul

  private static final String FILE_SEPARATOR = File.separator;

  private String getRootDirAbsolutePath() {
  SystemUtils systemBean = new SystemUtils();
  String javaClassPath = systemBean.JAVA_CLASS_PATH;
  String osName = systemBean.OS_NAME;
  if(osName.equals("Linux")){
  int index = javaClassPath.lastIndexOf(":");
  javaClassPath=javaClassPath.substring(index+1, 
javaClassPath.length());

  }
  String oneDirUp = 
javaClassPath.substring(0,javaClassPath.lastIndexOf(FILE_SEPARATOR));
  String twoDirsUp = 
oneDirUp.substring(0,oneDirUp.lastIndexOf(FILE_SEPARATOR));

  String rootDirAbsolutePath = twoDirsUp + FILE_SEPARATOR
  return rootDirAbsolutePath;
  }




-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Cocoon 2.2 + Glassfish 3.1

2011-03-14 Thread Fawzib Rojas
I'm trying to deploy a cocoon 2.2 app to Glassfish 3.1 but it's not 
working, the app deploys on Geronimo 2.2. Anyone has a sample (or is 
using) Glassfish with Cocoon 2.2? The error I'm getting in Glassfish is:


SEVERE: Exception while loading the app : 
java.lang.IllegalStateException: ContainerBase.addChild: start: 
org.apache.catalina.LifecycleException: 
org.springframework.beans.factory.BeanCreationException: Error creating 
bean with name 'com.spectron.website.webapp-home.service': Cannot 
resolve reference to bean 'com.spectron.website.webapp-logger.service' 
while setting bean property 'connections' with key [TypedStringValue: 
value [loggerBlock], target type [null]]; nested exception is 
org.springframework.beans.factory.BeanCreationException: Error creating 
bean with name 'com.spectron.website.webapp-logger.service': Invocation 
of init method failed; nested exception is 
java.net.MalformedURLException: Could not resolve 
blockcontext:/webapp-logger/ due to java.net.MalformedURLException: 
Unknown block name webapp-logger in block context uri 
blockcontext:/webapp-logger/



-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Odd Cocoon 2.2 POST problem

2011-03-08 Thread Fawzib Rojas
I'm making a generator that is a descendant of AbstractGenerator. The 
problem I'm having is when I use a POST. If in my form I use the 
encoding type "text/plain" all works well, content-length is ok, I open 
the stream and read the posted data. If I use the encoding type 
"application/x-www-form-urlencoded" or "multipart/form-data", the 
content length is ok, but I get no data on the stream.


What am I doing wrong?

-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: configuring FOP NG for Cocoon2.2

2011-03-01 Thread Fawzib Rojas
AFAIK the cocoon-fop-ng-impl in the repositories is for cocoon 2.1 (It 
didnt work for me). I made a new version of the cocoon-fop-ng-impl and a 
new block cocoon-batik-ng-impl. Both seem to be working for me. The fop 
block uses fop-1.0, batik block uses batik-1.7.


You can get it from http://www.megaupload.com/?d=KUCDZ3XE , hope it 
works for you.


Faw

On 3/1/2011 6:15 AM, Robby Pelssers wrote:

Hi all,

I was wondering if someone had some notes on configuring  the 
org.apache.cocoon.blocks.fop.FOPNGSerializer.

I found following page 'FOP and Embedding Fonts' at 
http://cocoon.apache.org/2.2/blocks/fop/1.0/1225_1_1.html but it looks written 
for Cocoon2.1.x.

E.g.
$ cd %PATH_TO_COCOON%\lib  does not really apply in my case since Cocoon2.2 
uses maven and I don't have a cocoon lib folder unless I switch to using the 
target (build) folder of my cocoon maven project.

And the configuration file does not really match a configuration file of FOP1.0.


   
 


Any help or usefull pointers are appreciated.

Cheers,
Robby Pelssers

-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: how-to use fop1.0 with Cocoon2.2

2011-01-12 Thread Fawzib Rojas
I'm using fop 1.0 and batik 1.7 with Cocoon 2.2. There was a 
cocoon-fop-ng-impl floating around but it didnt work, embedded svgs 
crashed it (I posted a message about it here). I made a few changes to 
cocoon-fop-ng-impl  and made a cocoon-batik-ng-impl and got it working.


You can get the source for both blocks from:
 http://www.megaupload.com/?d=KUCDZ3XE

Faw

On 1/12/2011 8:55 AM, Robby Pelssers wrote:

Hi all,

i was wondering if somebody already managed to use fop1.0 with Cocoon2.2 and 
can he share some notes on how-to or is this already documented somewhere?

Kind regards,
Robby Pelssers

-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: Cocoon 2.2 block+sitemap question

2010-11-03 Thread Fawzib Rojas
I have a webapp (war) that we use at our company it has a few blocks 
(let say block-a to block-d), I want to install that war at our clients 
but they should not have block-b. The simplest option would be just 
remove that block and serve a simple document if its not found. The 
other option is have 2 projects one for us one for clients which seems 
extra work since the only difference is:


a) block-b not included
b) change a matcher in block-a sitemap from this:


  


  


to this:



  


  



On 11/2/2010 11:17 AM, Robby Pelssers wrote:

I have a more urgent question to you...

why would you want to sometimes not include block-b???  I think your design 
should be reconsidered drastically because this makes no sense to me... so i'll 
await your reponse for a good reason ;-)

Robby


-Oorspronkelijk bericht-
Van: Fawzib Rojas [mailto:f_ro...@spectron-msim.com]
Verzonden: di 2-11-2010 14:43
Aan: users@cocoon.apache.org
Onderwerp: Cocoon 2.2 block+sitemap question

I have 2 blocks (block-a and block-b) and I want to serve an xml from
block-b in block-a so i did the following:

block-a/block-servlet-service.xml:






block-a/sitemap.xml:







That way i can read the my document using /block-a/document.  In certain
instances block-b wont be included in the war so I want the
/block-a/document to go to a default document in block-a so I thought of
adding an error handler, something like this:
















Since the connection in the block-a/block-servlet-service.xml cannot be
made the war is not loaded so this method wont work. Is there another
way to do this?

-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org





-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org




Cocoon 2.2 block+sitemap question

2010-11-02 Thread Fawzib Rojas
I have 2 blocks (block-a and block-b) and I want to serve an xml from 
block-b in block-a so i did the following:


block-a/block-servlet-service.xml:
context-path="blockcontext:/block-a/">






block-a/sitemap.xml:







That way i can read the my document using /block-a/document.  In certain 
instances block-b wont be included in the war so I want the 
/block-a/document to go to a default document in block-a so I thought of 
adding an error handler, something like this:

















Since the connection in the block-a/block-servlet-service.xml cannot be 
made the war is not loaded so this method wont work. Is there another 
way to do this?


-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



I really appreciate if somebody would help me with Cocoon 2.2/Fop/Batik

2010-10-15 Thread Fawzib Rojas

 I've posted twice about this and got no response.

My problem:

I'm moving from cocoon 2.1 to 2.2 (haven't done it yet because I knew 
maven would be a PITA and it didn't dissapoint). After a lot of hair 
pulling I finally compiled my webapp + blocks for cocoon 2.2 and was 
able to deploy on geronimo. The problem now is that cocoon-fop-impl will 
not work with embedded SVG. It uses fop-0.20.4 which wants to use batik 
1.6 and those 2 are incompatible. After looking around in a lot of posts 
found out about cocoon-fop-ng-impl, unfortunately it cant be found on 
maven (why?). Found a post that linked to the source, after more hair 
pulling got it working cocoon-fop-ng-impl+fop-1.0+batik 1.7.


I thought I was done but no. Now the SVG serializer stopped working. So 
I'll try and make a batik-ng. I did and now batik is giving me errors I 
was getting NullPointerException in SAXDocumentFactory.java at:


public void startElement(String uri,String localName,String 
rawName,Attributes attributes) throws SAXException {

// Check If we should halt early.
if (HaltingThread.hasBeenHalted()) {
throw new SAXException(new InterruptedIOException());
}
if (inProlog) {
// for some reason parser is null here
inProlog = false;
try {
isStandalone = parser.getFeature
("http://xml.org/sax/features/is-standalone";);
} catch (SAXNotRecognizedException ex) {
}
try {
xmlVersion = (String) parser.getProperty
("http://xml.org/sax/properties/document-xml-version";);
} catch (SAXNotRecognizedException ex) {
}
}
.
}

I moved both trys to where the parser is created since that code just 
saves the values so *I think* it makes no difference. Now I get another 
error:


java.lang.ClassCastException: org.apache.batik.dom.GenericElement cannot 
be cast to org.w3c.dom.svg.SVGSVGElement


after another search found a post talking about 
DOMUtilities.deepCloneDocument saying it would convert dom to Batik's 
own dom. It gives me the same error, so I'm stuck. I would really 
appreciate any help on this.



It was much easier to work with Cocoon 2.1, just add jars to build path 
in eclipse and that was it. I find maven to be an obstacle, most of the 
time I'm fighting it to get something done. When the dust settles I 
still end up downloading and creating my own things because what I need 
either outdated (cocoon-fop-impl), non-existent even though it was 
created a long time ago (cocoon-fop-ng-impl) or just wrongly configured 
(cocoon-fop-impl again).


Also, why when a new version of a library is created most of the time 
compatibility is just ignored (and I see this a lot with java)? Why not 
add a simple class that uses the old interfaces so you can move up to 
new versions without problems.



-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Cocoon 2.2 + Fop + Embedded SVG

2010-10-05 Thread Fawzib Rojas
 I posted another message about trying to get cocoon-fop-ng-impl and 
being unable to find it. This is another problem.
Since I cant use cocoon-fop-ng-impl I used cocoon-fop-impl as a 
dependency for my block. I can create PDF but I cant create a PDF with 
an embedded SVG I get the following error:


java.lang.NoSuchMethodError: 
org.apache.batik.bridge.UnitProcessor.createContext(Lorg/apache/batik/bridge/BridgeContext;Lorg/w3c/dom/Element;)Lorg/apache/batik/util/UnitProcessor$Context;
at org.apache.fop.svg.SVGElement.layout(SVGElement.java:218)
at 
org.apache.fop.fo.flow.InstreamForeignObject.layout(InstreamForeignObject.java:251)
at org.apache.fop.fo.flow.Block.layout(Block.java:257)
at org.apache.fop.fo.flow.Block.layout(Block.java:257)
at org.apache.fop.fo.flow.AbstractFlow.layout(AbstractFlow.java:154)
at org.apache.fop.fo.flow.AbstractFlow.layout(AbstractFlow.java:110)
.

From looking around is seems fop 0.20.5 is incompatible with batik-1.6 
(according to http://jira.codehaus.org/browse/MPPDF-32) yet cocoon-fop-impl 
uses it as a dependency. How
can I get a working cocoon-fop-impl (or even better cocoon-fop-ng-impl)?



-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



cocoon-fop-ng-impl?

2010-10-04 Thread Fawzib Rojas
 I wanted to use the latest fop in cocoon 2.2 because I read that the 
new fop-ng can get resources (images) from a relative path defined in 
the cocoon sitemap. After looking around I found this message:


http://markmail.org/search/?q=fop-ng#query:fop-ng+page:1+mid:yplzxhpswu6yrya6+state:results

It has been almost a year since that message. My question is: why isn't 
cocoon-fop-ng-impl available? Is there a problem with it?


-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: Runnable in flowscript?

2010-03-19 Thread Fawzib Rojas

I'm using cocoon 2.1.10.

On 3/19/2010 3:16 PM, Robby Pelssers wrote:

I did find the java class which probably get's called by the javascript 
wrapper...

src\java\org\apache\cocoon\components\flow\javascript\fom\FOM_Cocoon.java

public void jsFunction_processPipelineTo(String uri, Object map, Object 
outputStream) throws Exception


So my best tip is to attach the sources and put a breakpoint in that method...

Hope you find a solution and if you do ... please post back the solution.

Cheers,
Robby

-Original Message-
From: Robby Pelssers [mailto:robby.pelss...@ciber.com]
Sent: Friday, March 19, 2010 8:11 PM
To: users@cocoon.apache.org
Subject: RE: Runnable in flowscript?

mm I actually was searching for the flowscript shipped with cocoon which is 
being called... But I can't seem to find it in the cocoon sources... Which 
version of cocoon are you using by the way?

I'm trying to understand what the flowscript function does ...since apparently 
it should set some Avalon context.  You don't happen to have that script at 
hand?

Robby

   



-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: Runnable in flowscript?

2010-03-19 Thread Fawzib Rojas

Output:

fmt= pdf2
output_stream = com.spectron.io.fileprogressoutputstr...@fc8361

I know that part works (i can access objects variables in thread) 
because I tested it with something like this:


var length=0;
var r = new java.lang.Runnable() {
run: function() {
while(true) length++;
}
};
new java.lang.Thread(r).start();
// Display the waiting page until complete:
while(!output_stream.isClosed()) {
  cocoon.sendPageAndWait("progress.jx",{ "length" : length });
}

And the progress page displayed the length variable, and it was 
increasing (the thread was working). The problem seems to be that inside 
the thread none of the cocoon-related objects can be used.


On 3/19/2010 2:53 PM, Robby Pelssers wrote:

You're in fact using a closure here so I'm not sure if that's causing issues. 
Can you add following debug statements?

var r = new java.lang.Runnable() {
 run: function() {
 //add following print statements
 print("fmt= " + fmt);
 print("output_stream = " + ouput_stream);
 // gives an exception here on the console
 cocoon.processPipelineTo(fmt+"_pipe/"+url,{}, output_stream);
 output_stream.close();
 }
};

   



-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: Runnable in flowscript?

2010-03-19 Thread Fawzib Rojas
I changed the '' to {} like u said, not needed because when I dont use 
the thread it works. Same with the pipelines, they work when I don't use 
the thread (use_background_thread=false). I think I just need to be able 
to set the environment (context?) inside the thread, check the 
exceptions I get in the first message: 
"org.apache.avalon.framework.context.ContextException: Unable to locate 
object-model (No environment available)"


Relevant sitemap sections (which work when not using the thread):














mime-type="application/pdf" />





On 3/19/2010 2:12 PM, Robby Pelssers wrote:

function create_pdf() {
  var use_background_thread=true;
  var path=cocoon.parameters["report"];
  var fmt=cocoon.parameters["format"];
  var queryInfo=getRequestParameters();
  var url=path+"?"+queryInfo;
  var output_file=java.io.File.createTempFile(path,".pdf");
  var output_stream=new 
com.spectron.io.FileProgressOutputStream(output_file);

  if(use_background_thread){
  var r = new java.lang.Runnable() {
  run: function() {
  // gives an exception here on the console
  cocoon.processPipelineTo(fmt+"_pipe/"+url,'',output_stream);  
//COMMENT: CAN I SEE relevant sitemap snippets and corresponding generator for this 
pipeline?? And still replace the '' by {} just to be sure
  output_stream.close();
  }
  };
  new java.lang.Thread(r).start();
  // this works, just never finishes because of exception in thread
  while(!output_stream.isClosed()) {
  cocoon.sendPageAndWait(
  "progress.jx",
   {
   "length" : output_file.length(),
   "output_path" : output_file.getCanonicalPath(), 
//COMMENT: REMOVE the COMMA
   }
  );
  }
  } else{
  cocoon.processPipelineTo(fmt+"_pipe/"+url,'',output_stream);  
//COMMENT: And still replace the '' by {} just to be sure
  output_stream.close();
  }
  cocoon.sendPage(
    fmt+"_pipe/"+url,
{
file_name : output_file.getCanonicalPath()
}
   );
}

-Original Message-
From: Fawzib Rojas [mailto:f_ro...@spectron-msim.com]
Sent: Friday, March 19, 2010 7:00 PM
To: users@cocoon.apache.org
Subject: Re: Runnable in flowscript?

On 3/19/2010 1:56 PM, Robby Pelssers wrote:
   

Function processPipelineTo([String] uri, [Object] bizData, 
[java.io.OutputStream] stream)

The api says is should be an object...

So maybe try

cocoon.processPipelineTo(fmt+"_pipe/"+url, {} ,output_stream); //using object 
literal


 

Thats not it, because when I set use_background_thread to false to do it
directly without a thread (the else) it works.

   

I don't know if you need a context but you sure aren't setting any...


 

I'm not setting a context in the thread, I guess I need to use the
context from the create_pdf function. How would I do that? Is there some
documentation for that somewhere?

   

Cheers,
Robby


 


-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org

   



-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: Runnable in flowscript?

2010-03-19 Thread Fawzib Rojas

On 3/19/2010 1:56 PM, Robby Pelssers wrote:

Function processPipelineTo([String] uri, [Object] bizData, 
[java.io.OutputStream] stream)

The api says is should be an object...

So maybe try

cocoon.processPipelineTo(fmt+"_pipe/"+url, {} ,output_stream); //using object 
literal

   


Thats not it, because when I set use_background_thread to false to do it 
directly without a thread (the else) it works.



I don't know if you need a context but you sure aren't setting any...

   


I'm not setting a context in the thread, I guess I need to use the 
context from the create_pdf function. How would I do that? Is there some 
documentation for that somewhere?



Cheers,
Robby

   



-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: Runnable in flowscript?

2010-03-19 Thread Fawzib Rojas

Yes those are all typos the exception I'm getting is not typo related. :)
I'll post the real code I'm using for debugging:

function create_pdf() {
var use_background_thread=true;
var path=cocoon.parameters["report"];
var fmt=cocoon.parameters["format"];
var queryInfo=getRequestParameters();
var url=path+"?"+queryInfo;
var output_file=java.io.File.createTempFile(path,".pdf");
var output_stream=new 
com.spectron.io.FileProgressOutputStream(output_file);

//
if(use_background_thread){
var r = new java.lang.Runnable() {
run: function() {
// gives an exception here on the console

cocoon.processPipelineTo(fmt+"_pipe/"+url,'',output_stream);

output_stream.close();
}
};
new java.lang.Thread(r).start();
// this works, just never finishes because of exception in thread
while(!output_stream.isClosed()) {
cocoon.sendPageAndWait("progress.jx",{ "length" : 
output_file.length(), "output_path" : output_file.getCanonicalPath(), });

}
}else{
cocoon.processPipelineTo(fmt+"_pipe/"+url,'',output_stream);
output_stream.close();
}
cocoon.sendPage( fmt+"_pipe/"+url, {file_name : 
output_file.getCanonicalPath() } );

}

On 3/19/2010 1:01 PM, Robby Pelssers wrote:

I actually see a bunch of typos (?)  Always indent your code properly dear 
friend so it's easy to track errors... I indented your code for this little 
exercise without making any modifications...
So check yourself if those are typos or not !!

Cheers,
Robby Pelssers
   



-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: Runnable in flowscript?

2010-03-19 Thread Fawzib Rojas

On 3/19/2010 11:40 AM, Florent André wrote:

Yi,

Perhaps it's just an in mail typo error, but your "pdf-create-pipeline"
spell in :

On Fri, 19 Mar 2010 10:40:51 -0400, Fawzib Rojas
  wrote:
   


cocoon.processPipelineTo("pdf-create-pipeline'',output_stream);
  output_stream.close();
  }
 };
 

begin with " and end with ''

   


Thats a mail typo error, thats not the real pipeline name, is an error I 
added when creating the message. :)




-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Runnable in flowscript?

2010-03-19 Thread Fawzib Rojas
I'm trying to create a pipeline in the background using a thread. My 
flowscript looks like this:


function create_pdf() {
var output_file=java.io.File.createTempFile("temp",".pdf");
var output_stream=new MyOutputStream(output_file);
//
var r = new java.lang.Runnable() {
run: function() {

cocoon.processPipelineTo("pdf-create-pipeline'',output_stream);

output_stream.close();
}
   };
   new java.lang.Thread(r).start();
   // Display the waiting page until file is closed
   while(!output_stream.isClosed()) {
   cocoon.sendPageAndWait("progress.jx",{ "length" :  
output_stream.length(), "output_path" : output_file.getCanonicalPath(), });

   }
   // send the page
   cocoon.sendPage( "pdf-send-pipeline", {file_name : 
output_file.getCanonicalPath() } );

  }
}

I know the thread is working, but it seems I'm missing something cocoon 
related that I must initialize in the thread. I get the following exception:


Exception in thread "Thread-19" org.mozilla.javascript.WrappedException: 
Wrapped org.apache.avalon.framework.CascadingRuntimeException: Unable to 
get the object model from the context. 
(file:/C:/cocoon/msim_app/msim/flow/print_pdf.js#28)
at 
org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1693)

at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:160)
at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:471)
at 
org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3085)

at script(file:/C:/cocoon/msim_app/msim/flow/print_pdf.js:28)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2251)
at 
org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:161)
at 
org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:340)
at 
org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2758)
at 
org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:159)

at org.mozilla.javascript.Context.call(Context.java:499)
at org.mozilla.javascript.JavaAdapter.callMethod(JavaAdapter.java:492)
at adapter1.run()
at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.avalon.framework.CascadingRuntimeException: Unable 
to get the object model from the context.
at 
org.apache.cocoon.components.ContextHelper.getObjectModel(ContextHelper.java:92)
at 
org.apache.cocoon.components.flow.javascript.fom.FOM_JavaScriptInterpreter.setupView(FOM_JavaScriptInterpreter.java:877)
at 
org.apache.cocoon.components.flow.javascript.fom.FOM_JavaScriptInterpreter.process(FOM_JavaScriptInterpreter.java:872)
at 
org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon.jsFunction_processPipelineTo(FOM_Cocoon.java:286)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:145)
... 11 more
Caused by: org.apache.avalon.framework.context.ContextException: Unable 
to locate object-model (No environment available)
at 
org.apache.cocoon.components.ComponentContext.get(ComponentContext.java:96)
at 
org.apache.cocoon.components.ContextHelper.getObjectModel(ContextHelper.java:90)

... 19 more




-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: Cocoon 2.2 install

2007-12-20 Thread Fawzib Rojas



David Legg wrote:

Hi Fawzib,

The main overview of Cocoon 2.2 can be found on the apache web site. [1]

Read it, didn't saw anywhere how to install it.
You should also take a close look at the section titled 'Your first 
Cocoon application using Maven 2' [2]
I did, I was looking for a sample using eclipse and the maven plugin. I 
guess I have to install the console version of maven, right?
Cocoon 2.2 is radically different but I definitely think it's worth 
it.  The fact it uses Maven and Spring and makes a decent attempt to 
modularize are reasons enough for me to update.
I don't mind it being different, the problem is no documentation on how 
to do things (or if there is, I can't find it) and I can't even figure 
out how to install it.
Keep in mind that you no longer get a bucket-load of examples ready to 
run once you have built it and the documentation is still very 
fragmentary at this stage.  I wonder why the version number went from 
2.1 to 2.2 when things have changed so much?
Well a wiki on how to get a basic cocoon 2.2 environment working in 
eclipse would be useful. I have an application working in cocoon 2.1 
(some ServletGenerators, StreamGenerators, Actions,...) and want to see 
how to start moving things to the new version.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Cocoon 2.2 install

2007-12-19 Thread Fawzib Rojas
Is there a simple howto to install/run Cocoon 2.2? I have been looking 
around and I haven't found anything that explains how to do it. I 
haven't found any download links at the cocoon site.


With 2.1 was just download, extract, run the startup script. I have no 
idea how to begin, or were to find 2.2


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Problem with custom StreamGenerator

2006-10-03 Thread Fawzib Rojas
I have a custom StreamGenerator and it is giving me some problems. I 
have used it with a custom application I've made and it works. I send a 
POST with my information and I can use the posted info in my custom 
generator. My problem is that when I use an actual FORM with a post 
message it fails.


This is the HTTP message from my app:

POST /servers HTTP/1.0
Connection: keep-alive
Content-Type: text/xml
Content-Length: 99
Host: 192.168.10.125
Accept: text/html, */*
Accept-Encoding: identity
User-Agent: Mozilla/3.0 (compatible; Indy Library)



This is what Firefox sends when I submit the form:

POST /msim/SamplePackage.pdf HTTP/1.1
Host: www.spectron-msim.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) 
Gecko/20060909 Firefox/1.5.0.7
Accept: 
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5

Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: 
Authorization: 
Content-Type: application/x-www-form-urlencoded
Content-Length: 57




I think that since the 'Content Type' is 
'application/x-www-form-urlencoded' Cocoon is trying to process it 
before my generator deals with it. I tried adding ENCTYPE='text/xml' to 
my form but it seems Firefox and IE ignore it because I always get 
'application/x-www-form-urlencoded'. Can anyone give me a hand?


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Question about serializers

2005-12-19 Thread Fawzib Rojas

Can anyone help me to make this work?

Fawzib Rojas wrote:


Mark Lundquist wrote:



On Dec 15, 2005, at 7:45 AM, Fawzib Rojas wrote:

Is there a way to create a thread in flowscript and have the 
"cocoon.processPipeline" run in it?




Yes, definitely...

Well I tried it but it isnt working, If I set use_thread=false it 
works, if I set use_thread=true. I know the pdf_runnable object is 
working because pdf_runnable.process() works, but when I call it from 
the thread it fails. I get some errors in the console and logs, they 
are after the script. Can anyone give a hand with this, I'm very close...


function main() {
   var use_thread=true;
   // get path
   var 
path=cocoon.parameters["report"]+".pdf_pipe?"+getRequestParameters();

   // create runnable
   var pdf_runnable=new java.lang.Runnable(
   {"complete": false,
   "count": 0,
   "url":path,
   "error":"no error",
   "cocoon": cocoon,
   "out_stream":new java.io.ByteArrayOutputStream(),
   "run": function(){
   this.process();
   this.complete=true;
   },
   "process": function(){
   
this.cocoon.processPipelineTo(this.url,'',this.out_stream);

   }
   }
 );
   //
   if(use_thread){
   var pdf_thread=new java.lang.Thread(pdf_runnable);
   pdf_thread.start();
   // wait until thread is done
   pdf_runnable.count=0;
   while(pdf_runnable.complete==false) {
   cocoon.sendPageAndWait("progress.jx", { "stream_size" : 
pdf_runnable.out_stream.size(),"count":pdf_runnable.count } );

   pdf_runnable.count++;
   }
   }else{
   pdf_runnable.process();
   }
   //
   cocoon.sendPage(
   "pdf-display/"+path,
   {byteArray : new 
java.io.ByteArrayInputStream(pdf_runnable.out_stream.toByteArray())}

   );
}

Console error:

java.lang.NullPointerException
   at 
org.apache.cocoon.environment.AbstractEnvironment.release(AbstractEnvironment.java:539) 

   at 
org.apache.cocoon.environment.wrapper.MutableEnvironmentFacade.release(MutableEnvironmentFacade.java:320) 

   at 
org.apache.cocoon.transformation.TraxTransformer.recycle(TraxTransformer.java:514) 

   at 
org.apache.avalon.excalibur.pool.ResourceLimitingPool.put(ResourceLimitingPool.java:438) 

   at 
org.apache.avalon.excalibur.component.PoolableComponentHandler.doPut(PoolableComponentHandler.java:212) 

   at 
org.apache.avalon.excalibur.component.ComponentHandler.put(ComponentHandler.java:425) 

   at 
org.apache.avalon.excalibur.component.ExcaliburComponentSelector.release(ExcaliburComponentSelector.java:305) 

   at 
org.apache.cocoon.components.ExtendedComponentSelector.release(ExtendedComponentSelector.java:284) 

   at 
org.apache.cocoon.components.ExtendedComponentSelector.release(ExtendedComponentSelector.java:281) 

   at 
org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.recycle(AbstractProcessingPipeline.java:650) 

   at 
org.apache.cocoon.components.pipeline.impl.BaseCachingProcessingPipeline.recycle(BaseCachingProcessingPipeline.java:77) 

   at 
org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline.recycle(AbstractCachingProcessingPipeline.java:948) 

   at 
org.apache.avalon.excalibur.pool.ResourceLimitingPool.put(ResourceLimitingPool.java:438) 

   at 
org.apache.avalon.excalibur.component.PoolableComponentHandler.doPut(PoolableComponentHandler.java:212) 

   at 
org.apache.avalon.excalibur.component.ComponentHandler.put(ComponentHandler.java:425) 

   at 
org.apache.avalon.excalibur.component.ExcaliburComponentSelector.release(ExcaliburComponentSelector.java:305) 

   at 
org.apache.cocoon.components.ExtendedComponentSelector.release(ExtendedComponentSelector.java:284) 

   at 
org.apache.cocoon.components.EnvironmentDescription.release(CocoonComponentManager.java:599) 

   at 
org.apache.cocoon.components.CocoonComponentManager.endProcessing(CocoonComponentManager.java:204) 


   at org.apache.cocoon.Cocoon.process(Cocoon.java:683)
   at 
org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1098)

   at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
   at 
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:354)
   at 
org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:294) 

   at 
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567)

   at org.mortbay.http.HttpContext.handle(HttpContext.java:1808)
   at 
org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:525) 


   at org.mortbay.http.HttpContext.handle(HttpContext.java:1758)
   at org.mortbay.http.HttpServer.service(HttpServer.java:879)
   at org.mortbay.http.HttpConnection.service

Re: Question about serializers

2005-12-16 Thread Fawzib Rojas

Mark Lundquist wrote:



On Dec 15, 2005, at 7:45 AM, Fawzib Rojas wrote:

Is there a way to create a thread in flowscript and have the 
"cocoon.processPipeline" run in it?



Yes, definitely...

Well I tried it but it isnt working, If I set use_thread=false it works, 
if I set use_thread=true. I know the pdf_runnable object is working 
because pdf_runnable.process() works, but when I call it from the thread 
it fails. I get some errors in the console and logs, they are after the 
script. Can anyone give a hand with this, I'm very close...


function main() {
   var use_thread=true;
   // get path
   var 
path=cocoon.parameters["report"]+".pdf_pipe?"+getRequestParameters();

   // create runnable
   var pdf_runnable=new java.lang.Runnable(
   { 
   "complete": false,

   "count": 0,
   "url":path,
   "error":"no error",
   "cocoon": cocoon,
   "out_stream":new java.io.ByteArrayOutputStream(),
   "run": function(){
   this.process();
   this.complete=true;
   },
   "process": function(){
   this.cocoon.processPipelineTo(this.url,'',this.out_stream);
   }
   }
 );
   //
   if(use_thread){
   var pdf_thread=new java.lang.Thread(pdf_runnable);
   pdf_thread.start();
   // wait until thread is done
   pdf_runnable.count=0;
   while(pdf_runnable.complete==false) {
   cocoon.sendPageAndWait("progress.jx", { "stream_size" : 
pdf_runnable.out_stream.size(),"count":pdf_runnable.count } );

   pdf_runnable.count++;
   }
   }else{
   pdf_runnable.process();
   }
   //
   cocoon.sendPage(
   "pdf-display/"+path,
   {byteArray : new 
java.io.ByteArrayInputStream(pdf_runnable.out_stream.toByteArray())}

   );
}

Console error:

java.lang.NullPointerException
   at 
org.apache.cocoon.environment.AbstractEnvironment.release(AbstractEnvironment.java:539)
   at 
org.apache.cocoon.environment.wrapper.MutableEnvironmentFacade.release(MutableEnvironmentFacade.java:320)
   at 
org.apache.cocoon.transformation.TraxTransformer.recycle(TraxTransformer.java:514)
   at 
org.apache.avalon.excalibur.pool.ResourceLimitingPool.put(ResourceLimitingPool.java:438)
   at 
org.apache.avalon.excalibur.component.PoolableComponentHandler.doPut(PoolableComponentHandler.java:212)
   at 
org.apache.avalon.excalibur.component.ComponentHandler.put(ComponentHandler.java:425)
   at 
org.apache.avalon.excalibur.component.ExcaliburComponentSelector.release(ExcaliburComponentSelector.java:305)
   at 
org.apache.cocoon.components.ExtendedComponentSelector.release(ExtendedComponentSelector.java:284)
   at 
org.apache.cocoon.components.ExtendedComponentSelector.release(ExtendedComponentSelector.java:281)
   at 
org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.recycle(AbstractProcessingPipeline.java:650)
   at 
org.apache.cocoon.components.pipeline.impl.BaseCachingProcessingPipeline.recycle(BaseCachingProcessingPipeline.java:77)
   at 
org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline.recycle(AbstractCachingProcessingPipeline.java:948)
   at 
org.apache.avalon.excalibur.pool.ResourceLimitingPool.put(ResourceLimitingPool.java:438)
   at 
org.apache.avalon.excalibur.component.PoolableComponentHandler.doPut(PoolableComponentHandler.java:212)
   at 
org.apache.avalon.excalibur.component.ComponentHandler.put(ComponentHandler.java:425)
   at 
org.apache.avalon.excalibur.component.ExcaliburComponentSelector.release(ExcaliburComponentSelector.java:305)
   at 
org.apache.cocoon.components.ExtendedComponentSelector.release(ExtendedComponentSelector.java:284)
   at 
org.apache.cocoon.components.EnvironmentDescription.release(CocoonComponentManager.java:599)
   at 
org.apache.cocoon.components.CocoonComponentManager.endProcessing(CocoonComponentManager.java:204)

   at org.apache.cocoon.Cocoon.process(Cocoon.java:683)
   at 
org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1098)

   at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
   at 
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:354)
   at 
org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:294)
   at 
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567)

   at org.mortbay.http.HttpContext.handle(HttpContext.java:1808)
   at 
org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:525)

   at org.mortbay.http.HttpContext.handle(HttpContext.java:1758)
   at org.mortbay.http.HttpServer.service(HttpServer.java:879)
   at org.mortbay.http.HttpConnection.service(HttpConnection.java:790)
   at org.mortbay.http.HttpConnection.handleNext(HttpCon

Re: Question about serializers

2005-12-15 Thread Fawzib Rojas

Jason Johnston wrote:

Seems to me you could accomplish this fairly easily with Flowscript. 
Something like:  




I have never used flowscript but I have to say is very cool, but 
unfortunately is not doing what I expect. The script looks like this:


function main() {
   var count = 0;
   var path=cocoon.parameters["report"];
   var param=getRequestParameters();
   var bytes=0;
   var outputStream = new com.spectron.cocoon.SpectronOutputStream();
   //
   cocoon.processPipelineTo(path+'.pdf_pipe?'+param,'',outputStream);
   for(
   bytes=outputStream.size();
   !outputStream.isClosed();
   count++,bytes=outputStream.size()
   ) {
   cocoon.sendPageAndWait("progress.jx", {"stream_size" : 
bytes,"count":count } );

   }
   // PDF is finished, now display it:
   cocoon.sendPage(
   "pdf-display/"+path+'?'+getRequestParameters(),
   {byteArray : new 
java.io.ByteArrayInputStream(outputStream.toByteArray())}

   );
}

It seems that when I do the "cocoon.sendPageAndWait" the 
"cocoon.processPipeline" is aborted because the outputStream.size() 
remains constant. If I remove the for loop it creates the PDF correctly. 
Is there a way to create a thread in flowscript and have the 
"cocoon.processPipeline" run in it?


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Question about serializers

2005-12-13 Thread Fawzib Rojas
I asked a few days ago about creating a PDF on a background thread 
(Subject:Create PDF on background) but didn't got an answer I could use. 
Our users requests the PDF and it cannot be batched. Sometimes it takes 
a few minutes to be created. What I want to do is something like this:



 
 
 
   
   
   type="fo2pdf"/>
   
   value="cocoon:/progress_pipeline" type="html"/>

 


Is something like this possible? Maybe a custom serializer? Is there 
another way to do this?



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Create PDF on background

2005-12-09 Thread Fawzib Rojas
I have a PDF that takes some time to be created and I want to show some 
kind of progress. Maybe using page redirection and somehow when its done 
redirect to the completed PDF. The problem is I have no idea where to 
start. Anyone has any samples or idea on how to do this?


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]