You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by wlad <vv...@yahoo.com> on 2014/02/10 11:28:02 UTC

Apache TomEE - unable to access “TomEE GUI”, “Server Status”, “Manager App” and “Host Manager” services

I am working with some JEE web app using Apache TomEE
(apache-tomee-plus-1.5.2 on localhost) and trying to access these services
from links on TomEE's home page.

Now, I remember that earlier when I was starting with developing JEE apps, I
was deploying some simple exercises to TomEE server, apps were mostly about
some simple session beans and entities communicating with database. Then, I
have edited [tomee]/conf/tomcat-users.xml file, configured specific roles,
username and password (concretely username=tomee and password=tomee), and I
was able to go to localhost:8080/tomee (Tomcat GUI), sign in with these
credentials and I could see which beans are deployed to server, or which web
services are there.

Now, when I go to [tomee]/conf folder, there is tomcat-users.xml file and
there is also tomcat-users.xml.original (which is I believe automatically
generated file by TomEE at the moment when I had edited tomcat-users.xml)

In both these files, there are following lines:

*  <role rolename="admin-gui"/>
  <role rolename="tomee-admin"/>
  <role rolename="manager-gui"/>
  <user password="tomee" roles="tomee-admin,manager-gui,admin-gui"
username="tomee"/>
*

In Eclipse, for server setting (Server Overview), option /Use Tomcat
installation/ is selected. Deploy path is set to: /wtpwebapps/. 

I am currently working with JEE webapp, that have several session beans and
entities, which I am persisting (wtih OpenJPA) to MySQL database. This app
is deployed to server using ant tool. Application files and folders are
included to *app.war*file, and then deployed to /[tomee]/webapps/ directory.
Application is working fine, I would like to know why can't I go to
*localhost:8080/tomee*, sign in and see deployed session beans?

You can see tomee's configuration file content above. Everytime I try to
sign in, I am getting message "Bad user or password. Please try again."
Why am I not able to access TomEE's services ("TomEE GUI", "Server Status",
"Manager App" and "Host Manager")?



--
View this message in context: http://openejb.979440.n4.nabble.com/Apache-TomEE-unable-to-access-TomEE-GUI-Server-Status-Manager-App-and-Host-Manager-services-tp4667582.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Apache TomEE - unable to access "TomEE GUI", "Server Status", "Manager App" and "Host Manager" services

Posted by Thiago Veronezi <th...@veronezi.org>.
Try to use a "context.xml" in your project. This may work and you avoid
changes in server.xml.

Tomcat: http://tomcat.apache.org/tomcat-7.0-doc/config/context.html
Example:
https://github.com/tveronezi/faceid/blob/master/src/main/webapp/META-INF/context.xml

[]s,
Thiago.



On Tue, Feb 11, 2014 at 3:52 AM, wlad <vv...@yahoo.com> wrote:

> OK, this is scenario when will both TomEE GUI read its credentials (from
> tomcat-users.xml), and my app read its user credentials from database:
>
> To be able to deploy myApp.war to tomee/webapps folder, I must remove that
> context tag (with realm definition) for my application from conf/server.xml
> (commented it). Did that, deployed my application to tomee/webapps, then I
> have uncommented context tag, started server and in this case I am able to
> log in to TomEE GUI, and my application is able to use database defined
> under context realm tags.
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Apache-TomEE-unable-to-access-TomEE-GUI-Server-Status-Manager-App-and-Host-Manager-services-tp4667582p4667644.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Apache TomEE - unable to access "TomEE GUI", "Server Status", "Manager App" and "Host Manager" services

Posted by wlad <vv...@yahoo.com>.
OK, this is scenario when will both TomEE GUI read its credentials (from
tomcat-users.xml), and my app read its user credentials from database:

To be able to deploy myApp.war to tomee/webapps folder, I must remove that
context tag (with realm definition) for my application from conf/server.xml
(commented it). Did that, deployed my application to tomee/webapps, then I
have uncommented context tag, started server and in this case I am able to
log in to TomEE GUI, and my application is able to use database defined
under context realm tags.



--
View this message in context: http://openejb.979440.n4.nabble.com/Apache-TomEE-unable-to-access-TomEE-GUI-Server-Status-Manager-App-and-Host-Manager-services-tp4667582p4667644.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Apache TomEE - unable to access "TomEE GUI", "Server Status", "Manager App" and "Host Manager" services

