You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Java House <ja...@gmail.com> on 2016/11/20 09:51:10 UTC

Blank app fails to build

Hello

this is my first attempt with Struts.
I am trying to run the Blank App sample application. I tried first by
creating it using the maven archetype and also tried it through the
struts-examples-master.
I am using
JDK 1.8.0_111,
mvn 3.3.9
Struts 2.5.5

when doing mvn clean install
test fails on the getText() method, I am getting null pointer exception
-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running example.ConfigTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.886
sec - in example.ConfigTest
Running example.HelloWorldTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.083
sec <<< FAILURE! - in example.HelloWorldTest
testHelloWorld(example.HelloWorldTest)  Time elapsed: 0.082 sec  <<< ERROR!
java.lang.NullPointerException
    at example.HelloWorldTest.testHelloWorld(HelloWorldTest.java:31)


I also tried a few older versions of struts but I am always getting
this error. Does anyone has any idea what am I doing wrong?

I am guessing that the getText method fails because it does not find
the properties files.
In the example the properties is under
struts-examples-master\blank\src\main\resources\example\package.properties

I even tried to place the file under the java and rename it the same
as the class
struts-examples-master\blank\src\main\java\example\HelloWorld.properties

but it didn't help

thank you for your support

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Blank app fails to build

Posted by Java House <ja...@gmail.com>.
The change indeed fixes the issue
thank you

2016-11-20 18:28 GMT+02:00 Lukasz Lenart <lu...@apache.org>:
> Open HelloWorldTest.java and replace this
>
> HelloWorld hello_world = new HelloWorld();
>
> with this
>
> HelloWorld hello_world = container.inject(HelloWorld.class);

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Blank app fails to build

Posted by Lukasz Lenart <lu...@apache.org>.
Open HelloWorldTest.java and replace this

HelloWorld hello_world = new HelloWorld();

with this

HelloWorld hello_world = container.inject(HelloWorld.class);

I will fix that with the next release


Regards
-- 
Ɓukasz
+ 48 606 323 122 http://www.lenart.org.pl/

2016-11-20 17:20 GMT+01:00 Lukasz Lenart <lu...@apache.org>:
> It's a bug in the test, when you use `mvn jetty:run` it will start
> Jetty properly.
>
> 2016-11-20 10:51 GMT+01:00 Java House <ja...@gmail.com>:
>> Hello
>>
>> this is my first attempt with Struts.
>> I am trying to run the Blank App sample application. I tried first by
>> creating it using the maven archetype and also tried it through the
>> struts-examples-master.
>> I am using
>> JDK 1.8.0_111,
>> mvn 3.3.9
>> Struts 2.5.5
>>
>> when doing mvn clean install
>> test fails on the getText() method, I am getting null pointer exception
>> -------------------------------------------------------
>>  T E S T S
>> -------------------------------------------------------
>> Running example.ConfigTest
>> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.886
>> sec - in example.ConfigTest
>> Running example.HelloWorldTest
>> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.083
>> sec <<< FAILURE! - in example.HelloWorldTest
>> testHelloWorld(example.HelloWorldTest)  Time elapsed: 0.082 sec  <<< ERROR!
>> java.lang.NullPointerException
>>     at example.HelloWorldTest.testHelloWorld(HelloWorldTest.java:31)
>>
>>
>> I also tried a few older versions of struts but I am always getting
>> this error. Does anyone has any idea what am I doing wrong?
>>
>> I am guessing that the getText method fails because it does not find
>> the properties files.
>> In the example the properties is under
>> struts-examples-master\blank\src\main\resources\example\package.properties
>>
>> I even tried to place the file under the java and rename it the same
>> as the class
>> struts-examples-master\blank\src\main\java\example\HelloWorld.properties
>>
>> but it didn't help
>>
>> thank you for your support
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Blank app fails to build

Posted by Lukasz Lenart <lu...@apache.org>.
It's a bug in the test, when you use `mvn jetty:run` it will start
Jetty properly.

