Closed krishnareddyML closed 5 years ago
How exactly are you configuring the location of the app in your bean definition file?
In src/main/resources/gate-beans.xml file gate app path mentioned as follows.
Please find following screen shot about project structure in Eclipse
I'm guessing the difference between the two setups is the way in which eclipse builds the classpath. If you look at the javadoc for the bean the example includes WEB-INF
as part of the location path. So try updating your bean definition to
<gate:duplicate id="myApp">
<gate:saved-application location="WEB-INF/gate-files/application.xgapp" />
</gate:duplicate>
and see if that works correctly in both cases
it is not working in both eclipse and external tomcat with above change.
And I also tested hands-on Spring boot application given under GATE site (https://gate.ac.uk/sale/talks/gate-course-jun18/module-8-developers/3-advanced-embedded/3-advanced-embedded-hands-on.zip). It is also working in Eclipse environment but failed to work in external Tomcat.
I attached herewith hands-on Spring boot app downloaded from above site, and included required GATE files (sample ANNIE application exported from GATE Dev) under resources folder for your reference. Kindly check is it possible to recreate issue at your end. webapps.zip
Thank you.
Hmm, we think the solution to get it to work in both Eclipse and tomcat is to abandon relative URLs and use a classpath:
URL instead. So the snippet should probably read
<gate:duplicate id="myApp">
<gate:saved-application location="classpath:gate-files/application.xgapp" />
</gate:duplicate>
yes, classpath prefix fixed the issue.
Thank you for quick fix.
I am using gatelib-spring in spring boot app to work in multithread environment. while deploying spring boot war to external tomcat getting following error. The Gate application (application.xgapp) is stored in /apache-tomcat-9.0.12/webapps/kcvparser/WEB-INF/classes/gate-files/application.xgapp, but container searching directly under project folder.
Tomcat Error Log: Bean creation exception on non-lazy FactoryBean type check: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myApp': Cannot create inner bean 'gate:saved-application#1d5a4df3' of type [gate.util.spring.SavedApplicationFactoryBean] while setting bean property 'template'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gate:saved-application#1d5a4df3': FactoryBean threw exception on object creation; nested exception is java.io.FileNotFoundException: /home/kpmd/apache-tomcat-9.0.12/webapps/kcvparser/gate-files/application.xgapp