Question

I am stuck at really curious error. I have a tapestry page in which I was trying to import a javascript file. Previously, I was importing extjs-version3.js file(which worked perfect) and then I wanted to import extjs-version4.js file. So, I removed the version3 file from file system, added version4 file to file system and changed my tapestry page's java code to import the version4 file. But I always got the error, "version3 file does not exist"!

While debugging, I changed the java code of page so that it does not import ANY file now.

So, now I have a page that does not import any javascript file and I still get the error, "version3 file does not exists".

Following are the exact details.

MyPage.java which imports the javascript file.

@Import(
        library = {
            //"context:js/lib/extjs3/adapter/ext/ext-base-debug.js", 
            //"context:js/lib/extjs3/ext-all-debug-w-comments-v4.js",
            /*"context:js/lib/ext_compat_layer/ext3-compat.js",
            "context:js/lib/ext_compat_layer/ext3-core-compat.js",*/
            //"context:js/page/ActivitiesTab.js",
            //"context:js/lib/extjs3/ux/gridSearch/Ext.ux.grid.Search.js",
            //"context:js/lib/extjs3/ux/gridSearch/Ext.ux.IconMenu.js",
            //"context:js/lib/extjs3/ux/gridSearch/Ext.ux.Toast.js"
        }, 
        stylesheet = {
            /*"context:js/lib/extjs3/resources/css/ext-all.css", 
            "context:js/lib/extjs3/resources/css/xtheme-gray.css",
            "context:js/lib/extjs3/resources/css/theme-gray/core.css",*/
            //"context:js/lib/extjs3/resources/css/icons.css",
            //"context:js/lib/extjs3/resources/css/gridsearch.css"
        }
    )

The stack trace of error I receive.

