problem accessing assets after migration to 5.4

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

problem accessing assets after migration to 5.4

Qbyte Consulting
Hi,

I've changed my project deps to T5.4. After fixing some depricated page
link methods my app compiles. However when I run I get exceptions from a
menu loading service:

is = assetSource.getClasspathAsset("menu.properties").getResource()
.openStream();
} catch (RuntimeException e) {
final String msg = "The menu.properties asset can not be found";

java.lang.RuntimeException: Exception constructing service 'MenuService':
Error
invoking constructor public
epulse.audit.manager.services.impl.MenuServiceImpl(o
rg.apache.tapestry5.services.AssetSource,org.slf4j.Logger) throws
java.io.IOExce
ption: The menu.properties asset can not be found
        at
org.apache.tapestry5.ioc.internal.services.JustInTimeObjectCreator.ob
tainObjectFromCreator(JustInTimeObjectCreator.java:76)
        at
org.apache.tapestry5.ioc.internal.services.JustInTimeObjectCreator.cr
eateObject(JustInTimeObjectCreator.java:55)
        at
org.apache.tapestry5.ioc.internal.services.JustInTimeObjectCreator.ea
gerLoadService(JustInTimeObjectCreator.java:88)
        at
org.apache.tapestry5.ioc.internal.RegistryImpl.performRegistryStartup
(RegistryImpl.java:357)

This reads in a properties file. It worked before, the files are under
resources in the maven project. Even copying them to the same source
package as the class doesn't resolve the issue, any idea?

John
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: problem accessing assets after migration to 5.4

Thiago H. de Paula Figueiredo
On Thu, 30 Jun 2016 13:13:23 -0300, Qbyte Consulting  
<[hidden email]> wrote:

> Hi,

Hi!

> I've changed my project deps to T5.4. After fixing some depricated page
> link methods my app compiles. However when I run I get exceptions from a
> menu loading service:
>
> is = assetSource.getClasspathAsset("menu.properties").getResource()
> .openStream();
> } catch (RuntimeException e) {

Try "/menu.properties" instead of "menu.properties", please.

--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: problem accessing assets after migration to 5.4

Chris Poulsen
assets are usually in a specific path (resources/META-INF/assets/...) -
Could it be that your file is not an asset and that it should be loaded
using normal methods (classloader.getResourceAsStream or similar)

--
Chris

On Thu, Jun 30, 2016 at 8:23 PM, Thiago H de Paula Figueiredo <
[hidden email]> wrote:

> On Thu, 30 Jun 2016 13:13:23 -0300, Qbyte Consulting <
> [hidden email]> wrote:
>
> Hi,
>>
>
> Hi!
>
> I've changed my project deps to T5.4. After fixing some depricated page
>> link methods my app compiles. However when I run I get exceptions from a
>> menu loading service:
>>
>> is = assetSource.getClasspathAsset("menu.properties").getResource()
>> .openStream();
>> } catch (RuntimeException e) {
>>
>
> Try "/menu.properties" instead of "menu.properties", please.
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Loading...