Posted by wlad <vv...@yahoo.com>.
In server.xml config (one in eclipse, set in configuration path:
Servers/Apache TomEE 1.5.2-config), there isn't that realm defined. So if i
enter my realm in conf/server.xml and do server->Clean and server->Publish
then the realm I have added is removed.

Is there some other way or place where I could configure realm for my app,
other then in conf/server.xml?

I also tried adding that realm definition to both conf/server.xml and
server.xml in server config, but doesn't help.



--
View this message in context: http://openejb.979440.n4.nabble.com/Apache-TomEE-unable-to-access-TomEE-GUI-Server-Status-Manager-App-and-Host-Manager-services-tp4667582p4667643.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Apache TomEE - unable to access "TomEE GUI", "Server Status", "Manager App" and "Host Manager" services

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Whats your config of your wtp server? Did you force publish?
Le 11 févr. 2014 00:29, "wlad" <vv...@yahoo.com> a écrit :

> Hmm, I am having strange problem now. I had configured these realm settings
> and everything worked for a while. But now, when I start TomEE, content of
> the server.xml is returned as it was before I edited it. Something like if
> eclipse is cashing this file and somehow loading old version of the file???
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Apache-TomEE-unable-to-access-TomEE-GUI-Server-Status-Manager-App-and-Host-Manager-services-tp4667582p4667632.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Apache TomEE - unable to access "TomEE GUI", "Server Status", "Manager App" and "Host Manager" services

Posted by wlad <vv...@yahoo.com>.
Hmm, I am having strange problem now. I had configured these realm settings
and everything worked for a while. But now, when I start TomEE, content of
the server.xml is returned as it was before I edited it. Something like if
eclipse is cashing this file and somehow loading old version of the file???



--
View this message in context: http://openejb.979440.n4.nabble.com/Apache-TomEE-unable-to-access-TomEE-GUI-Server-Status-Manager-App-and-Host-Manager-services-tp4667582p4667632.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Apache TomEE - unable to access "TomEE GUI", "Server Status", "Manager App" and "Host Manager" services

Posted by wlad <vv...@yahoo.com>.
Thanks a lot for help.
I added realm definition to be inside context container, which again is
inside Host container:

<Host appBase="webapps" autoDeploy="true" name="localhost"
unpackWARs="true">

*<Context path="/myApp"  debug="0" privileged="true" docBase="myApp">
   <Realm className="org.apache.catalina.realm.JDBCRealm" 
      connectionName="root" connectionPassword="secret" 
      connectionURL="jdbc:mysql://localhost:3306/myAppDB" 
      driverName="com.mysql.jdbc.Driver" roleNameCol="type" 
      userCredCol="password" 
      userNameCol="username" userRoleTable="role" userTable="user"/>
</Context>*

        <Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs" pattern="%h %l %u %t &quot;%r&quot; %s %b"
prefix="localhost_access_log." suffix=".txt"/>

</Host>

TomEE GUI credentials are retrieved from tomcat-users.xml, and myApp
credentials are read from database.



--
View this message in context: http://openejb.979440.n4.nabble.com/Apache-TomEE-unable-to-access-TomEE-GUI-Server-Status-Manager-App-and-Host-Manager-services-tp4667582p4667630.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Apache TomEE - unable to access "TomEE GUI", "Server Status", "Manager App" and "Host Manager" services

Posted by Thiago Veronezi <th...@veronezi.org>.
That happens because "tomee" is using the same realm, and there is no
tomee-admin defined in your database.

Check this link: https://tomcat.apache.org/tomcat-7.0-doc/realm-howto.html



On Mon, Feb 10, 2014 at 3:49 PM, wlad <vv...@yahoo.com> wrote:

