RE: possible security bug or tapestry bug beta-22

2014-11-30 Thread nhhockeyplayer nashua
Upon performing a clean rebuild and deploy...

the app works up to a couple select operations and then hangs with


--
The connection was reset

The connection to the server was reset while the page was loading.

The site could be temporarily unavailable or too busy. Try again in a few 
moments.
If you are unable to load any pages, check your computer's network 
connection.
If your computer or network is protected by a firewall or proxy, make sure 
that Firefox is permitted to access the Web.

--

its almost as though something is in an infinite loop

?

also the port service detection tool shows nogo for the app on port
http://www.portchecktool.com/

  

possible security bug or tapestry bug beta-22

2014-11-30 Thread nhhockeyplayer nashua
Hi Folks,

I have a widget that was working but is now broken.

Its a gallery widget and it operates a couple of select components in order to 
refab the gallery metrics for auto-paging and pagination.

Its been acting intermittent between versions of shiro-1.2.2 to 1.2.3 (got 
worse) its more widespread and producible on 1.2.3

Anyway, I am not sure if this is a mis-use bug or shiro-bug or a tap-5.4 bug

I attached the stack trace and its difficult to see as to why... maybe its a 
security configuration? My site is wide open except for admin privs on writable 
crud.

Is there anything I can provide in order to help troubleshoot this?

I would feel comfortable about the integrity of this stuff and its dependent 
binaries if my issue was resolved.

I am sensing it might be a shiro config error possibly 

Thanks for any tips

the demo is at http://psinh.ddns.net:9011/psi/home

Best regards 
and thanks... KEN

HTTP ERROR 500
Problem accessing /psi/home.galleryform/player. Reason:

org.apache.tapestry5.ioc.internal.OperationException: Error invoking 
constructor public 
org.apache.tapestry5.internal.services.ClientPersistentFieldStorageImpl(org.apache.tapestry5.services.Request,org.apache.tapestry5.services.ClientDataEncoder,org.apache.tapestry5.services.SessionPersistedObjectAnalyzer):
 java.lang.NullPointerExceptionCaused 
by:org.apache.shiro.subject.ExecutionException: 
org.apache.tapestry5.ioc.internal.OperationException: Error invoking 
constructor public 
org.apache.tapestry5.internal.services.ClientPersistentFieldStorageImpl(org.apache.tapestry5.services.Request,org.apache.tapestry5.services.ClientDataEncoder,org.apache.tapestry5.services.SessionPersistedObjectAnalyzer):
 java.lang.NullPointerException
at 
org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:385)
at 
org.tynamo.security.services.impl.SecurityConfiguration.service(SecurityConfiguration.java:54)
at $HttpServletRequestFilter_86ce53a67cd9.service(Unknown Source)
at $HttpServletRequestHandler_86ce53a67cdc.service(Unknown Source)
at 
org.apache.tapestry5.upload.internal.services.MultipartServletRequestFilter.service(MultipartServletRequestFilter.java:45)
at $HttpServletRequestHandler_86ce53a67cdc.service(Unknown Source)
at 
org.apache.tapestry5.internal.gzip.GZipFilter.service(GZipFilter.java:59)
at $HttpServletRequestHandler_86ce53a67cdc.service(Unknown Source)
at 
org.apache.tapestry5.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62)
at $HttpServletRequestFilter_86ce53a67cd5.service(Unknown Source)
at $HttpServletRequestHandler_86ce53a67cdc.service(Unknown Source)
at 
org.apache.tapestry5.modules.TapestryModule$1.service(TapestryModule.java:804)
at $HttpServletRequestHandler_86ce53a67cdc.service(Unknown Source)
at $HttpServletRequestHandler_86ce53a67cd4.service(Unknown Source)
at org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java:166)
at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)
at 
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:399)
at 
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at 
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at 
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450)
at 
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
at 
org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at 
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at 
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at 
org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:945)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at 
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
at 
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
Caused by: org.apache.tapestry5.ioc.internal.OperationException: Error invoking 
constructor public 
org.apache.tapestry5.internal.services.ClientPersistentFieldStorageImpl(org.apache.tapestry5.services.Request,org.apache.tapestry5.services.ClientDataEncoder,org.apache.tapestry5.services.SessionPersistedObjectAnalyzer):
 java.lang.NullPointerException
