You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by asookazian2 <as...@gmail.com> on 2014/04/25 23:24:17 UTC

Does not exist in file system

We have the following Spring bean config:

<bean id="sqlSessionFactory"
class="org.mybatis.spring.SqlSessionFactoryBean">
		<property name="dataSource" ref="dataSource" />

                <property name="mapperLocations">
                     <list>
                         
<value>classpath*:com/nextgate/mm/mappers/*.xml</value> 
                         
<value>classpath*:org/activiti/db/mapping/entity/*.xml</value>        
                     </list>
                </property>
		<property name="configLocation"
value="classpath:com/nextgate/mm/config/mybatis-config.xml" />
	</bean>

Getting following exceptions on activation of WAB.

2014-04-25 13:59:41,644 | WARN  | Local user karaf |
hMatchingResourcePatternResolver | 258 - workflow-ws-server - 1.0.0.SNAPSHOT
| Cannot search for matching files underneath URL
[bundle://258.3:33/com/nextgate/mm/mappers/] because it does not correspond
to a directory in the file system
java.io.FileNotFoundException: URL
[bundle://258.3:33/com/nextgate/mm/mappers/] cannot be resolved to absolute
file path because it does not reside in the file system:
bundle://258.3:33/com/nextgate/mm/mappers/

2014-04-25 13:59:41,658 | WARN  | Local user karaf |
hMatchingResourcePatternResolver | 258 - workflow-ws-server - 1.0.0.SNAPSHOT
| Cannot search for matching files underneath URL
[bundle://258.3:4/org/activiti/db/mapping/entity/] because it does not
correspond to a directory in the file system
java.io.FileNotFoundException: URL
[bundle://258.3:4/org/activiti/db/mapping/entity/] cannot be resolved to
absolute file path because it does not reside in the file system:
bundle://258.3:4/org/activiti/db/mapping/entity/

WAB has foo.jar and bar.jar in WEB-INF/lib which contains the above
packages/paths.  How to fix?



--
View this message in context: http://karaf.922171.n3.nabble.com/Does-not-exist-in-file-system-tp4032974.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Does not exist in file system

Posted by asookazian2 <as...@gmail.com>.
I have tried to simplify the trouble-shooting of this problem by cloning the
Eclipse project and breaking down to bare bones classes, xml, etc.

Now the problem I'm having is that the Spring beans config xml does not seem
to be being found and/or parsed b/c I have an invalid bean config in there
(for testing purposes) with a reference to a non-existing bean (which should
cause an exception during parsing/resolution by Spring).  No exception is
thrown in the karaf log.

I have the following export-package config in pom.xml:

<Export-Package>
							'=WEB-INF.lib',
							'=WEB-INF',
							'=WEB-INF.lib.classes',
						</Export-Package>

The Spring config file is in WEB-INF/classes directory in the WAB.

I have also tried exploding the WAR and moving the Spring config xml to
WEB-INF (this is how it works in another successfully deployed WAB) and
copying exploded directory to deploy dir in karaf.  Same behavior, no
exception on startup of karaf.

Here is the partial web.xml:

<servlet>
        <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
       
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            
<param-value>/WEB-INF/classes/workflow-ws-context.xml</param-value> 
        </init-param> 
        <load-on-startup>1</load-on-startup>
    </servlet>

Finding resources with Spring/karaf seems like such a nightmare....



--
View this message in context: http://karaf.922171.n3.nabble.com/Does-not-exist-in-file-system-tp4032974p4033001.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Does not exist in file system

Posted by asookazian2 <as...@gmail.com>.
adding reference to related thread:

http://karaf.922171.n3.nabble.com/classpath-resources-in-generated-bundle-td3961913.html#a4032977
<http://karaf.922171.n3.nabble.com/classpath-resources-in-generated-bundle-td3961913.html#a4032977>  



--
View this message in context: http://karaf.922171.n3.nabble.com/Does-not-exist-in-file-system-tp4032974p4032991.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Does not exist in file system

Posted by asookazian2 <as...@gmail.com>.
<bean id="sqlSessionFactory"
class="org.mybatis.spring.SqlSessionFactoryBean">
                <property name="dataSource" ref="dataSource" />

                <property name="mapperLocations">
                     <list>
                         
<value>classpath*:/WEB-INF/lib/com/nextgate/mm/mappers/*.xml</value>  
                         
<value>classpath*:/WEB-INF/lib/org/activiti/db/mapping/entity/*.xml</value>        
                     </list>
                </property>
                <property name="configLocation"
value="classpath:com/nextgate/mm/config/mybatis-config.xml" />
        </bean>

the above seems to works along with the export-package.  Not sure why I need
to use /WEB-INF/lib in the first two but not the 3rd one above.  If I use
/WEB-INF/lib in the 3rd one it can't find it...



--
View this message in context: http://karaf.922171.n3.nabble.com/Does-not-exist-in-file-system-tp4032974p4032990.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Does not exist in file system

Posted by asookazian2 <as...@gmail.com>.
used tip from this thread:

http://fusesource.com/forums/message.jspa?messageID=15551
<http://fusesource.com/forums/message.jspa?messageID=15551>  

in order for the export-package to show up in the manifest.mf, I had to use:

<Export-Package>
	'=WEB-INF.lib'
</Export-Package>

But still getting the exceptions...



--
View this message in context: http://karaf.922171.n3.nabble.com/Does-not-exist-in-file-system-tp4032974p4032981.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Does not exist in file system

Posted by asookazian2 <as...@gmail.com>.
bundle-classpath in WAB manifest.mf looks correct regarding foo.jar and
bar.jar:

<Bundle-ClassPath>., WEB-INF/classes
			,WEB-INF/lib/foo.jar
			,WEB-INF/lib/bar.jar
</Bundle-ClassPath>



--
View this message in context: http://karaf.922171.n3.nabble.com/Does-not-exist-in-file-system-tp4032974p4032975.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Does not exist in file system

Posted by asookazian2 <as...@gmail.com>.
As a workaround solution to this classpath resolution issue, I copied the xml
files and the corresponding packages (folder structures) into
src/main/resources and referenced them as follows:

<bean id="sqlSessionFactory"
class="org.mybatis.spring.SqlSessionFactoryBean">
		
		<property name="dataSource" ref="dataSource" />

                <property name="mapperLocations">
                     <list>       
                     
                     	
<value>WEB-INF/classes/com/nextgate/mm/mappers/ExternalAppInfo.xml</value>
                     	
<value>WEB-INF/classes/com/nextgate/mm/mappers/GlobalResource.xml</value>
                     	
<value>WEB-INF/classes/com/nextgate/mm/mappers/ProcessDefinition.xml</value>
                     	
<value>WEB-INF/classes/com/nextgate/mm/mappers/ProcessInstanceExt.xml</value>
                     	
<value>WEB-INF/classes/com/nextgate/mm/mappers/ProcessInstanceExtProp.xml</value>
                     	
<value>WEB-INF/classes/com/nextgate/mm/mappers/UserResource.xml</value>
</list>
</property>
</bean>



--
View this message in context: http://karaf.922171.n3.nabble.com/Does-not-exist-in-file-system-tp4032974p4033013.html
Sent from the Karaf - User mailing list archive at Nabble.com.