> Don't know if this is how it is suppose to be, but here is what I found
> out:
>
> I wasn't able to log in to tomee's services/apps because I have added
> "Realm" definition to [tomee]/conf/server.xml file (I need that Realm for
> my
> application).
> Here is how that tag looks like:
>
> /<Realm className="org.apache.catalina.realm.JDBCRealm"
> connectionName="root" connectionPassword="secret"
> connectionURL="jdbc:mysql://localhost:3306/myAppDB"
> driverName="com.mysql.jdbc.Driver" roleNameCol="type"
> userCredCol="password"
> userNameCol="username" userRoleTable="role" userTable="user"/>/
>
> In application I am working on, I use form based declarative autentication
> and authorization, and thats why I need this Realm be there.
>
> With added Realm tag in server.xml, my application works fine, I am
> communicating with database. But TomEE's services are not working then. If
> I
> remove this line from server.xml, I can log in to TomEE's services (TomEE
> GUI, Server Status, Manager App, Host Manager), but then my application
> cannot access database.
> And its same situation with both tomee-plus-1.5.2 and tomee-plus-1.6.0.
> I tried adding this same Realm definition to server.xml.original also so
> both files are same, but again same scenario. I can access tomee's
> apps/sevices only if there aren't any Realm tags added in these files.
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Apache-TomEE-unable-to-access-TomEE-GUI-Server-Status-Manager-App-and-Host-Manager-services-tp4667582p4667628.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Apache TomEE - unable to access "TomEE GUI", "Server Status", "Manager App" and "Host Manager" services

Posted by wlad <vv...@yahoo.com>.
Don't know if this is how it is suppose to be, but here is what I found out:

I wasn't able to log in to tomee's services/apps because I have added
"Realm" definition to [tomee]/conf/server.xml file (I need that Realm for my
application). 
Here is how that tag looks like:

/<Realm className="org.apache.catalina.realm.JDBCRealm"
connectionName="root" connectionPassword="secret"
connectionURL="jdbc:mysql://localhost:3306/myAppDB"
driverName="com.mysql.jdbc.Driver" roleNameCol="type" userCredCol="password"
userNameCol="username" userRoleTable="role" userTable="user"/>/

In application I am working on, I use form based declarative autentication
and authorization, and thats why I need this Realm be there.

With added Realm tag in server.xml, my application works fine, I am
communicating with database. But TomEE's services are not working then. If I
remove this line from server.xml, I can log in to TomEE's services (TomEE
GUI, Server Status, Manager App, Host Manager), but then my application
cannot access database.
And its same situation with both tomee-plus-1.5.2 and tomee-plus-1.6.0. 
I tried adding this same Realm definition to server.xml.original also so
both files are same, but again same scenario. I can access tomee's
apps/sevices only if there aren't any Realm tags added in these files.



--
View this message in context: http://openejb.979440.n4.nabble.com/Apache-TomEE-unable-to-access-TomEE-GUI-Server-Status-Manager-App-and-Host-Manager-services-tp4667582p4667628.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Apache TomEE - unable to access "TomEE GUI", "Server Status", "Manager App" and "Host Manager" services

Posted by Thiago Veronezi <th...@veronezi.org>.
Hi,

If you want to keep TomEE 1.5.2, forget about webaccess. "tomee" 1.5.2
contains the old version of it.

I didn't manage to reproduce your error with TomEE 1.5.2. What's the
version of your browser?

Ah, "tomee gui" 1.5.2 does not have the groovy runtime. You will need to
use javascript instead.

[]s,
Thiago.









On Mon, Feb 10, 2014 at 1:56 PM, wlad <vv...@yahoo.com> wrote:

> Thanks for the scripts, but I'm still struggling how to set up either
> "tomee"
> or "tomee-webaccess".
>
> To summarize:
> I am using "apache-tomee-plus-1.5.2", and would like to leave this version
> of tomee if possible, because I have already set some files in my
> application with this tomee version (ant build.properties file), then I
> have
> also edited some server files - added "Realm" definition in "server.xml",
> added "DataSource" Resources definition in "tomee.xml".
>
> Now, I understand that each folder inside *[tomee]/webapps* folder is
> separate application. And when I drop *.war* file, on server startup, war
> is
> unpacked to folder with appropriate content structure. Same way, I deploy
> my
> app. So, in this [tomee]/webapps there are next folders: docs,
> host-manager,
> manager, tomee, myApp.
> When I start tomee server from eclipse, and go to *localhost:8080/* I get
> Tomee home page (Apache Tomcat (TomEE)/7.0.37). If I go to documentation
> (localhost:8080/doc) I get documentation page. Similar when I got to myApp
> (localhost:8080/myApp) I get my app home page. Thats all fine.
>
> For "localhost:8080/tomee" I get tomee page that looks like this:  page
> <http://ge.tt/8XZDalJ1/v/0?c>
> And you can see message I got for entering "tomee" both for username and
> password.
>
> Then I have downloaded "tomee-webaccess-1.6.0.war" from the link you
> provided, copied it to [tomee]/webapps folder, started server (.war
> extracted), went to page "localhost:8080/tomee-webaccess-1.6.0", login
> window pops up, I enter "tomee" again (username and password), press Enter,
> username and password fields just clear up and nothing happens. Same with
> "Server Status", "Manager App" and "Host Manager" links on Tomee's home
> page.
>
> (sorry for explaining obvious things, I just don't know what am I doing
> wrong)
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Apache-TomEE-unable-to-access-TomEE-GUI-Server-Status-Manager-App-and-Host-Manager-services-tp4667582p4667625.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Apache TomEE - unable to access "TomEE GUI", "Server Status", "Manager App" and "Host Manager" services

Posted by wlad <vv...@yahoo.com>.
Thanks for the scripts, but I'm still struggling how to set up either "tomee"
or "tomee-webaccess". 

To summarize:
I am using "apache-tomee-plus-1.5.2", and would like to leave this version
of tomee if possible, because I have already set some files in my
application with this tomee version (ant build.properties file), then I have
also edited some server files - added "Realm" definition in "server.xml",
added "DataSource" Resources definition in "tomee.xml". 

Now, I understand that each folder inside *[tomee]/webapps* folder is
separate application. And when I drop *.war* file, on server startup, war is
unpacked to folder with appropriate content structure. Same way, I deploy my
app. So, in this [tomee]/webapps there are next folders: docs, host-manager,
manager, tomee, myApp.
When I start tomee server from eclipse, and go to *localhost:8080/* I get
Tomee home page (Apache Tomcat (TomEE)/7.0.37). If I go to documentation
(localhost:8080/doc) I get documentation page. Similar when I got to myApp
(localhost:8080/myApp) I get my app home page. Thats all fine. 

For "localhost:8080/tomee" I get tomee page that looks like this:  page
<http://ge.tt/8XZDalJ1/v/0?c>  
And you can see message I got for entering "tomee" both for username and
password.

Then I have downloaded "tomee-webaccess-1.6.0.war" from the link you
provided, copied it to [tomee]/webapps folder, started server (.war
extracted), went to page "localhost:8080/tomee-webaccess-1.6.0", login
window pops up, I enter "tomee" again (username and password), press Enter,
username and password fields just clear up and nothing happens. Same with
"Server Status", "Manager App" and "Host Manager" links on Tomee's home
page.

(sorry for explaining obvious things, I just don't know what am I doing
wrong)



--
View this message in context: http://openejb.979440.n4.nabble.com/Apache-TomEE-unable-to-access-TomEE-GUI-Server-Status-Manager-App-and-Host-Manager-services-tp4667582p4667625.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Apache TomEE - unable to access "TomEE GUI", "Server Status", "Manager App" and "Host Manager" services

Posted by Romain Manni-Bucau <rm...@gmail.com>.
actually tomee can be completely deleted it will still works
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau



2014-02-10 16:09 GMT+01:00 Thiago Veronezi <th...@veronezi.org>:
> Hi,
> please note that "tomee" and "webaccess" are two different applications.
>
> "tomee" is what makes it possible to do something like.
>
> Properties p = new Properties();
> p.put(Context.INITIAL_CONTEXT_FACTORY,
> "org.apache.openejb.client.RemoteInitialContextFactory");
> p.put(Context.PROVIDER_URL, "http://localhost:8080/tomee/ejb");
> Context ctx = new InitialContext(p);
>
> See "http://localhost:8080/*tomee*/ejb"
>
> If you open http://localhost:8080/tomee/, you will see the tomee installer.
> You don't use this guy if you use the bundled version of TomEE
> [apache-tomee-1.6.0-webprofile.tar.gz, apache-tomee-1.6.0-jaxrs.tar.gz or
> apache-tomee-1.6.0-plus.tar.gz] instead of the drop-in one
> [tomee-webapp-1.6.0.war or tomee-plus-webapp-1.6.0.war].
>
> http://tomee.apache.org/installation-drop-in-war.html
>
> "webaccess" is the web application that provides the console. I'll create
> an installation guide for it.
> Basically you run your tomee server and drop the tomee-webaccess war file [
> http://www.apache.org/dyn/closer.cgi/tomee/tomee-1.6.0/tomee-webaccess-1.6.0.war]
> under the webapps folder.
> Remember that the context of this app will be the name of your war file.
> You can rename it if you want.
>
> The console is no longer part of the base distribution due to its size. We
> want to keep TomEE as lightweight as possible. ~6mb of extra jars (groovy
> runtime and external JS and CSS stuff) was a little bit too much.
>
> Please note that "webaccess" requires tomee jax-rs or tomee-plus to run. I
> will remove this dependency asap.
>
> Ah... I have a new script for you. This will retrieve your beans and list
> their methods.
>
> //
> ******************************************************************************
>
> import java.util.Properties
> import javax.naming.Context
> import javax.naming.InitialContext
> import java.lang.reflect.Method
>
> def methodToString(Method method) {
>     def returnType = method.returnType.name
>     def name = method.name
>     def params = method.parameterTypes*.name
>     "${returnType} ${name} (${params.join(' ,')})"
> }
>
> def printNames(String root, Context c) {
>     def beans = c.list(root)?.findAll({
>         !it.name.contains('!')
>     })
>     beans?.each({
>         def bean = c.lookup("${root}/${it.name}")
>         if (Context.isInstance(bean)) {
>             println "[context] ${root}/${it.name}"
>             printNames("${root}/${it.name}", c)
>         } else {
>             println "[bean] ${root}/${it.name}"
>             bean.class.methods.each { m ->
>                 if (m.declaringClass != Object) {
>                     println '    ' + methodToString(m)
>                 }
>             }
>         }
>     })
> }
>
> printNames('java:global', new InitialContext([
>         (Context.INITIAL_CONTEXT_FACTORY):
> 'org.apache.openejb.client.RemoteInitialContextFactory',
>         (Context.PROVIDER_URL): 'http://localhost:8080/tomee/ejb'
> ] as Properties))
>
> //
> ******************************************************************************
>
>
>
>
> []s,
> Thiago.
>
>
> It's
>
>
>
>
> On Mon, Feb 10, 2014 at 8:34 AM, wlad <vv...@yahoo.com> wrote:
>
>> I tried next, but with no success:
>>
>> First, I have downloaded TomEE 1.6.0 version, and copied its "tomee"
>> app/folder (/[tomee-1.6.0/webapps/tomee])/ to the webapps folder of
>> /tomee-1.5.2/, one I am curently using. (of course, previously I have moved
>> old "tomee" folder, from /tomee-1.5.2/webapps/ to safe place).
>> With this, new "tomee" webapp I wasn't able not even to see that blank
>> white
>> page, with only black header at the top, and link to "Sign In" at the up
>> right corner. And I had that page with old "tomee" webapp (1.5.2).
>>
>> Then, I tried with the /tomee-webaccess-1.6.0/, as you suggested, but same
>> as with /tomee 1.6/. (Only this time I tried with
>> *http://localhost:8080/tomee-webaccess-1.6.0* address)
>>
>> After all, I moved back "tomee" folder that was there (at least I get tomee
>> gui's login page)
>>
>> Is it normal to have both /tomcat-users.xml/ and
>> /tomcat-users.xml.original/
>> files in [tomee-x.y]/conf folder?
>>
>> It looks to me that server can't see this configuration file. Because not
>> only "TomEE GUI" doesn't work, but also "Manager App", "Server Status",
>> "Host Manager" doesn't log in. I am not really familiar with these things,
>> may be (!) that I have set some setting, and changed server configuration.
>>
>> As I remember, earlier, I was using "tomee-1.6.0" and exactly because I
>> couldn't see TomEE GUI, and deployed beans, I tried with 1.5.2 version
>> where
>> this option was working fine. But now, don't know why its not working.
>>
>>
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://openejb.979440.n4.nabble.com/Apache-TomEE-unable-to-access-TomEE-GUI-Server-Status-Manager-App-and-Host-Manager-services-tp4667582p4667599.html
>> Sent from the OpenEJB User mailing list archive at Nabble.com.
>>

Re: Apache TomEE - unable to access "TomEE GUI", "Server Status", "Manager App" and "Host Manager" services

Posted by Thiago Veronezi <th...@veronezi.org>.
Hi,
please note that "tomee" and "webaccess" are two different applications.

"tomee" is what makes it possible to do something like.

Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY,
"org.apache.openejb.client.RemoteInitialContextFactory");
p.put(Context.PROVIDER_URL, "http://localhost:8080/tomee/ejb");
Context ctx = new InitialContext(p);

See "http://localhost:8080/*tomee*/ejb"

If you open http://localhost:8080/tomee/, you will see the tomee installer.
You don't use this guy if you use the bundled version of TomEE
[apache-tomee-1.6.0-webprofile.tar.gz, apache-tomee-1.6.0-jaxrs.tar.gz or
apache-tomee-1.6.0-plus.tar.gz] instead of the drop-in one
[tomee-webapp-1.6.0.war or tomee-plus-webapp-1.6.0.war].

http://tomee.apache.org/installation-drop-in-war.html

"webaccess" is the web application that provides the console. I'll create
an installation guide for it.
Basically you run your tomee server and drop the tomee-webaccess war file [
http://www.apache.org/dyn/closer.cgi/tomee/tomee-1.6.0/tomee-webaccess-1.6.0.war]
under the webapps folder.
Remember that the context of this app will be the name of your war file.
You can rename it if you want.

The console is no longer part of the base distribution due to its size. We
want to keep TomEE as lightweight as possible. ~6mb of extra jars (groovy
runtime and external JS and CSS stuff) was a little bit too much.

Please note that "webaccess" requires tomee jax-rs or tomee-plus to run. I
will remove this dependency asap.

Ah... I have a new script for you. This will retrieve your beans and list
their methods.

//
******************************************************************************

import java.util.Properties
import javax.naming.Context
import javax.naming.InitialContext
import java.lang.reflect.Method

def methodToString(Method method) {
    def returnType = method.returnType.name
    def name = method.name
    def params = method.parameterTypes*.name
    "${returnType} ${name} (${params.join(' ,')})"
}

def printNames(String root, Context c) {
    def beans = c.list(root)?.findAll({
        !it.name.contains('!')
    })
    beans?.each({
        def bean = c.lookup("${root}/${it.name}")
        if (Context.isInstance(bean)) {
            println "[context] ${root}/${it.name}"
            printNames("${root}/${it.name}", c)
        } else {
            println "[bean] ${root}/${it.name}"
            bean.class.methods.each { m ->
                if (m.declaringClass != Object) {
                    println '    ' + methodToString(m)
                }
            }
        }
    })
}

printNames('java:global', new InitialContext([
        (Context.INITIAL_CONTEXT_FACTORY):
'org.apache.openejb.client.RemoteInitialContextFactory',
        (Context.PROVIDER_URL): 'http://localhost:8080/tomee/ejb'
] as Properties))

//
******************************************************************************




[]s,
Thiago.


It's




On Mon, Feb 10, 2014 at 8:34 AM, wlad <vv...@yahoo.com> wrote:

> I tried next, but with no success:
>
> First, I have downloaded TomEE 1.6.0 version, and copied its "tomee"
> app/folder (/[tomee-1.6.0/webapps/tomee])/ to the webapps folder of
> /tomee-1.5.2/, one I am curently using. (of course, previously I have moved
> old "tomee" folder, from /tomee-1.5.2/webapps/ to safe place).
> With this, new "tomee" webapp I wasn't able not even to see that blank
> white
> page, with only black header at the top, and link to "Sign In" at the up
> right corner. And I had that page with old "tomee" webapp (1.5.2).
>
> Then, I tried with the /tomee-webaccess-1.6.0/, as you suggested, but same
> as with /tomee 1.6/. (Only this time I tried with
> *http://localhost:8080/tomee-webaccess-1.6.0* address)
>
> After all, I moved back "tomee" folder that was there (at least I get tomee
> gui's login page)
>
> Is it normal to have both /tomcat-users.xml/ and
> /tomcat-users.xml.original/
> files in [tomee-x.y]/conf folder?
>
> It looks to me that server can't see this configuration file. Because not
> only "TomEE GUI" doesn't work, but also "Manager App", "Server Status",
> "Host Manager" doesn't log in. I am not really familiar with these things,
> may be (!) that I have set some setting, and changed server configuration.
>
> As I remember, earlier, I was using "tomee-1.6.0" and exactly because I
> couldn't see TomEE GUI, and deployed beans, I tried with 1.5.2 version
> where
> this option was working fine. But now, don't know why its not working.
>
>
>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Apache-TomEE-unable-to-access-TomEE-GUI-Server-Status-Manager-App-and-Host-Manager-services-tp4667582p4667599.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Apache TomEE - unable to access "TomEE GUI", "Server Status", "Manager App" and "Host Manager" services

Posted by wlad <vv...@yahoo.com>.
I tried next, but with no success:

First, I have downloaded TomEE 1.6.0 version, and copied its "tomee"
app/folder (/[tomee-1.6.0/webapps/tomee])/ to the webapps folder of
/tomee-1.5.2/, one I am curently using. (of course, previously I have moved
old "tomee" folder, from /tomee-1.5.2/webapps/ to safe place).
With this, new "tomee" webapp I wasn't able not even to see that blank white
page, with only black header at the top, and link to "Sign In" at the up
right corner. And I had that page with old "tomee" webapp (1.5.2).

Then, I tried with the /tomee-webaccess-1.6.0/, as you suggested, but same
as with /tomee 1.6/. (Only this time I tried with
*http://localhost:8080/tomee-webaccess-1.6.0* address)

After all, I moved back "tomee" folder that was there (at least I get tomee
gui's login page)

Is it normal to have both /tomcat-users.xml/ and /tomcat-users.xml.original/
files in [tomee-x.y]/conf folder? 

It looks to me that server can't see this configuration file. Because not
only "TomEE GUI" doesn't work, but also "Manager App", "Server Status",
"Host Manager" doesn't log in. I am not really familiar with these things,
may be (!) that I have set some setting, and changed server configuration.

As I remember, earlier, I was using "tomee-1.6.0" and exactly because I
couldn't see TomEE GUI, and deployed beans, I tried with 1.5.2 version where
this option was working fine. But now, don't know why its not working.






--
View this message in context: http://openejb.979440.n4.nabble.com/Apache-TomEE-unable-to-access-TomEE-GUI-Server-Status-Manager-App-and-Host-Manager-services-tp4667582p4667599.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Apache TomEE - unable to access "TomEE GUI", "Server Status", "Manager App" and "Host Manager" services

Posted by Thiago Veronezi <th...@veronezi.org>.
Ah, once you have the webaccess installed, you can retrieve your beans with
this groovy script...

//
**************************************************************************************************************
import java.util.Properties
import javax.naming.Context
import javax.naming.InitialContext

def ctx = new InitialContext([
  (Context.INITIAL_CONTEXT_FACTORY):
'org.apache.openejb.client.RemoteInitialContextFactory',
  (Context.PROVIDER_URL): 'http://localhost:8080/tomee/ejb',
  (Context.SECURITY_PRINCIPAL): 'tomee',
  (Context.SECURITY_CREDENTIALS): 'tomee'
] as Properties)

ctx.list('java:global/jchat')?.each({ pair ->
  println pair.name
})
//
**************************************************************************************************************

Replace the credentials and 'java:global/jchat' accordingly.

https://dl.dropboxusercontent.com/u/1459144/tomee-list/jndi_listing.png

[]s,
Thiago.



On Mon, Feb 10, 2014 at 7:13 AM, Thiago Veronezi <th...@veronezi.org>wrote:

> Hi,
>
> The GUI of TomEE 1.5.2 is very buggy. Can you try the version 1.6.0?
> Use TomEE JAX-RS or Plus and drop the GUI war [
> http://www.apache.org/dyn/closer.cgi/tomee/tomee-1.6.0/tomee-webaccess-1.6.0.war
> ]
> You should create a user with the "tomee-admin" role.
>
> []s,
> Thiago.
>
>
>
> On Mon, Feb 10, 2014 at 5:28 AM, wlad <vv...@yahoo.com> wrote:
>
>> I am working with some JEE web app using Apache TomEE
>> (apache-tomee-plus-1.5.2 on localhost) and trying to access these services
>> from links on TomEE's home page.
>>
>> Now, I remember that earlier when I was starting with developing JEE
>> apps, I
>> was deploying some simple exercises to TomEE server, apps were mostly
>> about
>> some simple session beans and entities communicating with database. Then,
>> I
>> have edited [tomee]/conf/tomcat-users.xml file, configured specific roles,
>> username and password (concretely username=tomee and password=tomee), and
>> I
>> was able to go to localhost:8080/tomee (Tomcat GUI), sign in with these
>> credentials and I could see which beans are deployed to server, or which
>> web
>> services are there.
>>
>> Now, when I go to [tomee]/conf folder, there is tomcat-users.xml file and
>> there is also tomcat-users.xml.original (which is I believe automatically
>> generated file by TomEE at the moment when I had edited tomcat-users.xml)
>>
>> In both these files, there are following lines:
>>
>> *  <role rolename="admin-gui"/>
>>   <role rolename="tomee-admin"/>
>>   <role rolename="manager-gui"/>
>>   <user password="tomee" roles="tomee-admin,manager-gui,admin-gui"
>> username="tomee"/>
>> *
>>
>> In Eclipse, for server setting (Server Overview), option /Use Tomcat
>> installation/ is selected. Deploy path is set to: /wtpwebapps/.
>>
>> I am currently working with JEE webapp, that have several session beans
>> and
>> entities, which I am persisting (wtih OpenJPA) to MySQL database. This app
>> is deployed to server using ant tool. Application files and folders are
>> included to *app.war*file, and then deployed to /[tomee]/webapps/
>> directory.
>> Application is working fine, I would like to know why can't I go to
>> *localhost:8080/tomee*, sign in and see deployed session beans?
>>
>> You can see tomee's configuration file content above. Everytime I try to
>> sign in, I am getting message "Bad user or password. Please try again."
>> Why am I not able to access TomEE's services ("TomEE GUI", "Server
>> Status",
>> "Manager App" and "Host Manager")?
>>
>>
>>
>> --
>> View this message in context:
>> http://openejb.979440.n4.nabble.com/Apache-TomEE-unable-to-access-TomEE-GUI-Server-Status-Manager-App-and-Host-Manager-services-tp4667582.html
>> Sent from the OpenEJB User mailing list archive at Nabble.com.
>>
>
>

Re: Apache TomEE - unable to access "TomEE GUI", "Server Status", "Manager App" and "Host Manager" services

Posted by Thiago Veronezi <th...@veronezi.org>.
Hi,

The GUI of TomEE 1.5.2 is very buggy. Can you try the version 1.6.0?
Use TomEE JAX-RS or Plus and drop the GUI war [
http://www.apache.org/dyn/closer.cgi/tomee/tomee-1.6.0/tomee-webaccess-1.6.0.war
]
You should create a user with the "tomee-admin" role.

[]s,
Thiago.



On Mon, Feb 10, 2014 at 5:28 AM, wlad <vv...@yahoo.com> wrote:

> I am working with some JEE web app using Apache TomEE
> (apache-tomee-plus-1.5.2 on localhost) and trying to access these services
> from links on TomEE's home page.
>
> Now, I remember that earlier when I was starting with developing JEE apps,
> I
> was deploying some simple exercises to TomEE server, apps were mostly about
> some simple session beans and entities communicating with database. Then, I
> have edited [tomee]/conf/tomcat-users.xml file, configured specific roles,
> username and password (concretely username=tomee and password=tomee), and I
> was able to go to localhost:8080/tomee (Tomcat GUI), sign in with these
> credentials and I could see which beans are deployed to server, or which
> web
> services are there.
>
> Now, when I go to [tomee]/conf folder, there is tomcat-users.xml file and
> there is also tomcat-users.xml.original (which is I believe automatically
> generated file by TomEE at the moment when I had edited tomcat-users.xml)
>
> In both these files, there are following lines:
>
> *  <role rolename="admin-gui"/>
>   <role rolename="tomee-admin"/>
>   <role rolename="manager-gui"/>
>   <user password="tomee" roles="tomee-admin,manager-gui,admin-gui"
> username="tomee"/>
> *
>
> In Eclipse, for server setting (Server Overview), option /Use Tomcat
> installation/ is selected. Deploy path is set to: /wtpwebapps/.
>
> I am currently working with JEE webapp, that have several session beans and
> entities, which I am persisting (wtih OpenJPA) to MySQL database. This app
> is deployed to server using ant tool. Application files and folders are
> included to *app.war*file, and then deployed to /[tomee]/webapps/
> directory.
> Application is working fine, I would like to know why can't I go to
> *localhost:8080/tomee*, sign in and see deployed session beans?
>
> You can see tomee's configuration file content above. Everytime I try to
> sign in, I am getting message "Bad user or password. Please try again."
> Why am I not able to access TomEE's services ("TomEE GUI", "Server Status",
> "Manager App" and "Host Manager")?
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Apache-TomEE-unable-to-access-TomEE-GUI-Server-Status-Manager-App-and-Host-Manager-services-tp4667582.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>