2016-11-20 10:51 GMT+01:00 Java House <ja...@gmail.com>:
> Hello
>
> this is my first attempt with Struts.
> I am trying to run the Blank App sample application. I tried first by
> creating it using the maven archetype and also tried it through the
> struts-examples-master.
> I am using
> JDK 1.8.0_111,
> mvn 3.3.9
> Struts 2.5.5
>
> when doing mvn clean install
> test fails on the getText() method, I am getting null pointer exception
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Running example.ConfigTest
> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.886
> sec - in example.ConfigTest
> Running example.HelloWorldTest
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.083
> sec <<< FAILURE! - in example.HelloWorldTest
> testHelloWorld(example.HelloWorldTest)  Time elapsed: 0.082 sec  <<< ERROR!
> java.lang.NullPointerException
>     at example.HelloWorldTest.testHelloWorld(HelloWorldTest.java:31)
>
>
> I also tried a few older versions of struts but I am always getting
> this error. Does anyone has any idea what am I doing wrong?
>
> I am guessing that the getText method fails because it does not find
> the properties files.
> In the example the properties is under
> struts-examples-master\blank\src\main\resources\example\package.properties
>
> I even tried to place the file under the java and rename it the same
> as the class
> struts-examples-master\blank\src\main\java\example\HelloWorld.properties
>
> but it didn't help
>
> thank you for your support
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Blank app fails to build

Posted by Java House <ja...@gmail.com>.
2016-11-20 17:17 GMT+02:00 Martin Gainty <mg...@hotmail.com>:

>
> MG>possible maven-jetty-plugin is not copying .properties to expected WEB-INF\classes\example
> MG>when operational struts war expects HelloWorld<lang>.properties to be in .\WEB-INF\classes\example
>
> ls -al struts-2.3.4\src\apps\processing-forms\target\processing-forms\WEB-INF\classes\example
>
> 07/30/2012  09:02 AM               238 HelloWorld.properties
> 07/30/2012  09:02 AM               197 HelloWorld_es.properties
> 07/30/2012  09:02 AM               238 package.properties
> 07/30/2012  09:02 AM               197 package_es.properties
>
> MG>please confirm location of properties files
>
In my case when I build the project there is no struts2-blank-1.0.0
folder created under target
struts-examples-master\struts-examples-master\blank\target\struts2-blank-1.0.0\

I tried to build with struts 2.5.2 and the blank project runs fine and
now the examples fail on Portlet Webapp instead .
So there is a change in 2.5.5 that makes the blank application to not
build properly.

I will continue with 2.5.2 since it works until we get a fix on 2.5.5
or a new release.

thank you

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Blank app fails to build

Posted by Martin Gainty <mg...@hotmail.com>.

________________________________
From: Java House <ja...@gmail.com>
Sent: Sunday, November 20, 2016 4:51 AM
To: user@struts.apache.org
Subject: Blank app fails to build

Hello

this is my first attempt with Struts.
I am trying to run the Blank App sample application. I tried first by
creating it using the maven archetype and also tried it through the
struts-examples-master.
I am using
JDK 1.8.0_111,
mvn 3.3.9
Struts 2.5.5

when doing mvn clean install
test fails on the getText() method, I am getting null pointer exception
-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running example.ConfigTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.886
sec - in example.ConfigTest
Running example.HelloWorldTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.083
sec <<< FAILURE! - in example.HelloWorldTest
testHelloWorld(example.HelloWorldTest)  Time elapsed: 0.082 sec  <<< ERROR!
java.lang.NullPointerException
    at example.HelloWorldTest.testHelloWorld(HelloWorldTest.java:31)


I also tried a few older versions of struts but I am always getting
this error. Does anyone has any idea what am I doing wrong?

I am guessing that the getText method fails because it does not find
the properties files.
In the example the properties is under
struts-examples-master\blank\src\main\resources\example\package.properties

I even tried to place the file under the java and rename it the same
as the class
struts-examples-master\blank\src\main\java\example\HelloWorld.properties

MG>possible maven-jetty-plugin is not copying .properties to expected WEB-INF\classes\example
MG>when operational struts war expects HelloWorld<lang>.properties to be in .\WEB-INF\classes\example

ls -al struts-2.3.4\src\apps\processing-forms\target\processing-forms\WEB-INF\classes\example

07/30/2012  09:02 AM               238 HelloWorld.properties
07/30/2012  09:02 AM               197 HelloWorld_es.properties
07/30/2012  09:02 AM               238 package.properties
07/30/2012  09:02 AM               197 package_es.properties

MG>please confirm location of properties files

but it didn't help

thank you for your support

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org