New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TemplateProcessingException while passing params #292

Closed
agonist opened this Issue Jul 28, 2014 · 12 comments

Comments

Projects
None yet
3 participants
@agonist

agonist commented Jul 28, 2014

Hi, when I render a template with some objects in parameters and use it into the template everything work fine. I can refresh my page and it still work.
But, if I modify my template (it can be just adding a space), wisdom recompile but then I get this exception if I try to return on my page
org.thymeleaf.exceptions.TemplateProcessingException : object is not an instance of declaring class
on the line where I use my variable passing in parameters.
I must restart the application to make it work again. is this a wisdom bug ?

@cescoffier cescoffier added the bug label Jul 28, 2014

@cescoffier cescoffier added this to the 0.7 milestone Jul 28, 2014

@cescoffier

This comment has been minimized.

Show comment
Hide comment
@cescoffier

cescoffier Jul 28, 2014

Member

Looks like a bug (probably a leak). I will have a look.

Member

cescoffier commented Jul 28, 2014

Looks like a bug (probably a leak). I will have a look.

@cescoffier cescoffier closed this in 388baac Aug 4, 2014

@cescoffier

This comment has been minimized.

Show comment
Hide comment
@cescoffier

cescoffier Aug 4, 2014

Member

I've cleared all caches. I should remove the stale references.

Member

cescoffier commented Aug 4, 2014

I've cleared all caches. I should remove the stale references.

@cescoffier cescoffier modified the milestones: 0.7, 0.6.3 Sep 1, 2014

@hboumedane

This comment has been minimized.

Show comment
Hide comment
@hboumedane

hboumedane Oct 21, 2014

Not working for 0.6.4 version.
same senario and exception message .

hboumedane commented Oct 21, 2014

Not working for 0.6.4 version.
same senario and exception message .

@cescoffier

This comment has been minimized.

Show comment
Hide comment
@cescoffier

cescoffier Oct 21, 2014

Member

Can you provide the template ?

Member

cescoffier commented Oct 21, 2014

Can you provide the template ?

@hboumedane

This comment has been minimized.

Show comment
Hide comment
@hboumedane

hboumedane Oct 21, 2014

yes i can but how can I send you the template ??

hboumedane commented Oct 21, 2014

yes i can but how can I send you the template ??

@cescoffier

This comment has been minimized.

Show comment
Hide comment
@cescoffier

cescoffier Oct 21, 2014

Member

