Message Boards

« Back to 2.- Usage ( From Xml file to CRUD Portlet)

ERROR: BeanLocator is null for servlet context example

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Hi there,

I just created the sample portlet, which is described by you under " Install XMLPortletFactory in Liferay SDK ".

I imported it into Eclipse as "Liferay Projects from Plugins SDK" because thats the way I develop and deploy portlets. I added to my Liferay 6.1.2 Tomcat Server, started the server, logged into my Liferay instance and added the generated sample Portlet to a page. Ok, so far so good ( if i do not deploy it to eclipse, it won't show up in liferay, although your build script deployed it in tomcat. Don't know why...)

When I add a new Entry in the Portlet I get always an error message that the request could not be answered. The Liferay log sais: "ERROR [http-bio-8080-exec-9][PortletBeanLocatorUtil:42] BeanLocator is null for servlet context example".
I searched for this error on google, but I could not find anything that could help.

The database tabels are present in my Postgres server.

So what does this error mean and how can I get rid of it?

Are xmlportletfactory compatible with Liferay 6.1.2 because the 2.2 version is quite old (almost one year).

Thank you very much,
Martin

RE: ERROR: BeanLocator is null for servlet context example
Answer
1/9/14 6:14 AM as a reply to Martin Dames.
Is there any progress on this?

I will need XMLPortletFactory soon....

Thank you very much.

RE: ERROR: BeanLocator is null for servlet context example
Answer
1/19/14 5:10 PM as a reply to Martin Dames.
Hi Martin,

I am happy to announce this issue has been fixed. It's commited to SVN to it should be in next version (as of today there isn't a release date, hope to tell something in few weeks).

Meanwhile, I've created a ZIP so you can use it now. Simply extract the contents of the ZIP into your portlet SDK root folder.

Ask for help if you see more problems.

Meanwhile we are working on releasing a new version with 6.2 version compatilibi, more news in next weeks.

Thanks!

EDIT: seems the file exceed the maximum file limit (9 MB vs 4 MB ).  I uploaded ZIP here: http://www.filedropper.com/xmlportletfactory20140119

RE: ERROR: BeanLocator is null for servlet context example
Answer
1/21/14 6:35 AM as a reply to Juan G..
Hi Juan,

thank you very much for this fix!

You compiled it with JDK 7.0 and it won't run with JDK 6, which I need to use for Liferay 6.1.x. Could you recompile it with JDK6 and upload it again please?

"java.lang.UnsupportedClassVersionError: org/xmlportletfactory/XMLPortletFactory : Unsupported major.minor version 51.0".

The reported major numbers are (src: http://stackoverflow.com/questions/10382929/unsupported-major-minor-version-51-0):
1J2SE 8 = 52,
2J2SE 7 = 51,
3J2SE 6.0 = 50,
4J2SE 5.0 = 49,
5JDK 1.4 = 48,
6JDK 1.3 = 47,
7JDK 1.2 = 46,
8JDK 1.1 = 45

Martin.

RE: ERROR: BeanLocator is null for servlet context example
Answer
1/21/14 8:25 AM as a reply to Martin Dames.

RE: ERROR: BeanLocator is null for servlet context example
Answer
1/23/14 6:59 AM as a reply to Juan G..
Thank you! It works now like a charm! emoticon

Very good work on XMLPF!

RE: ERROR: BeanLocator is null for servlet context example
Answer
2/3/14 6:49 PM as a reply to Martin Dames.
I'm using ubuntu server 12.04 64bits , liferay bundles with tomcat 6.2 and mysql server

javaversion "1.7.0_51"
Java(TM)SERuntime Environment(build1.7.0_51-b13)
JavaHotSpot(TM)64-BitServerVM(build24.51-b03, mixed mode)

ApacheAnt (TM)version1.9.3compiledon December23 2013

and xmlportletfactory version in http://www.filedropper.com/xmlportletfactory20140119

With the version that published earlier, the application showed an error in catalina.out "ERROR:BeanLocatorservletcontextisnullforexample" , this version does not generate error, but the add button does nothing.I press the button to add and does nothing and does not log any error in catalina.out

Could you help me.Thank you.

RE: ERROR: BeanLocator is null for servlet context example
Answer
2/3/14 6:53 PM as a reply to Sergio Vergara.
Hola Sergio,

please can you upload your definition XML file?

Thanks

RE: ERROR: BeanLocator is null for servlet context example
Answer
2/3/14 7:12 PM as a reply to Juan G..
Hello.

The content is

<?xml version="1.0" encoding="utf-8"?>
<definition xmlns="http://www.xmlportletfactory.org/xml/xmlportletfactory" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.xmlportletfactory.org/xml/xmlportletfactory xmlportletfactory.xsd">
    <commonData>
        <client>Example01</client>
        <projectName>Example</projectName>
        <version>1</version>
    </commonData>
    <applications>
    <!-- Example Portlet Class and File definition  -->
        <application>
            <classDef>
                <name>Example</name>
                <title>This is a Example</title>
                <mode>
                        <add>true</add>
                        <delete>true</delete>
                        <modify>true</modify>
                        <browse>true</browse>
                </mode>
                <restrictBy>
                        <userId>false</userId>
                </restrictBy>
            </classDef>
            <fileDef>
                <name>Example</name>
                <fields>
                    <field>
                        <name>ExampleId</name>
                        <title>Example Id</title>
                        <type>
                            <long>
                                <length>5</length>
                                <signed>false</signed>
                                <nullable>false</nullable>
                            </long>
                        </type>
                        <showFieldInView>false</showFieldInView>
                    </field>
                    <field>
                        <name>ExampleDescription</name>
                        <title>Example Description</title>
                        <type>
                            <varchar>
                                <length>100</length>
                            </varchar>
                        </type>
                        <showFieldInView>true</showFieldInView>
                        <required>true</required>
                    </field>
                </fields>
            </fileDef>
        </application>
    </applications>
</definition>


Thanks

RE: ERROR: BeanLocator is null for servlet context example
Answer
2/12/14 4:30 PM as a reply to Sergio Vergara.
Hi Sergio,

guess you have to add some parameters to liferay-portlet.xml.

Please take a look to my comment here:

http://www.xmlportletfactory.org/forum/-/message_boards/message/169830

BTW, XMLPortletFactory isn't supposed to be working properly in 6.2. Anyway, if you can see any other error feel free to post here, so we can take into account.

Thanks!