grails wsclient "file not found" consuming a .net web service - grails
first of all, I want to apologize if my question is stupid, but I'm really new in consuming .net web service in grails.
There's a SOAP WS (wich I can't manipulate in any way) that I consume whis way:
def wsdlURL = "_HttpUrl_'/AspNetOracleProviderService.asmx?WSDL"
def proxy = webService.getClient(wsdlURL) <= This is the line where my project fails
Now, I've tested this service in a asp.Net Project with no troubles, but in Grails it generates me this error:
Error 500: Executing action [create] of controller [pruebaplugins.PruebaWsClientController] caused exception: Unable to create JAXBContext for generated packages: "com.something.anothersomething" doesnt contain ObjectFactory.class or jaxb.index
I have defined the JAVA_HOME and javac Is there, I can acces to it in any location in a command prompt.
At the end of this post I'll put de detailed info.
I've only tested this service and the well-known Celsius-Farenheit example, wich works with no problems, I think it's because it only returns a String, unlike mine or any other services.
I don't know if its a lack of something, surely could be something I ignore.
Like I said, I'm very new in this kind of stuff and I'd appreciate any kind of help.
Thanks anyway.
Detailed info:
When I put
debug 'org.apache.cxf'
in log4j in Config.groovy
the output throw me this:
2012-01-25 16:08:13,514 [http-8080-2] INFO spring.BusApplicationContext - Refreshing org.apache.cxf.bus.spring.BusApplicationContext#5c3e99: startup date [Wed Jan 25 16:08:13 CLST 2012]; root of context hierarchy
2012-01-25 16:08:13,639 [http-8080-2] INFO spring.BusApplicationContext
- No cxf.xml configuration file detected, relying on defaults.
2012-01-25 16:08:13,820 [http-8080-2] DEBUG spring.ControlledValidationXmlBeanDefinitionReader
- Loaded 0 bean definitions from location pattern [classpath:META-INF/cxf/cxf-extension-http.xml]
2012-01-25 16:08:13,848 [http-8080-2] DEBUG spring.BusApplicationContext
- Bean factory for org.apache.cxf.bus.spring.BusApplicationContext#5c3e99: org.springframework.beans.factory.support.DefaultListableBeanFactory#e3e8f3: defining beans [cxf,org.apache.cxf.bus.spring.BusApplicationListener,org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,org.apache.cxf.resource.ResourceManager,org.apache.cxf.configuration.Configurer,org.apache.cxf.binding.BindingFactoryManager,org.apache.cxf.transport.DestinationFactoryManager,org.apache.cxf.transport.ConduitInitiatorManager,org.apache.cxf.wsdl.WSDLManager,org.apache.cxf.phase.PhaseManager,org.apache.cxf.workqueue.WorkQueueManager,org.apache.cxf.buslifecycle.BusLifeCycleManager,org.apache.cxf.endpoint.ServerRegistry,org.apache.cxf.endpoint.ServerLifeCycleManager,org.apache.cxf.endpoint.ClientLifeCycleManager,org.apache.cxf.transports.http.QueryHandlerRegistry,org.apache.cxf.endpoint.EndpointResolverRegistry,org.apache.cxf.headers.HeaderManager,org.apache.cxf.catalog.OASISCatalogManager,org.apache.cxf.endpoint.ServiceContractResolverRegistry,org.apache.cxf.binding.corba.CorbaBindingFactory,org.apache.cxf.binding.corba.wsdl.WSDLExtensionRegister#0,org.apache.cxf.jaxws.context.WebServiceContextResourceResolver,org.apache.cxf.jaxws.context.WebServiceContextImpl,org.apache.cxf.binding.soap.SoapBindingFactory,org.apache.cxf.binding.soap.SoapTransportFactory,org.apache.cxf.binding.soap.customEditorConfigurer,org.apache.cxf.binding.xml.XMLBindingFactory,org.apache.cxf.ws.addressing.policy.AddressingAssertionBuilder,org.apache.cxf.ws.addressing.policy.AddressingPolicyInterceptorProvider,org.apache.cxf.ws.addressing.policy.UsingAddressingAssertionBuilder,org.apache.cxf.javascript.JavascriptQueryHandlerRegistry,org.apache.cxf.transport.local.LocalTransportFactory,org.apache.cxf.transport.http.policy.HTTPClientAssertionBuilder,org.apache.cxf.transport.http.policy.HTTPServerAssertionBuilder,org.apache.cxf.transport.http.policy.NoOpPolicyInterceptorProvider,org.apache.cxf.transport.http.ClientOnlyHTTPTransportFactory,org.apache.cxf.management.InstrumentationManager,org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory,org.apache.cxf.transport.jms.JMSTransportFactory,org.apache.cxf.binding.object.ObjectBindingFactory,org.apache.cxf.binding.http.HttpBindingFactory,org.apache.cxf.jaxrs.JAXRSBindingFactory,org.apache.cxf.ws.security.policy.WSSecurityPolicyLoader,org.apache.cxf.ws.policy.AssertionBuilderRegistry,org.apache.cxf.ws.policy.PolicyInterceptorProviderRegistry,org.apache.cxf.ws.policy.attachment.external.DomainExpressionBuilderRegistry,org.apache.cxf.ws.policy.attachment.external.EndpointReferenceDomainExpressionBuilder,org.apache.cxf.ws.policy.PolicyBuilder,org.apache.cxf.ws.policy.PolicyEngine,org.apache.cxf.ws.policy.attachment.wsdl11.Wsdl11AttachmentPolicyProvider,org.apache.cxf.ws.policy.attachment.ServiceModelPolicyProvider,org.apache.cxf.ws.policy.mtom.MTOMAssertionBuilder,org.apache.cxf.ws.policy.mtom.MTOMPolicyInterceptorProvider,org.apache.cxf.ws.rm.RMManager,org.apache.cxf.ws.rm.policy.RMPolicyInterceptorProvider,org.apache.cxf.ws.rm.RMAssertionBuilder]; root of factory hierarchy
2012-01-25 16:08:14,009 [http-8080-2] DEBUG spring.BusApplicationContext
- Unable to locate MessageSource with name 'messageSource': using default [org.springframework.context.support.DelegatingMessageSource#cb229]
2012-01-25 16:08:14,009 [http-8080-2] DEBUG spring.BusApplicationContext
- Unable to locate ApplicationEventMulticaster with name 'applicationEventMulticaster': using default [org.springframework.context.event.SimpleApplicationEventMulticaster#184b649]
2012-01-25 16:08:16,095 [http-8080-2] DEBUG spring.BusApplicationContext
- Unable to locate LifecycleProcessor with name 'lifecycleProcessor': using default [org.springframework.context.support.DefaultLifecycleProcessor#1e10f02]
2012-01-25 16:08:18,925 [http-8080-2] INFO dynamic.DynamicClientFactory
- Created classes: com.something.anothersmth.Aplicacion, com.something.anothersmth.ArrayOfControl, com.something.anothersmth.ArrayOfModulo, com.something.anothersmth.ArrayOfPagina, com.something.anothersmth.ArrayOfRol, etc (...all the classes)
javac: file not found: C:\Users\DYT01\AppData\Local\Temp\org.apache.cxf.endpoint.dynamic.DynamicClientFactory#8a3c71-1327518498999-src\com\something\anothersmth\CambiarContraseña.java
Usage: javac
use -help for a list of possible options
2012-01-25 16:08:20,637 [http-8080-2] ERROR dynamic.DynamicClientFactory - Could not compile java files for ...HttpUrl/AspNetOracleProviderService.asmx?WSDL.
Related
Grails 3 schemaExport contains warning with FileNotFoundException that looks for sitemesh.xml
When schemaExport is executed using Gradle for a Grails 3.3 application, below warning is in the log though ddl.sql is created. According to Grails 3 documentation sitemesh.xml is removed so naturally the file wouldn't be available. Am I missing something? Tools and version: Grails 3.3.0, Gradle 3.3, Hibnerate 5, Sybase ASE 15.7 2017-09-13 12:50:45.264 WARN --- [ main] o.s.mock.web.MockServletContext : Couldn't determine real path of resource class path resource [src/main/webapp/WEB-INF/sitemesh.xml] java.io.FileNotFoundException: class path resource [src/main/webapp/WEB-INF/sitemesh.xml] cannot be resolved to URL because it does not exist at org.springframework.core.io.ClassPathResource.getURL(ClassPathResource.java:187) at org.springframework.core.io.AbstractFileResolvingResource.getFile(AbstractFileResolvingResource.java:49) at org.springframework.mock.web.MockServletContext.getRealPath(MockServletContext.java:458) at org.grails.web.sitemesh.Grails5535Factory.<init>(Grails5535Factory.java:78) at org.grails.web.servlet.view.SitemeshLayoutViewResolver.loadSitemeshConfig(SitemeshLayoutViewResolver.java:105) at org.grails.web.servlet.view.SitemeshLayoutViewResolver.init(SitemeshLayoutViewResolver.java:67) at org.grails.web.servlet.view.SitemeshLayoutViewResolver.onApplicationEvent(SitemeshLayoutViewResolver.java:146) at org.grails.web.servlet.view.SitemeshLayoutViewResolver.onApplicationEvent(SitemeshLayoutViewResolver.java:42) at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:393) at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:347) at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:883) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360) at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) at grails.boot.GrailsApp.run(GrailsApp.groovy:83) at grails.ui.command.GrailsApplicationContextCommandRunner.run(GrailsApplicationContextCommandRunner.groovy:55) at grails.ui.command.GrailsApplicationContextCommandRunner.main(GrailsApplicationContextCommandRunner.groovy:102)
This is just a WARN message. The underlying spring class is looking for it and just saying it's not there. The default the log level does not show this output. You can safely ignore the message or adjust your logger to not show it. https://github.com/spring-projects/spring-framework/blob/master/spring-test/src/main/java/org/springframework/mock/web/MockServletContext.java#L460
Need help resolving error message
Just tried to deploy a .war file and received this error message. This came quite the surprise to me because I just deployed a .war file the day before and worked fine with minimal changes between the two (changed a value of a variable that tracks days until a cron job executes). I do leave out the auto generated .iml files that IntelliJ creates, could that do it? '2014-01-24 08:47:45,480 [Thread-10] WARN config.ConfigurationFactory - No configuration found. Configuring ehcac he from ehcache-failsafe.xml found in the classpath: jar:file:/var/opt/tomcat/webapps/PerformanceEvaluations-moved /WEB-INF/lib/ehcache-core-2.4.6.jar!/ehcache-failsafe.xml ''2014-01-24 08:47:46,117 [Thread-10] WARN hibernate.AbstractEhcacheRegionFactory - Couldn't find a specific ehca che configuration for cache named [edu.wisc.radiology.performanceevaluations.Role]; using defaults. ' ==> PerformanceEvaluations_main.log <== '2014-01-24 08:47:45,480 [Thread-10] WARN config.ConfigurationFactory - No configuration found. Configuring ehcac he from ehcache-failsafe.xml found in the classpath: jar:file:/var/opt/tomcat/webapps/PerformanceEvaluations-moved /WEB-INF/lib/ehcache-core-2.4.6.jar!/ehcache-failsafe.xml ''2014-01-24 08:47:46,117 [Thread-10] WARN hibernate.AbstractEhcacheRegionFactory - Couldn't find a specific ehca che configuration for cache named [edu.wisc.radiology.performanceevaluations.Role]; using defaults. ' ==> catalina.out <== '2014-01-24 08:47:49,046 [Thread-10] WARN servlet.DefaultGrailsApplicationAttributes - ApplicationContext not fou nd in org.codehaus.groovy.grails.APPLICATION_CONTEXT attribute of servlet context. ' ==> PerformanceEvaluations_main.log <== '2014-01-24 08:47:49,046 [Thread-10] WARN servlet.DefaultGrailsApplicationAttributes - ApplicationContext not fou nd in org.codehaus.groovy.grails.APPLICATION_CONTEXT attribute of servlet context. ' ==> catalina.out <== '2014-01-24 08:47:50,112 [Thread-10] WARN module.ModuleDeclarationsFactory - 'grails.resources.modules' in config does not define any modules '==> PerformanceEvaluations_main.log <== '2014-01-24 08:47:50,112 [Thread-10] WARN module.ModuleDeclarationsFactory - 'grails.resources.modules' in config does not define any modules ' ==> catalina.out <== Parsing DB Changelog
I don't see any error messages, only warnings. And all are harmless. For example the one about Ehcache is standard. If you don't provide a custom ehcache.xml, it defaults to one in the jar file and prints some messages to that effect. You can create your own - typically a modified version of the default file - and put it in the root of the classpath (non-Groovy files in grails-app/conf and src/java get copied to the classpath, so it's a good location) and it will be used instead. This is a good idea to do early on, even if you just keep the default values in your file, to make it easier to configure later. And the defaults are rather conservative, e.g. the TTL defaults to only 2 minutes.
ActiveMQ as a service start errors
I installed ActiveMQ as a service on a Windows 2008 64bit server using commons-deamon. When I try to start the service I get this error: ACTIVEMQ_HOME: C:\apache-activemq-5.7.0 ACTIVEMQ_BASE: C:\apache-activemq-5.7.0 ACTIVEMQ_CONF: C:\apache-activemq-5.7.0\conf ACTIVEMQ_DATA: C:\apache-activemq-5.7.0\data Loading message broker from: xbean:activemq.xml INFO | Refreshing org.apache.activemq.xbean.XBeanBrokerFactory$1#17494c8: startup date [Wed Jan 09 16:45:52 IST 2013]; root of context hierarchy ERROR | Failed to load: class path resource [activemq.xml], reason: Could not load properties; nested exception is java.io.FileNotFoundException: ${activemq.conf}\credentials.properties (The system cannot find the path specified) org.springframework.beans.factory.BeanInitializationException: Could not load properties; nested exception is java.io.FileNotFoundException: ${activemq.conf} \credentials.properties (The system cannot find the path specified) It's like it can't find the file ACTIVEMQ_HOME\conf\credentials.properties but the file does exist in my folder. Do I need to manually define environment variables or something of that sort? Thanks!
There are some files that are missing in the v5.7.0 archive. You can simply copy them over from the older versions. See: Jira issue for this problem
Grails 2.0 Externalized Config in Production, cannot access application - HTTP 404
when I've upgraded my Grails app to Grails 2.0.3, the application isn't accessible in production Tomcat. When I run the app in development or even using "grails prod run-war", the application works properly. But when I move this app to Tomcat (tested on Tomcat 6 and 7), the app is not accessible anymore. It loads properly but when I go to http://localhost:8080/appName I receive HTTP 404. The logs are empty, therefore I cannot find out where is the problem. When I remove externalized config loading from Config.groovy, the application works! Really weird. Config.groovy: grails.config.locations = ["file:/home/user/application_homes/app_home/app-config.properties"] Did you faced same issue? Or were there any changes from Grails 1.3.7 to Grails 2.0.3 which could affect this? Thanks for any advice!
i'm having the exact same issue as you it would appear... I get nothing in the logs... It just doesn't start up... fails with: 0/04/2012 2:17:36 PM org.apache.catalina.core.StandardContext start SEVERE: Error listenerStart 20/04/2012 2:17:36 PM org.apache.catalina.core.StandardContext start SEVERE: Context [/abcd] startup failed due to previous errors Seems to work when we use a classpath spring format in the grails.config.locations section. we have also just gone to grails 2.0.3, could it be a bug?
Also experiencing the same problems. We actually have two methods for specifying the grails.configuration.locations, using System/Env Variables or a -Dconfig.file= definition. Using the environment variable load, this causes a line of classpath:the-config-file.properties If a -Dconfig.file is specified, it uses the file based evaluator: file:/full-path/the-config.file.properties When using the System/Env method, the configuration loads fine! As soon as we shift to using the 'file' lookup, Tomcat fails to start. It looks to be failing just after creating the internalConfigurationAnnotationProcessor bean: 2012-04-22 22:35:53,514 (main) DEBUG [org.codehaus.groovy.grails.commons.spring.GrailsWebApplicationContext] - <Bean factory for org.codehaus.groovy.grails.commons.spring.GrailsWebApplicationContext#17bcd4: org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory#752144: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,....<--- (left out the big list of others) 2012-04-22 22:35:53,538 (main) DEBUG [org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory] - <Creating shared instance of singleton bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor'> 2012-04-22 22:35:53,538 (main) DEBUG [org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory] - <Creating instance of bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor'> 2012-04-22 22:35:53,547 (main) DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - <Returning cached instance of singleton bean 'grailsApplication'> 2012-04-22 22:35:53,547 (main) DEBUG [org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory] - <Eagerly caching bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor' to allow for resolving potential circular references> 2012-04-22 22:35:53,548 (main) DEBUG [org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory] - <Finished creating instance of bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor'> 2012-04-22 22:35:53,667 (main) INFO [org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory] - <Destroying singletons in org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory#752144 22/04/2012 10:35:53 PM org.apache.catalina.core.StandardContext start SEVERE: Error listenerStart The oddest part is just changing from a classpath:<> definition to a file:<> is causing this problem. I have put in debug statements into the grails Config.groovy file and the contents of the files are read ok.
Flume agentSink "Unable to load output format plugin class"
I'm getting the following error and I have no idea why. If I change the sink to "console", it works fine. I'm just trying to recreate an example from the flume documentation except across two different nodes. This is using CDH3. 2011-10-20 17:41:13,046 [main] WARN text.FormatFactory: Unable to load output format plugin class - Class not found 2011-10-20 17:41:13,065 [main] INFO agent.FlumeNode: Loading spec from command line: 'foo:console|agentSink("somehost",35853);' 2011-10-20 17:41:13,228 [main] WARN agent.FlumeNode: Caught exception loading node:null I'm trying to run flume as such: flume node_nowatch -1 -s -n foo -c 'foo:console|agentSink("somehost",35853);' Thanks in advance.