at 
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.logAndRethrow(OperationTrackerImpl.java:184)
at 
org.apache.tapestry5.ioc.internal.O

tapestry-routing cannot show on cancel CRUD

2014-11-30 Thread nhhockeyplayer nashua
Folks,

Using extended tapestry crud on beta-22

I have a simple model object called Year.JAVA... it implements a startYear and 
endYear... nothing major see below.

I didnt create any custom edit/add/show/collection pages for this. So it fits 
into the same framework as-is.

I got a standard Edit.JAVA which implements tapestry-routing... see below... 
nothing customized... this is as-is too

Everything works... except for CANCEL... it gets lost in never never land.

Everytime I ADD or EDIT with a subsequent CANCEL, it is suppose to go back to 
the Show.JAVA an dinstead it goes off to some ... well it takes the ROUTE atop 
the edit page for that model and operates that instead of operating the ROUTE 
to get back to the Show.JAVA page

First I do a show on the model with Show.JAVA page

url processed for this is as follows
"/psi/show/year/1"

I open up a year model into edit page and the url is as follows
"/psi/edit/year/1"

the problem is in this cancel() routine... below

then I attempt a cancel with logic below HOPING I will be brought back to the 
Show.JAVA page

@At("/{0}/{1}/edit")

@OnEvent("cancel")
Link cancel() {
return pageRenderLinkSource.createPageRenderLinkWithContext(Show.class, 
passivate());
}

after this is executed on the Year.JAVA model my REST url is as follows
"/psi/year/1"

when I am suppose to get
"/psi/show/year/1"

I am unable to debug this.. any hints ? Appreciate any help

Best regards 
and thanks... KEN

package org.tynamo.examples.psi.pages;

import org.apache.tapestry5.EventConstants;
import org.apache.tapestry5.Link;
import org.apache.tapestry5.annotations.CleanupRender;
import org.apache.tapestry5.annotations.Log;
import org.apache.tapestry5.annotations.OnEvent;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.hibernate.annotations.CommitAfter;
import org.apache.tapestry5.ioc.Messages;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.services.ContextValueEncoder;
import org.apache.tapestry5.services.PageRenderLinkSource;
import org.tynamo.routing.annotations.At;
import org.tynamo.services.PersistenceService;
import org.tynamo.util.TynamoMessages;
import org.tynamo.util.Utils;

@At("/{0}/{1}/edit")
public class Edit {
@Inject
private ContextValueEncoder contextValueEncoder;

@Inject
private Messages messages;

@Inject
private PersistenceService persitenceService;

@Inject
private PageRenderLinkSource pageRenderLinkSource;

@Property(write = false)
private Class beanType;

@Property
private Object bean;

@OnEvent(EventConstants.ACTIVATE)
Object activate(Class clazz, String id) {

if (clazz == null)
return Utils.new404(messages);

this.bean = contextValueEncoder.toValue(clazz, id);
this.beanType = clazz;

if (bean == null)
return Utils.new404(messages);

return null;
}

@CleanupRender
void cleanup() {
bean = null;
beanType = null;
}

/**
 * This tells Tapestry to put type & id into the URL, making it
 * bookmarkable.
 */
@OnEvent(EventConstants.PASSIVATE)
Object[] passivate() {
return new Object[] { beanType, bean };
}

@Log
@CommitAfter
@OnEvent(EventConstants.SUCCESS)
Link success() {
persitenceService.save(bean);
return cancel();
}

@OnEvent("cancel")
Link cancel() {
return pageRenderLinkSource.createPageRenderLinkWithContext(Show.class,
   passivate());
//return 
pageRenderLinkSource.createPageRenderLinkWithContext(List.class,
//beanType);
}

public String getListAllLinkMessage() {
return TynamoMessages.listAll(messages, beanType);
}

public String getTitle() {
return TynamoMessages.edit(messages, beanType);
}

}


@Entity
@ClassDescriptor(hasCyclicRelationships = true, nonVisual = false)
public class Year implements Cloneable, Serializable {
private static final Log log = LogFactory.getLog(Year.class);

private Integer id = null;

private Integer yearStart = new Integer("0");

private Integer yearEnd = new Integer("0");

private League league = null;

private Long created = new Long(GregorianCalendar.getInstance()
.getTimeInMillis());

private Long accessed = new Long(GregorianCalendar.getInstance()
.getTimeInMillis());

/**
 * CTOR
 */

public Year() {
}

public Year(Year dto) {
try {
BeanUtils.copyProperties(this, dto);
} catch (Exception e) {
log.error(e.toString());
e.printStackTrace();
}
}

/**
 * Accessor for id
 * 
 * @return Integer
 * @hibernate.id generator-class="increment" unsaved-value="-1"
 *   type="java.lang.Integer" unique="true" insert="true"
 */
@Id
@GeneratedValue(strategy = Gener

RE: Hibernate session tapestry atmosphere

2014-11-30 Thread Lance Java
tapestry-lanceuk-comet? lance-atmosphere? LOL... where do you guys come up
with this stuff?

It's tapestry-cometd or tapestry-atmosphere.


Re: [5.4-beta-22] Adding forms to a form using ajax

2014-11-30 Thread Muhammad Gelbana
Wrong subject. It should've been "Adding *fields* to a form using ajax"

*-*
*Muhammad Gelbana*
http://www.linkedin.com/in/mgelbana

On Sun, Nov 30, 2014 at 11:42 PM, Muhammad Gelbana 
wrote:

> From this jira issue , I
> understand that I can have a zone inside a form and this zone can by
> updated later on using ajax to display extra fields in the form.
>
> But now I'm facing this error message when I attempt doing that
>
> *​​Render queue error in SetupRender[​ipkpage/configure/Test:textfield_2]:
> Component ​ipkpage/configure/Test:textfield_2 must be enclosed by a Form
> component*
>
> I looked into the form components and tried to use the FormInjector
> component but then I was faced with this error message:
>
> *​​Render queue error in
> BeginRender[ixchariot/configure/Test:forminjector]:
> ClientBehaviorSupport.addFormInjector is not longer supported. A
> replacement is forthcoming.*
>
> ..like I even knew how to use it! There was no enough examples\samples for
> its usage.
>
> So is there a way to add\inject new forms to an existing form using ajax ?
> The *AjaxFormLoop*\*FormFragment* component doesn't seem to fit my
> scenario I'm trying to implement.
>
> Thanks.
> *-*
> *Muhammad Gelbana*
> http://www.linkedin.com/in/mgelbana
>


[5.4-beta-22] Adding forms to a form using ajax

2014-11-30 Thread Muhammad Gelbana
>From this jira issue , I
understand that I can have a zone inside a form and this zone can by
updated later on using ajax to display extra fields in the form.

But now I'm facing this error message when I attempt doing that

*​​Render queue error in SetupRender[​ipkpage/configure/Test:textfield_2]:
Component ​ipkpage/configure/Test:textfield_2 must be enclosed by a Form
component*

I looked into the form components and tried to use the FormInjector
component but then I was faced with this error message:

*​​Render queue error in
BeginRender[ixchariot/configure/Test:forminjector]:
ClientBehaviorSupport.addFormInjector is not longer supported. A
replacement is forthcoming.*

..like I even knew how to use it! There was no enough examples\samples for
its usage.

So is there a way to add\inject new forms to an existing form using ajax ?
The *AjaxFormLoop*\*FormFragment* component doesn't seem to fit my scenario
I'm trying to implement.

Thanks.
*-*
*Muhammad Gelbana*
http://www.linkedin.com/in/mgelbana


RE: Hibernate session tapestry atmosphere

2014-11-30 Thread Name Surname
OK I have just gone through a Lance-atmosphere code and found it's being using 
tap-jquery already. I had this reference problem and events couldn't be 
properly fired up. Solution to this is just to delete tap-jquery in your pom 
and bind it to existing one from Lance distribution.