An unexpected application exception has occurred.

    org.apache.tapestry5.ioc.internal.OperationException
    Unable to locate asset 'context:js/lib/extjs3/ext-all-debug-w-comments.js' (the file does not exist).

    trace
            Constructing instance of page class net.semandex.salsa.tapestry.pages.ActivitiesTab

    java.lang.RuntimeException
    Unable to locate asset 'context:js/lib/extjs3/ext-all-debug-w-comments.js' (the file does not exist).

    Hide uninteresting stack frames Stack trace
            org.apache.tapestry5.internal.services.AssetSourceImpl.getLocalizedAssetFromResource(AssetSourceImpl.java:135)
            org.apache.tapestry5.internal.services.AssetSourceImpl.getAssetInLocale(AssetSourceImpl.java:105)
            org.apache.tapestry5.internal.services.AssetSourceImpl.getAsset(AssetSourceImpl.java:85)
            org.apache.tapestry5.internal.transform.ImportWorker$5.map(ImportWorker.java:206)
            org.apache.tapestry5.internal.transform.ImportWorker$5.map(ImportWorker.java:203)
            org.apache.tapestry5.func.LazyMappedValue.get(LazyMappedValue.java:31)
            org.apache.tapestry5.func.LazyFlow.first(LazyFlow.java:52)
            org.apache.tapestry5.func.AbstractFlow$1.next(AbstractFlow.java:68)
            org.apache.tapestry5.func.AbstractFlow.toMutableList(AbstractFlow.java:47)
            org.apache.tapestry5.func.AbstractFlow.toMutableList(AbstractFlow.java:40)
            org.apache.tapestry5.func.AbstractFlow.toList(AbstractFlow.java:205)
            org.apache.tapestry5.internal.transform.ImportWorker.convertPathsToAssets(ImportWorker.java:202)
            org.apache.tapestry5.internal.transform.ImportWorker.access$100(ImportWorker.java:40)
            org.apache.tapestry5.internal.transform.ImportWorker$4.advise(ImportWorker.java:190)
            org.apache.tapestry5.internal.services.AbstractComponentMethodInvocation.proceed(AbstractComponentMethodInvocation.java:86)
            net.semandex.salsa.tapestry.pages.ActivitiesTab.containingPageDidLoad(ActivitiesTab.java)
            org.apache.tapestry5.internal.structure.ComponentPageElementImpl$4.run(ComponentPageElementImpl.java:120)
            org.apache.tapestry5.internal.structure.ComponentPageElementImpl.invoke(ComponentPageElementImpl.java:977)
            org.apache.tapestry5.internal.structure.ComponentPageElementImpl.containingPageDidLoad(ComponentPageElementImpl.java:829)
            org.apache.tapestry5.internal.structure.PageImpl.loaded(PageImpl.java:171)
            org.apache.tapestry5.internal.pageload.PageLoaderImpl$3.invoke(PageLoaderImpl.java:190)
            org.apache.tapestry5.internal.pageload.PageLoaderImpl$3.invoke(PageLoaderImpl.java:174)
            org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:65)
            org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:68)
            org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:1063)
            org.apache.tapestry5.internal.pageload.PageLoaderImpl.loadPage(PageLoaderImpl.java:173)
            org.apache.tapestry5.internal.services.PageSourceImpl.getPage(PageSourceImpl.java:81)
            org.apache.tapestry5.internal.services.NonPoolingRequestPageCacheImpl.get(NonPoolingRequestPageCacheImpl.java:74)
            org.apache.tapestry5.internal.services.PageRenderRequestHandlerImpl.handle(PageRenderRequestHandlerImpl.java:55)
            org.apache.tapestry5.services.TapestryModule$36.handle(TapestryModule.java:2326)
            org.apache.tapestry5.internal.services.ComponentRequestHandlerTerminator.handlePageRender(ComponentRequestHandlerTerminator.java:48)
            org.apache.tapestry5.services.InitializeActivePageName.handlePageRender(InitializeActivePageName.java:47)
            org.apache.tapestry5.internal.services.PageRenderDispatcher.dispatch(PageRenderDispatcher.java:45)
            org.apache.tapestry5.services.TapestryModule$RequestHandlerTerminator.service(TapestryModule.java:321)
            net.semandex.salsa.tapestry.services.AppModule$1.service(AppModule.java:164)
            org.apache.tapestry5.internal.services.RequestErrorFilter.service(RequestErrorFilter.java:26)
            org.apache.tapestry5.services.TapestryModule$4.service(TapestryModule.java:984)
            org.apache.tapestry5.services.TapestryModule$3.service(TapestryModule.java:974)
            org.apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:90)
            org.apache.tapestry5.internal.services.URLRewriterRequestFilter.service(URLRewriterRequestFilter.java:50)
            org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:90)
            org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:80)
            org.apache.tapestry5.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:85)
            org.apache.tapestry5.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:103)
            org.apache.tapestry5.services.TapestryModule$HttpServletRequestHandlerTerminator.service(TapestryModule.java:272)
            org.apache.tapestry5.internal.gzip.GZipFilter.service(GZipFilter.java:53)
            org.apache.tapestry5.upload.internal.services.MultipartServletRequestFilter.service(MultipartServletRequestFilter.java:44)
            org.apache.tapestry5.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62)
            org.apache.tapestry5.services.TapestryModule$2.service(TapestryModule.java:928)
            org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java:147) 

MyPage.tml file is very simple and has nothing suspicious but I can post the code if needed.

Why tapestry is trying to load a js file which is not included in any page?

Update:

Infact, irrespective of what I write in @Import annotation, the files are always imported according to the previous code. This is happening with all the pages.

Was it helpful?

Solution 2

Resolved now. The problem was with my production environment and not in Tapestry. Java class files were not updated by Eclipse when I changed them. Because of this, javascript files were imported based on the previous code in java file of the page.

Eclipse reported following problem. "The project was not built due to "Could not delete '/someName/bin/". Fix the problem, then try refreshing this project and building it since it may be inconsistent" I referred this question and solved my problem.

Simple refresh, clean/publish did not solve my problem. I had to close the Eclipse and restart the PC. This fixed my environment and now Eclipse is updating the java classes properly.

OTHER TIPS

This could be caused by some component in the template which fails to load the asset, or maybe a parent template that is extended by MyPage.

According to the stacktrace, the page net.semandex.salsa.tapestry.pages.ActivitiesTab is the cause of the problem. MyPage probably loads it somewhere.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top