Either in the issue (copy paste the template). Or by mail on wisdom-discuss (https://groups.google.com/forum/#!forum/wisdom-discuss)

Member

cescoffier commented Oct 21, 2014

Either in the issue (copy paste the template). Or by mail on wisdom-discuss (https://groups.google.com/forum/#!forum/wisdom-discuss)

@hboumedane

This comment has been minimized.

Show comment
Hide comment
@hboumedane

hboumedane Oct 21, 2014

ok here the template

<!DOCTYPE html>
<html>
<head>
    <script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
    <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
    <script src="/assets/js/bootstrap-datepicker.js"></script>
    <!-- Latest compiled and minified CSS -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"/>
    <link rel="stylesheet" href="/assets/css/datepicker3.css" />
    <link rel="stylesheet" href="/assets/css/main.css" />

    <title>User Management Access</title>

    <script type="text/javascript">
        $(document).ready(function(){
            $("#myTab a").click(function(e){
                e.preventDefault();
                $(this).tab('show');
            });
        });

   </script>
</head>
<body>
<div class="page-header">
    <h1>Mon compte</h1>
</div>
<div class="bs-example">
    <ul class="nav nav-tabs" id="myTab">
        <li class="active"><a href="#sectionA">Mes Infos</a></li>
        <li><a href="#sectionB">Photo</a></li>
    </ul>
    <div class="tab-content">
        <div id="sectionA" class="tab-pane fade in active">
            <h3>Mes informations </h3>
            <form class="form-horizontal" role="form" action="#" enctype="multipart/form-data" method="POST" th:attr="action=${#routes.route('updateAccount')}">
                <div class="form-group">
                    <label for="lastname" class="col-sm-2 control-label">Nom:</label>

                    <div class="col-sm-3">
                        <input type="text" class="form-control" id="lastname" name="lastname" placeholder="Nom" th:value="${user.lastName}"/>
                    </div>
                </div>

                <div class="form-group">
                    <label for="firstname" class="col-sm-2 control-label">Prenom :</label>

                    <div class="col-sm-3">
                        <input type="text" class="form-control" id="firstname" name="firstname" placeholder="First Name" th:value="${user.firstName}"/>
                    </div>
                </div>

                <div class="form-group">
                    <label for="login" class="col-sm-2 control-label">Pseudo :</label>

                    <div class="col-sm-3">
                        <input type="text" class="form-control" id="login" name="login" placeholder="Pseudo" th:value="${user.pseudo}"/>
                    </div>
                </div>

                <div class="form-group">
                    <label for="email" class="col-sm-2 control-label">Email :</label>

                    <div class="col-sm-3">
                        <input type="email" class="form-control" id="email" name="email" placeholder="Email" th:value="${user.email}"/>
                    </div>
                </div>

                <div class="form-group">
                    <label for="birthday" class="col-sm-2 control-label">Date de naissance :</label>

                    <div class="col-sm-3">
                        <div id = "birthdayDiv" class="input-group date">
                            <input type="text" class="form-control" id="birthday" name="birthday" placeholder="Date de naissance" th:value="${birthday}" /><span class="input-group-addon"><i class="glyphicon glyphicon-th"></i></span>
                        </div>
                    </div>
                </div>

            </form>
            <script>
                $('#birthdayDiv').datepicker({
                    format: "dd/mm/yyyy",
                    language: "fr",
                    todayHighlight: true
                });
            </script>
        </div>
        <div id="sectionB" class="tab-pane fade">
            <h3>Photo</h3>
            <div class="row">
                <div class="col-xs-3 col-md-3">
                    <a href="#" class="thumbnail">
                        <img data-src="holder.js/100%x180" alt="100%x180" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNzEiIGhlaWdodD0iMTgwIj48cmVjdCB3aWR0aD0iMTcxIiBoZWlnaHQ9IjE4MCIgZmlsbD0iI2VlZSIvPjx0ZXh0IHRleHQtYW5jaG9yPSJtaWRkbGUiIHg9Ijg1LjUiIHk9IjkwIiBzdHlsZT0iZmlsbDojYWFhO2ZvbnQtd2VpZ2h0OmJvbGQ7Zm9udC1zaXplOjEycHg7Zm9udC1mYW1pbHk6QXJpYWwsSGVsdmV0aWNhLHNhbnMtc2VyaWY7ZG9taW5hbnQtYmFzZWxpbmU6Y2VudHJhbCI+MTcxeDE4MDwvdGV4dD48L3N2Zz4="
                             style="height: 180px; width: 100%; display: block;" />
                    </a>
                </div>
            </div>
            <form class="form-horizontal" role="form">
                <div class="form-group">
                    <label for="exampleInputFile">Joindre une photo</label>
                    <input type="file" id="inputFile"/>
                    <input id="userID" type="hidden" th:value="${user.id}"/>
                    <p class="help-block">Les formats support&eacute;es sont: jpeg, jpg, png, gif.</p>
                    <input id="uploadBTN" type="button" class="btn btn-primary" value="Envoyer" />
                </div>
            </form>

            <script>
                $("#uploadBTN").click(function(){
                    var id = $("#userID").val();
                    $.ajax({
                        url : '/user/uploadImage/' + id,
                        type : 'POST',
                        data : $("inputFile"),
                        dataType : 'html',
                        success : function(code_html, statut){

                        },

                        error : function(resultat, statut, erreur){

                        },

                        complete : function(resultat, statut){

                        }

                    });
                });

            </script>
        </div>
    </div>
</div>


</body>
</html>

hboumedane commented Oct 21, 2014

ok here the template

<!DOCTYPE html>
<html>
<head>
    <script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
    <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
    <script src="/assets/js/bootstrap-datepicker.js"></script>
    <!-- Latest compiled and minified CSS -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"/>
    <link rel="stylesheet" href="/assets/css/datepicker3.css" />
    <link rel="stylesheet" href="/assets/css/main.css" />

    <title>User Management Access</title>

    <script type="text/javascript">
        $(document).ready(function(){
            $("#myTab a").click(function(e){
                e.preventDefault();
                $(this).tab('show');
            });
        });

   </script>
</head>
<body>
<div class="page-header">
    <h1>Mon compte</h1>
</div>
<div class="bs-example">
    <ul class="nav nav-tabs" id="myTab">
        <li class="active"><a href="#sectionA">Mes Infos</a></li>
        <li><a href="#sectionB">Photo</a></li>
    </ul>
    <div class="tab-content">
        <div id="sectionA" class="tab-pane fade in active">
            <h3>Mes informations </h3>
            <form class="form-horizontal" role="form" action="#" enctype="multipart/form-data" method="POST" th:attr="action=${#routes.route('updateAccount')}">
                <div class="form-group">
                    <label for="lastname" class="col-sm-2 control-label">Nom:</label>

                    <div class="col-sm-3">
                        <input type="text" class="form-control" id="lastname" name="lastname" placeholder="Nom" th:value="${user.lastName}"/>
                    </div>
                </div>

                <div class="form-group">
                    <label for="firstname" class="col-sm-2 control-label">Prenom :</label>

                    <div class="col-sm-3">
                        <input type="text" class="form-control" id="firstname" name="firstname" placeholder="First Name" th:value="${user.firstName}"/>
                    </div>
                </div>

                <div class="form-group">
                    <label for="login" class="col-sm-2 control-label">Pseudo :</label>

                    <div class="col-sm-3">
                        <input type="text" class="form-control" id="login" name="login" placeholder="Pseudo" th:value="${user.pseudo}"/>
                    </div>
                </div>

                <div class="form-group">
                    <label for="email" class="col-sm-2 control-label">Email :</label>

                    <div class="col-sm-3">
                        <input type="email" class="form-control" id="email" name="email" placeholder="Email" th:value="${user.email}"/>
                    </div>
                </div>

                <div class="form-group">
                    <label for="birthday" class="col-sm-2 control-label">Date de naissance :</label>

                    <div class="col-sm-3">
                        <div id = "birthdayDiv" class="input-group date">
                            <input type="text" class="form-control" id="birthday" name="birthday" placeholder="Date de naissance" th:value="${birthday}" /><span class="input-group-addon"><i class="glyphicon glyphicon-th"></i></span>
                        </div>
                    </div>
                </div>

            </form>
            <script>
                $('#birthdayDiv').datepicker({
                    format: "dd/mm/yyyy",
                    language: "fr",
                    todayHighlight: true
                });
            </script>
        </div>
        <div id="sectionB" class="tab-pane fade">
            <h3>Photo</h3>
            <div class="row">
                <div class="col-xs-3 col-md-3">
                    <a href="#" class="thumbnail">
                        <img data-src="holder.js/100%x180" alt="100%x180" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNzEiIGhlaWdodD0iMTgwIj48cmVjdCB3aWR0aD0iMTcxIiBoZWlnaHQ9IjE4MCIgZmlsbD0iI2VlZSIvPjx0ZXh0IHRleHQtYW5jaG9yPSJtaWRkbGUiIHg9Ijg1LjUiIHk9IjkwIiBzdHlsZT0iZmlsbDojYWFhO2ZvbnQtd2VpZ2h0OmJvbGQ7Zm9udC1zaXplOjEycHg7Zm9udC1mYW1pbHk6QXJpYWwsSGVsdmV0aWNhLHNhbnMtc2VyaWY7ZG9taW5hbnQtYmFzZWxpbmU6Y2VudHJhbCI+MTcxeDE4MDwvdGV4dD48L3N2Zz4="
                             style="height: 180px; width: 100%; display: block;" />
                    </a>
                </div>
            </div>
            <form class="form-horizontal" role="form">
                <div class="form-group">
                    <label for="exampleInputFile">Joindre une photo</label>
                    <input type="file" id="inputFile"/>
                    <input id="userID" type="hidden" th:value="${user.id}"/>
                    <p class="help-block">Les formats support&eacute;es sont: jpeg, jpg, png, gif.</p>
                    <input id="uploadBTN" type="button" class="btn btn-primary" value="Envoyer" />
                </div>
            </form>

            <script>
                $("#uploadBTN").click(function(){
                    var id = $("#userID").val();
                    $.ajax({
                        url : '/user/uploadImage/' + id,
                        type : 'POST',
                        data : $("inputFile"),
                        dataType : 'html',
                        success : function(code_html, statut){

                        },

                        error : function(resultat, statut, erreur){

                        },

                        complete : function(resultat, statut){

                        }

                    });
                });

            </script>
        </div>
    </div>
</div>


</body>
</html>
@cescoffier

This comment has been minimized.

Show comment
Hide comment
@cescoffier

cescoffier Oct 21, 2014

Member

Thanks !

Member

cescoffier commented Oct 21, 2014

Thanks !

@cescoffier

This comment has been minimized.

Show comment
Hide comment
@cescoffier

cescoffier Oct 25, 2014

Member

I confirm, the bug is still there.

Seems to be a classloader issue while invoking method by reflection. OGNL does not expect having different classloaders. It might be because of a caching issue again, I'm investigating.

Member

cescoffier commented Oct 25, 2014

I confirm, the bug is still there.

Seems to be a classloader issue while invoking method by reflection. OGNL does not expect having different classloaders. It might be because of a caching issue again, I'm investigating.

@cescoffier cescoffier reopened this Oct 25, 2014

@cescoffier cescoffier modified the milestones: 0.7, 0.6.3 Oct 25, 2014

@cescoffier cescoffier self-assigned this Oct 25, 2014

@hboumedane

This comment has been minimized.

Show comment
Hide comment
@hboumedane

hboumedane Oct 27, 2014

Hello,
Thanks for your work, but I have a question ? is the fix available for 0.6.4 ?
and how can I benefit ? I'm using 0.6.4 .

hboumedane commented Oct 27, 2014

Hello,
Thanks for your work, but I have a question ? is the fix available for 0.6.4 ?
and how can I benefit ? I'm using 0.6.4 .

@cescoffier

This comment has been minimized.

Show comment
Hide comment
@cescoffier

cescoffier Oct 27, 2014

Member

No the fix is only available in the 0.7-SNAPSHOT.
I’m thinking about releasing a 0.6.5 today or tomorrow that will include the fix and the different improvements we did recently.

On 27 octobre 2014 at 09:30:28, hboumedane (notifications@github.com) wrote:

Hello,
Thanks for your work, but I have a question ? is the fix available for 0.6.4 ?
and how can I benefit ? I'm using 0.6.4 .


Reply to this email directly or view it on GitHub.

Member

cescoffier commented Oct 27, 2014

No the fix is only available in the 0.7-SNAPSHOT.
I’m thinking about releasing a 0.6.5 today or tomorrow that will include the fix and the different improvements we did recently.

On 27 octobre 2014 at 09:30:28, hboumedane (notifications@github.com) wrote:

Hello,
Thanks for your work, but I have a question ? is the fix available for 0.6.4 ?
and how can I benefit ? I'm using 0.6.4 .


Reply to this email directly or view it on GitHub.

@hboumedane

This comment has been minimized.

Show comment
Hide comment
@hboumedane

hboumedane Oct 27, 2014

thank you for the reply, I will wait for the 0.6.5 release.

hboumedane commented Oct 27, 2014

thank you for the reply, I will wait for the 0.6.5 release.

@cescoffier cescoffier modified the milestones: 0.7, 0.6.5 Nov 5, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment