Issue faced when on deploying connection pool in Solaris environment
But I am getting the following error geronimo_configure.sh geronimo_deploy.sh -bash-3.00$ geronimo_deploy.sh /export/home/indsanra/websphere/_jvm /export/home/indsanra/websphere/_jvm/jre /e xport/home/indsanra/IBM/AppServerCommunityEdition /export/home/indsanra/websphere/_jvm /export/home/indsanra/websphere/_jvm/jre /e xport/home/indsanra/IBM/AppServerCommunityEdition Using GERONIMO_BASE: /export/home/indsanra/IBM/AppServerCommunityEdition Using GERONIMO_HOME: /export/home/indsanra/IBM/AppServerCommunityEdition Using GERONIMO_TMPDIR: var/temp Using JRE_HOME:/export/home/indsanra/websphere/_jvm/jre Error: Unable to distribute tranql-connector-oracle-local-1.3.rar: Can not load activation spec class org.tranql.connector.oracle.LocalMCF in classloader console.dbpool/jdbc%2Ffocalpoint/1.0/rar /export/home/indsanra/websphere/_jvm /export/home/indsanra/websphere/_jvm/jre /e xport/home/indsanra/IBM/AppServerCommunityEdition Using GERONIMO_BASE: /export/home/indsanra/IBM/AppServerCommunityEdition Using GERONIMO_HOME: /export/home/indsanra/IBM/AppServerCommunityEdition Using GERONIMO_TMPDIR: var/temp Using JRE_HOME:/export/home/indsanra/websphere/_jvm/jre Error: Unable to distribute fp_nolicense.war: Unable to create configuration for deployment load of focalpoint/fp/1.0/war failed Missing dependency: console.dbpool/jdbc%2Ffocalpoint// 5:13:06 PM: [EMAIL PROTECTED] - Hearty C Raphael/India/IBM: Any idea on this? When I replace current dbpool name jdbc/focalpoint with jdbcfocalpoint, deployment successfully done. Is there any way I can retain the same naming format as jdbc/focalpoint. The connection pool deployment plan is as follows. ?xml version=1.0 encoding=UTF-8? connector xmlns=http://geronimo.apache.org/xml/ns/j2ee/connector-1.2; dep:environment xmlns:dep=http://geronimo.apache.org/xml/ns/deployment-1.2; dep:moduleId dep:groupIdconsole.dbpool/dep:groupId dep:artifactIdjdbc%2Ffocalpoint/dep:artifactId dep:version1.0/dep:version dep:typerar/dep:type /dep:moduleId dep:dependencies dep:dependency dep:groupIdcom.telelogic.lib/dep:groupId dep:artifactIdojdbc14_g/dep:artifactId dep:version10.2.0.1.0/dep:version dep:typejar/dep:type /dep:dependency /dep:dependencies /dep:environment resourceadapter outbound-resourceadapter connection-definition connectionfactory-interfacejavax.sql.DataSource/connectionfactory-interface connectiondefinition-instance namejdbc/focalpoint/name config-property-setting name=Passwordpword/config-property-setting config-property-setting name=Driveroracle.jdbc.OracleDriver/config-property-setting config-property-setting name=UserNameuser/config-property-setting config-property-setting name=ConnectionURLjdbc:oracle:thin:@indpd:1521:orcl/config-property-setting connectionmanager local-transaction/ single-pool max-size10/max-size min-size10/min-size blocking-timeout-milliseconds6/blocking-timeout-milliseconds idle-timeout-minutes10/idle-timeout-minutes match-one/ /single-pool /connectionmanager /connectiondefinition-instance /connection-definition /outbound-resourceadapter /resourceadapter /connector Please advise where I went wrong -- View this message in context: http://www.nabble.com/Issue-faced-when-on-deploying-connection-pool-in-Solaris-environment-tp20560472s134p20560472.html Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
Re: JNDI Context Lookup Help
Hi Mark, I had similar problems with Geronimo 2.1. You can check out my simple method for traversing JNDI: private void traverse(Context ctx, String path) throws NamingException { // lists all contents of current context NamingEnumerationBinding ne = ctx.listBindings(); while (ne.hasMore()) { Binding b = ne.next(); String name = path + / + b.getName(); // if current object is a context, traverse it if (b.getObject() instanceof Context) { traverse((Context) b.getObject(), name); } // otherwise print out object's name and its class else { logger.debug(name + == + b.getClassName()); } } } invoke it like this: Context c = new InitialContext(); traverse(c, java:comp/env); You can read more here: http://jee-bpel-soa.blogspot.com/2008/09/traversing-jndi-directory.html hope it helps :) best regards Łukasz 2008/11/17 Mark Aufdencamp [EMAIL PROTECTED]: Hi All, It's been a while since I had to ask for help from the list, but I hit a snag migrating an application from G-1.1.1 to G-2.1.3. Specifically, I'm having a problem with a JNDI context lookup inside a ServletContextListener. I presume this is a problem with the move to a global JNDI namespace in G-1.2 and forward. I have had the same result in 1.2-beta and 2.1.3. The Documentation and Google have not helped me here. I'm looking up an env-entry defined in the web.xml: env-entry env-entry-nameweb/ContentLocation/env-entry-name env-entry-typejava.lang.String/env-entry-type env-entry-value/SomeDirectoryHeirarchyName//env-entry-value /env-entry Access code as follows: String contentLocation = null; String contentLocationJNDIName = java:/comp/env/web/ContentLocation; Context ctx = null; boolean initialContextSuccess = false; try { ctx = new InitialContext(); initialContextSuccess = true; } catch (NamingException namingException){ namingException.printStackTrace(); } if(initialContextSuccess){ try{ contentLocation = (String) ctx.lookup(contentLocationJNDIName); } catch(NamingException namingException){ namingException.printStackTrace(); } } else{ // Error Handling } The ctx.lookup() throws a javax.naming.NotContextException: comp/env/web/ContentLocation. Do I need to define Properties for the InitialContext Factory, add something to my geronimo-web.xml plan, or utilize a different JNDI name? Thanks for your help, Mark Aufdencamp [EMAIL PROTECTED]
Re: Issue faced when on deploying connection pool in Solaris environment
Try creating a DB Pool that doesn't contain a space %2F in the name. -Donald Hearty wrote: But I am getting the following error geronimo_configure.sh geronimo_deploy.sh -bash-3.00$ geronimo_deploy.sh /export/home/indsanra/websphere/_jvm /export/home/indsanra/websphere/_jvm/jre /e xport/home/indsanra/IBM/AppServerCommunityEdition /export/home/indsanra/websphere/_jvm /export/home/indsanra/websphere/_jvm/jre /e xport/home/indsanra/IBM/AppServerCommunityEdition Using GERONIMO_BASE: /export/home/indsanra/IBM/AppServerCommunityEdition Using GERONIMO_HOME: /export/home/indsanra/IBM/AppServerCommunityEdition Using GERONIMO_TMPDIR: var/temp Using JRE_HOME:/export/home/indsanra/websphere/_jvm/jre Error: Unable to distribute tranql-connector-oracle-local-1.3.rar: Can not load activation spec class org.tranql.connector.oracle.LocalMCF in classloader console.dbpool/jdbc%2Ffocalpoint/1.0/rar /export/home/indsanra/websphere/_jvm /export/home/indsanra/websphere/_jvm/jre /e xport/home/indsanra/IBM/AppServerCommunityEdition Using GERONIMO_BASE: /export/home/indsanra/IBM/AppServerCommunityEdition Using GERONIMO_HOME: /export/home/indsanra/IBM/AppServerCommunityEdition Using GERONIMO_TMPDIR: var/temp Using JRE_HOME:/export/home/indsanra/websphere/_jvm/jre Error: Unable to distribute fp_nolicense.war: Unable to create configuration for deployment load of focalpoint/fp/1.0/war failed Missing dependency: console.dbpool/jdbc%2Ffocalpoint// 5:13:06 PM: [EMAIL PROTECTED] - Hearty C Raphael/India/IBM: Any idea on this? When I replace current dbpool name jdbc/focalpoint with jdbcfocalpoint, deployment successfully done. Is there any way I can retain the same naming format as jdbc/focalpoint. The connection pool deployment plan is as follows. ?xml version=1.0 encoding=UTF-8? connector xmlns=http://geronimo.apache.org/xml/ns/j2ee/connector-1.2; dep:environment xmlns:dep=http://geronimo.apache.org/xml/ns/deployment-1.2; dep:moduleId dep:groupIdconsole.dbpool/dep:groupId dep:artifactIdjdbc%2Ffocalpoint/dep:artifactId dep:version1.0/dep:version dep:typerar/dep:type /dep:moduleId dep:dependencies dep:dependency dep:groupIdcom.telelogic.lib/dep:groupId dep:artifactIdojdbc14_g/dep:artifactId dep:version10.2.0.1.0/dep:version dep:typejar/dep:type /dep:dependency /dep:dependencies /dep:environment resourceadapter outbound-resourceadapter connection-definition connectionfactory-interfacejavax.sql.DataSource/connectionfactory-interface connectiondefinition-instance namejdbc/focalpoint/name config-property-setting name=Passwordpword/config-property-setting config-property-setting name=Driveroracle.jdbc.OracleDriver/config-property-setting config-property-setting name=UserNameuser/config-property-setting config-property-setting name=ConnectionURLjdbc:oracle:thin:@indpd:1521:orcl/config-property-setting connectionmanager local-transaction/ single-pool max-size10/max-size min-size10/min-size blocking-timeout-milliseconds6/blocking-timeout-milliseconds idle-timeout-minutes10/idle-timeout-minutes match-one/ /single-pool /connectionmanager /connectiondefinition-instance /connection-definition /outbound-resourceadapter /resourceadapter /connector Please advise where I went wrong
Re: Set Keystore Password From GShell?
If you are using the Tomcat assembly (I'm looking at 2.1.x), then there is a complete example of a HTTPS connector in config.xml, which includes the keystorePass attribute - gbean name=TomcatWebSSLConnector attribute name=host${ServerHostname}/attribute attribute name=port${HTTPSPort + PortOffset}/attribute attribute name=maxHttpHeaderSize8192/attribute attribute name=maxThreads150/attribute attribute name=minSpareThreads25/attribute attribute name=maxSpareThreads75/attribute attribute name=enableLookupsfalse/attribute attribute name=acceptCount100/attribute attribute name=disableUploadTimeoutfalse/attribute attribute name=clientAuthfalse/attribute attribute name=algorithmDefault/attribute attribute name=sslProtocolTLS/attribute attribute name=keystoreFilevar/security/keystores/geronimo-defau lt/attribute attribute name=keystorePasssecret/attribute attribute name=keystoreTypeJKS/attribute /gbean -Donald Doug Reeder wrote: http://cwiki.apache.org/GMOxDOC21/administering-certificates.html explains how to configure an HTTPS listener to use SSL, including setting the keystore and keystore password. However, this requires the console, which is not installed on my production server, to keep the memory footprint small. I can set the keystore used by the HTTPS listener on my production server in var/config/config.xml, but not the password. Is there a way to do this from GShell, or bash?
Re: status from shell script (System V starup)
Cool! Maybe you'd like to open a JIRA and contribute your script once you're done? :-) For the status, maybe you could try something like - isGeronimoRunning() { ps_log=`mktemp /var/tmp/geronimo-ps.log` ps auxww $ps_log geronimo_is_running=false if grep -Dorg.apache.geronimo.base.dir=.*server.jar $ps_log /dev/null 2/dev/null ; then geronimo_is_running=true fi rm -f $ps_log test $geronimo_is_running = true } -Donald Doug Reeder wrote: I've written a bash shell script to start and stop geronimo, for use with System V startup (scripts in /etc/rc.d/init.d/). Start and stop are straightforward, as the scripts in $GERONIMO_HOME/bin/ just need to be called, but status is less obvious. The best I've come up with so far is su -l -c $GERONIMO_HOME/bin/deploy.sh -u $GERONIMO_ADMIN -p $GERONIMO_PASSWORD list-modules $USER but it's not satisfactory: 1) if geronimo is not running, it produces a stack dump, when all I want is a simple message indicating geronimo is not running 2) I have to include the geronimo administrator password in the script (of course, it also needs to be in the script so geronimo can be shut down). Can anyone suggest something better? If geronimo is running, what would be best is a short list of all the ports it's listening on. (Then one could use netstat or whatever to see if one can actually access them). #! /bin/sh # Return values # 0 - success # 1 - generic or unspecified error # 2 - invalid or excess argument(s) # 3 - unimplemented feature (e.g. reload) # 4 - insufficient privilege # 5 - program is not installed # 6 - program is not configured # 7 - program is not running isGeronimoRunning() { ps_log=`mktemp /var/tmp/geronimo-ps.log` ps auxww $ps_log geronimo_is_running=false if grep -Dorg.apache.geronimo.base.dir=.*server.jar $ps_log /dev/null 2/dev/null ; then geronimo_is_running=true fi rm -f $ps_log test $geronimo_is_running = true } if isGeronimoRunning ; then echo Found a Geronimo server instance running. exit 0 else echo Did not find a Geronimo server instance running. exit 7 fi
Re: Configuring log4j as jvm environment variable fails
Manu, I opened GERONIMO-4418 to reference this as a possible Sample we could create for 2.2. -Donald Manu George wrote: Hi Hearty, My understanding was that we just needed to hide the log4j and slf4j classes to use logging However a quick search came up with this http://webui.sourcelabs.com/geronimo/mail/user/threads/Logging_in_Geronimo_2.0.1.meta It lists the same problem and a solution In case of wanting to use a properties file, You can configure log4j for you app as follows 1) Write a gbean that will initialize log4j eg: package test import java.io.IOException; import java.io.InputStream; import java.util.Properties; import org.apache.geronimo.gbean.GBeanInfo; import org.apache.geronimo.gbean.GBeanInfoBuilder; import org.apache.geronimo.gbean.GBeanLifecycle; import org.apache.log4j.PropertyConfigurator; public class Log4JInitGBean { public Log4JInitGBean(String log4jResource, ClassLoader classloader) throws IOException { InputStream in; if (log4jResource != null) { in = classloader.getResourceAsStream(log4jResource); if (in == null) { throw new NullPointerException( No log4j properties resource found at + log4jResource); } } else { return; } Properties props = new Properties(); try { props.load(in); } finally { in.close(); } PropertyConfigurator.configure(props); } public static final GBeanInfo GBEAN_INFO; static { GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic( Log4JInitGBean.class); infoBuilder.setPriority(2); infoBuilder.addAttribute(log4jResource, String.class, true); infoBuilder.addAttribute(classLoader, ClassLoader.class, false); infoBuilder.setConstructor(new String[] { log4jResource, classLoader }); GBEAN_INFO = infoBuilder.getBeanInfo(); } public static GBeanInfo getGBeanInfo() { return GBEAN_INFO; } } Define this gbean in your plan via this entry gbean name=Log4jConfiguration class=test.Log4JInitGBean attribute name=log4jResourcefp-log4j.properties/attribute /gbean This will initialize ur log4j. Now since you are using slf4j as a wrapper over log4j. You can hide the two projects that may already be loaded in the parent classloaders via sys:hidden-classes sys:filterorg.apache.log4j/sys:filter sys:filterorg.slf4j/sys:filter /sys:hidden-classes Remember to package your own copies or add dependencies in your plan for the slf4j and log4j jars This should have your logging working. 2) Another way is to use the ApplicationLog4jConfigurationGBean though I was not able to get it to work as expected 3) I was not getting log4j to initialize with the configuration I specified without using the gbean above I need to investigate more into 2 and 3. Regards Manu P.S In your log4j.properties you can give the file path as log4j.appender.FILE.file=${org.apache.geronimo.server.dir}/var/log/test.log where org.apache.geronimo.server.dir is a system property On Fri, Nov 7, 2008 at 4:10 PM, Hearty [EMAIL PROTECTED] wrote: I have tried the below 2 options of setting my fp-log4j.properties. Both these options fails. I am not able to see log files created. SET JAVA_OPTS=-Dlog4j.configuration=C:\WebSphere\AppServerCommunityEdition\var\log\fp-log4j.properties SET JAVA_OPTS=-Dorg.apache.geronimo.log4jservice.configuration=C:\WebSphere\AppServerCommunityEdition\var\log\fp-log4j.properties These envionment variable I've specified from a command prompt and I've run start-server command from the same instance. My fp-log4j.properties is as follows #attach an appender to the base apacheds package logger: log4j.logger.org.apache.directory=INFO,fp #do not log apacheds to geronimo logs: log4j.additivity.org.apache.directory=false #Configure the fp specific appender: log4j.appender.fp=org.apache.log4j.DailyRollingFileAppender log4j.appender.fp.layout=org.apache.log4j.PatternLayout # geronimo style logging log4j.appender.fp.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c{1}] %m%n log4j.appender.fp.append=true log4j.appender.fp.file=${org.apache.geronimo.server.dir}/var/log/fp.log log4j.appender.fp.bufferedIO=false #focal point specific log settings log4j.logger.com.telelogic.focalpoint=DEBUG log4j.logger.com.telelogic.focalpoint.dao.jdbc.Jdbc=OFF log4j.logger.com.telelogic.focalpoint.dao.ViewExecutor=OFF log4j.logger.org.apache.catalina=INFO
Re: Geronimo security question
Seems like it would be a great feature to add support for using an existing tomcat-users.xml in Geronimo without having to convert it to a properties file, so I opened GERONIMO-4419 as a placeholder. -Donald David Jencks wrote: On Oct 30, 2008, at 3:32 AM, johnxmas wrote: Hi, I'm moving applications from Tomcat to Geronimo 2.1.3 One of these apps had security constraints. I read the documentation but, honestly, I didn't understand how I can achieve the same under Geronimo Any help would be appreciated Jean-Noël Here is the tomcat configuration - tomcat-users.xml ?xml version='1.0' encoding='utf-8'? tomcat-users role rolename=tomcat/ role rolename=role1/ role rolename=manager/ role rolename=admin/ role rolename=spadmin/ user username=tomcat password=tomcat roles=tomcat/ user username=both password=tomcat roles=tomcat,role1/ user username=role1 password=tomcat roles=role1/ user username=scort password=scort roles=manager,admin,spadmin/ /tomcat-users - the app web.xml had the following entries security-constraint web-resource-collection web-resource-nameProtected Area/web-resource-name !-- Define the context-relative URL(s) to be protected -- url-pattern/main/url-pattern url-pattern/jsp/customize.jsp/url-pattern url-pattern/jsp/editconnspec.jsp/url-pattern url-pattern/jsp/manageconnspec.jsp/url-pattern url-pattern/admin/config/*/url-pattern url-pattern/CreateConnection.srv/url-pattern url-pattern/ModifyConnection.srv/url-pattern url-pattern/EditConnection.srv/url-pattern url-pattern/DeleteConnection.srv/url-pattern url-pattern/ModifyRendering.srv/url-pattern !-- If you list http methods, only those methods are protected -- http-methodGET/http-method http-methodDELETE/http-method http-methodPOST/http-method http-methodPUT/http-method /web-resource-collection auth-constraint role-namespadmin/role-name /auth-constraint /security-constraint login-config auth-methodFORM/auth-method form-login-config form-login-page/admin/login/login.jsp/form-login-page form-error-page/admin/login/error.jsp/form-error-page /form-login-config /login-config security-role descriptionSecurity role for Smart Pack/description role-namespadmin/role-name /security-role From your security constraint I think this would be equivalent in terms of which pages are accessible: ?xml version='1.0' encoding='utf-8'? tomcat-users role rolename=spadmin/ user username=scort password=scort roles=spadmin/ /tomcat-users Anyway I think what you need to do is: 1. define a properties file login module based security realm, perhaps by using the admin console. Lets say you call it my-realm 2. translate the data into property files: my-users.properties: scort=scort my-groups.properties: spadmin=scort 3. put the properties files in the correct location, I'd suggest var/security 4. specify the my-realm security realm in the geronimo web app plan security-realmmy-realm/security-realm 5. Include the desired principal-role mapping that maps the spadmin group to the app-specific spadmin role. There are some instructions on this at the end of http://cwiki.apache.org/GMOxDOC21/configuring-run-as-and-default-subjects-and-principal-role-mapping.html hope this helps, david jencks
Re: Problems with Geronimos openjpa on foreign keys
I believe this is known problem in the OpenJPA 1.0.3 level we used in the 2.0.* and 2.1.* releases. Can you try a recent 2.1.4-SNAPSHOT build (such as the one below) to see if OpenJPA 1.2.0 fixes this? Subject: [BUILD] branches/2.1: Successful Date: 18 Nov 2008 17:11:08 - Geronimo Revision: 718564 built with tests included See the full build-0800.log file at http://people.apache.org/builds/geronimo/server/binaries/2.1/20081118/build-0800.log Download the binaries from http://people.apache.org/builds/geronimo/server/binaries/2.1/20081118 -Donald jsmch wrote: Hallo one again, i´ve problems with foreign-key-crossreferences using geronimo. I try using a Query Query q = em.createQuery(SELECT u FROM ChatUserLoggedIn u where u.chatroomid = null); List resultList = q.getResultList(); ListChatUserLoggedIn list = resultList; return list; My entities look like this: == @Entity public class ChatUserLoggedIn implements Serializable { @Id @GeneratedValue(strategy = GenerationType.AUTO) private int id; @ManyToOne @JoinColumn(name=userid) private ChatUser user; @ManyToOne @JoinColumn(name=chatroomid, nullable=true) private ChatRoom room; private static final long serialVersionUID = 1L; == @Entity public class ChatUser implements Serializable{ private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.AUTO) private int id; @Column(length=20) private String username; @Column(length=20) private String password; @Temporal(TemporalType.TIMESTAMP) Date date; Date login; @ManyToOne @JoinColumn(name=roleid) private Role role; @OneToMany(mappedBy=user, cascade=CascadeType.REMOVE) private ListChatUserLoggedIn chatuserloggedin; Therefore the database was fields id, userid and chatroomid in the chatuserloggedintable. But the result in executing this query is: 11:41:27,937 OFF [standard] - openjpa-1.0.3-r420667:677674 nonfatal user error org.apache.openjpa.persistence.ArgumentException: An error occurred while parsing the query filter SELECT u FROM ChatUserLoggedIn u where u.chatroomid = null. Error message: No field named chatroomid in class class chat.entities.ChatUserLoggedIn. at org.apache.openjpa.kernel.exps.AbstractExpressionBuilder.parseException(AbstractExpressionBuilder.java:118) at org.apache.openjpa.kernel.exps.AbstractExpressionBuilder.traversePath(AbstractExpressionBuilder.java:284) at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getPath(JPQLExpressionBuilder.java:1313) at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getPathOrConstant(JPQLExpressionBuilder.java:1268) at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.eval(JPQLExpressionBuilder.java:866) at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getValue(JPQLExpressionBuilder.java:1362) at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getValue(JPQLExpressionBuilder.java:1348) at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.eval(JPQLExpressionBuilder.java:759) at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getExpression(JPQLExpressionBuilder.java:1339) at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.eval(JPQLExpressionBuilder.java:709) at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.evalWhereClause(JPQLExpressionBuilder.java:484) at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getQueryExpressions(JPQLExpressionBuilder.java:264) at org.apache.openjpa.kernel.jpql.JPQLParser.eval(JPQLParser.java:61) at org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.init(ExpressionStoreQuery.java:656) at org.apache.openjpa.kernel.ExpressionStoreQuery.newDataStoreExecutor(ExpressionStoreQuery.java:165) at org.apache.openjpa.kernel.QueryImpl.createExecutor(QueryImpl.java:728) at org.apache.openjpa.kernel.QueryImpl.compileForDataStore(QueryImpl.java:686) at org.apache.openjpa.kernel.QueryImpl.compileForExecutor(QueryImpl.java:668) at org.apache.openjpa.kernel.QueryImpl.getOperation(QueryImpl.java:1487) at org.apache.openjpa.kernel.DelegatingQuery.getOperation(DelegatingQuery.java:123) at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:227) at org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:277) at chat.entities.access.DataAccessService.getOnlineUser(DataAccessService.java:558
Re: Set Keystore Password From GShell?
I'm using 2.1.3 (Jetty), and the server rejects keystorePass as an illegal parameter or some such. I'm not sure what else I'd want to check before filing a JIRA. On Tue, Nov 18, 2008 at 11:09 AM, Donald Woods [EMAIL PROTECTED] wrote: If you are using the Tomcat assembly (I'm looking at 2.1.x), then there is a complete example of a HTTPS connector in config.xml, which includes the keystorePass attribute - gbean name=TomcatWebSSLConnector attribute name=host${ServerHostname}/attribute attribute name=port${HTTPSPort + PortOffset}/attribute attribute name=maxHttpHeaderSize8192/attribute attribute name=maxThreads150/attribute attribute name=minSpareThreads25/attribute attribute name=maxSpareThreads75/attribute attribute name=enableLookupsfalse/attribute attribute name=acceptCount100/attribute attribute name=disableUploadTimeoutfalse/attribute attribute name=clientAuthfalse/attribute attribute name=algorithmDefault/attribute attribute name=sslProtocolTLS/attribute attribute name=keystoreFilevar/security/keystores/geronimo-defau lt/attribute attribute name=keystorePasssecret/attribute attribute name=keystoreTypeJKS/attribute /gbean -Donald Doug Reeder wrote: http://cwiki.apache.org/GMOxDOC21/administering-certificates.html explains how to configure an HTTPS listener to use SSL, including setting the keystore and keystore password. However, this requires the console, which is not installed on my production server, to keep the memory footprint small. I can set the keystore used by the HTTPS listener on my production server in var/config/config.xml, but not the password. Is there a way to do this from GShell, or bash?
Re: save file physical FileUpload
Seems like a question for the MyFaces/Tomahawk community, but a quick Google search turned up the following - Article on using inputFileUpload - http://www.onjava.com/pub/a/onjava/2005/07/13/jsfupload.html?page=1 Tomahawk docs on inputFileUpload - http://myfaces.apache.org/tomahawk-project/tomahawk12/tagdoc/t_inputFileUpload.html From the article, sounds like you have no control where the file is saved on the server (goes to either memory or a temp file), as your app should use getInputStream to copy it to another location -Donald Rodrigo Baeza O wrote: Hello, Let me know if anyone can help me with this problem. I'm using Geronimo 2.1.2 with Myface and tomahawk-1.1.6, I am dealing inputFileUpload, specifically the question is where you saved the physical archives. Thanks to all -- Saludos Rodrigo Baeza O.
Re: Set Keystore Password From GShell?
Yep, the Jetty config is different. The plugins/jetty/jetty6/src/main/plan/plan.xml contains - gbean name=JettySSLConnector class=org.apache.geronimo.jetty6.connector.HTTPSSelectChannelConnector attribute name=host${PlanServerHostname}/attribute attribute name=port${PlanHTTPSPort}/attribute attribute name=headerBufferSizeBytes8192/attribute attribute name=keyStoregeronimo-default/attribute attribute name=keyAliasgeronimo/attribute attribute name=trustStoregeronimo-default/attribute attribute name=clientAuthRequiredfalse/attribute attribute name=algorithmDefault/attribute attribute name=secureProtocolTLS/attribute attribute name=maxThreads50/attribute reference name=JettyContainer nameJettyWebContainer/name /reference reference name=ThreadPool nameDefaultThreadPool/name /reference reference name=KeystoreManager nameKeystoreManager/name /reference /gbean Which means it is using the geronimo-default keystore, which is created/configured in framework/configs/server-security-config/src/main/plan/plan.xml - gbean name=geronimo-default class=org.apache.geronimo.security.keystore.FileKeystoreInstance attribute name=keystoreNamegeronimo-default/attribute attribute name=keystorePathvar/security/keystores/geronimo-default/attribute attribute name=keystorePasswordsecret/attribute attribute name=keystoreTypeJKS/attribute attribute name=keyPasswordsgeronimo=secret/attribute reference name=ServerInfonameServerInfo/name/reference /gbean So, you would have to either create a new GBean for your FileKeystoreInstance (the recommend solution) or reuse the existing one and override the passwords in config.xml. -Donald Doug Reeder wrote: I'm using 2.1.3 (Jetty), and the server rejects keystorePass as an illegal parameter or some such. I'm not sure what else I'd want to check before filing a JIRA. On Tue, Nov 18, 2008 at 11:09 AM, Donald Woods [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: If you are using the Tomcat assembly (I'm looking at 2.1.x), then there is a complete example of a HTTPS connector in config.xml, which includes the keystorePass attribute - gbean name=TomcatWebSSLConnector attribute name=host${ServerHostname}/attribute attribute name=port${HTTPSPort + PortOffset}/attribute attribute name=maxHttpHeaderSize8192/attribute attribute name=maxThreads150/attribute attribute name=minSpareThreads25/attribute attribute name=maxSpareThreads75/attribute attribute name=enableLookupsfalse/attribute attribute name=acceptCount100/attribute attribute name=disableUploadTimeoutfalse/attribute attribute name=clientAuthfalse/attribute attribute name=algorithmDefault/attribute attribute name=sslProtocolTLS/attribute attribute name=keystoreFilevar/security/keystores/geronimo-defau lt/attribute attribute name=keystorePasssecret/attribute attribute name=keystoreTypeJKS/attribute /gbean -Donald Doug Reeder wrote: http://cwiki.apache.org/GMOxDOC21/administering-certificates.html explains how to configure an HTTPS listener to use SSL, including setting the keystore and keystore password. However, this requires the console, which is not installed on my production server, to keep the memory footprint small. I can set the keystore used by the HTTPS listener on my production server in var/config/config.xml, but not the password. Is there a way to do this from GShell, or bash?
RE: JNDI Context Lookup Help
Thanks! You must have been reading my mind about just dumping the whole JNDI name space to find the proper name. Question: Why did my code work in 1.1.1 with the slash after comp:/, should it have? Just curious about it. Is there a documentation area on migrating between Geronimo versions that a note about this could be added for future reference by others? Probably another thread here, but I'll drop this in anyway: It was fairly simple to change my deployment descriptors and get my EAR to run in G 2.1.3. I had to modify my geronimo-application.xml (application-1.1 to application-2.0), and my openejb-jar.xml (openejb-jar-2.1 to openejb-jar-2.2) for the new name space definition, but my geronimo-web.xml worked without changing the the namespace from 1.1 to 1.2. I was pleasantly surprised to have my EJB 2.1 beans deploy as smoothly as they have. Once again, is there any documentation discussing this? I migrated a couple of Database Pool and Security Realm deployment plans with the project, but would have to go back and look at them to identify any differences. Also, any gotchas when combining EJB 2.1 and EJB 3.0 components in the same EAR. I plan on utilizing EJB 3.0 moving forward without migrating my existing session and entity beans from 2.1 any time soon. Hope this helps others in the future Mark Original Message Subject: Re: JNDI Context Lookup Help From: Łukasz_Budnik [EMAIL PROTECTED] Date: Tue, November 18, 2008 3:02 am To: user@geronimo.apache.org Hi Mark, I had similar problems with Geronimo 2.1. You can check out my simple method for traversing JNDI: private void traverse(Context ctx, String path) throws NamingException { // lists all contents of current context NamingEnumerationBinding ne = ctx.listBindings(); while (ne.hasMore()) { Binding b = ne.next(); String name = path + / + b.getName(); // if current object is a context, traverse it if (b.getObject() instanceof Context) { traverse((Context) b.getObject(), name); } // otherwise print out object's name and its class else { logger.debug(name + == + b.getClassName()); } } } invoke it like this: Context c = new InitialContext(); traverse(c, java:comp/env); You can read more here: http://jee-bpel-soa.blogspot.com/2008/09/traversing-jndi-directory.html hope it helps :) best regards Łukasz 2008/11/17 Mark Aufdencamp [EMAIL PROTECTED]: Hi All, It's been a while since I had to ask for help from the list, but I hit a snag migrating an application from G-1.1.1 to G-2.1.3. Specifically, I'm having a problem with a JNDI context lookup inside a ServletContextListener. I presume this is a problem with the move to a global JNDI namespace in G-1.2 and forward. I have had the same result in 1.2-beta and 2.1.3. The Documentation and Google have not helped me here. I'm looking up an env-entry defined in the web.xml: env-entry env-entry-nameweb/ContentLocation/env-entry-name env-entry-typejava.lang.String/env-entry-type env-entry-value/SomeDirectoryHeirarchyName//env-entry-value /env-entry Access code as follows: String contentLocation = null; String contentLocationJNDIName = java:/comp/env/web/ContentLocation; Context ctx = null; boolean initialContextSuccess = false; try { ctx = new InitialContext(); initialContextSuccess = true; } catch (NamingException namingException){ namingException.printStackTrace(); } if(initialContextSuccess){ try{ contentLocation = (String) ctx.lookup(contentLocationJNDIName); } catch(NamingException namingException){ namingException.printStackTrace(); } } else{ // Error Handling } The ctx.lookup() throws a javax.naming.NotContextException: comp/env/web/ContentLocation. Do I need to define Properties for the InitialContext Factory, add something to my geronimo-web.xml plan, or utilize a different JNDI name? Thanks for your help, Mark Aufdencamp [EMAIL PROTECTED]
Re: EJB unit testing JPA projects
On Nov 17, 2008, at 7:24 AM, ericp56 wrote: Hi All, OpenEJB unit testing works great. Thanks! However, I am now trying to unit test a JPA EJB and get the following error: Apache OpenEJB 3.0build: 20080408-04:13 http://openejb.apache.org/ INFO - openejb.home = C:\eclipseRC3\workspace\ScrapEjb INFO - openejb.base = C:\eclipseRC3\workspace\ScrapEjb INFO - Configuring Service(id=Default Security Service, type=SecurityService, provider-id=Default Security Service) INFO - Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager) INFO - Configuring Service(id=SchedulerDB2, type=Resource, provider-id=Default JDBC Database) INFO - Configuring Service(id=SchedulerDB, type=Resource, provider-id=Default JDBC Database) INFO - Configuring Service(id=Default JDK 1.3 ProxyFactory, type=ProxyFactory, provider-id=Default JDK 1.3 ProxyFactory) INFO - Found EjbModule in classpath: C:\eclipseRC3\workspace\ScrapEjb\build\classes INFO - Configuring app: C:\eclipseRC3\workspace\ScrapEjb\build\classes INFO - Configuring Service(id=Default Stateless Container, type=Container, provider-id=Default Stateless Container) INFO - Auto-creating a container for bean ScrapClass: Container(type=STATELESS, id=Default Stateless Container) INFO - Auto-linking resource-ref 'SchedulerDB2' in bean ScrapClass to Resource(id=SchedulerDB2) INFO - Auto-linking resource-ref 'SchedulerDB' in bean ScrapClass to Resource(id=SchedulerDB) INFO - Configuring PersistenceUnit(name=ScrapEjb) INFO - Loaded Module: C:\eclipseRC3\workspace\ScrapEjb\build\classes ERROR - FATAL ERROR: Unknown error in Assembler. Please send the following stack trace and this message to [EMAIL PROTECTED] : org.apache.xbean.recipe.ConstructionException: Error invoking factory method: public static javax.sql.DataSource org .apache .openejb.resource.jdbc.DataSourceFactory.create(boolean,boolean) ... Caused by: java.lang.NoClassDefFoundError: org/apache/commons/dbcp/managed/BasicManagedDataSource ... OpenEjb-core.3.0.jar is included in the classpath, so the BasicManagedDataSource is available. That class is not located in the openejb-core-3.0.jar. I'd download the zip and include all the jars from the lib/ directory in your eclipse test classpath: http://www.apache.org/dist/openejb/3.1/openejb-3.1.zip That's the latest release. The 3.0 release is great, but the 3.1 release has more bells and whistles for unit testing along with better diagnostic messages. -David
Re: Configuring log4j as jvm environment variable fails
Sure looks like we need more docs in that area. I will add the docs. Probably will cover log4j and JUL Regards Manu On Tue, Nov 18, 2008 at 11:36 PM, Donald Woods [EMAIL PROTECTED] wrote: Manu, I opened GERONIMO-4418 to reference this as a possible Sample we could create for 2.2. -Donald Manu George wrote: Hi Hearty, My understanding was that we just needed to hide the log4j and slf4j classes to use logging However a quick search came up with this http://webui.sourcelabs.com/geronimo/mail/user/threads/Logging_in_Geronimo_2.0.1.meta It lists the same problem and a solution In case of wanting to use a properties file, You can configure log4j for you app as follows 1) Write a gbean that will initialize log4j eg: package test import java.io.IOException; import java.io.InputStream; import java.util.Properties; import org.apache.geronimo.gbean.GBeanInfo; import org.apache.geronimo.gbean.GBeanInfoBuilder; import org.apache.geronimo.gbean.GBeanLifecycle; import org.apache.log4j.PropertyConfigurator; public class Log4JInitGBean { public Log4JInitGBean(String log4jResource, ClassLoader classloader) throws IOException { InputStream in; if (log4jResource != null) { in = classloader.getResourceAsStream(log4jResource); if (in == null) { throw new NullPointerException( No log4j properties resource found at + log4jResource); } } else { return; } Properties props = new Properties(); try { props.load(in); } finally { in.close(); } PropertyConfigurator.configure(props); } public static final GBeanInfo GBEAN_INFO; static { GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic( Log4JInitGBean.class); infoBuilder.setPriority(2); infoBuilder.addAttribute(log4jResource, String.class, true); infoBuilder.addAttribute(classLoader, ClassLoader.class, false); infoBuilder.setConstructor(new String[] { log4jResource, classLoader }); GBEAN_INFO = infoBuilder.getBeanInfo(); } public static GBeanInfo getGBeanInfo() { return GBEAN_INFO; } } Define this gbean in your plan via this entry gbean name=Log4jConfiguration class=test.Log4JInitGBean attribute name=log4jResourcefp-log4j.properties/attribute /gbean This will initialize ur log4j. Now since you are using slf4j as a wrapper over log4j. You can hide the two projects that may already be loaded in the parent classloaders via sys:hidden-classes sys:filterorg.apache.log4j/sys:filter sys:filterorg.slf4j/sys:filter /sys:hidden-classes Remember to package your own copies or add dependencies in your plan for the slf4j and log4j jars This should have your logging working. 2) Another way is to use the ApplicationLog4jConfigurationGBean though I was not able to get it to work as expected 3) I was not getting log4j to initialize with the configuration I specified without using the gbean above I need to investigate more into 2 and 3. Regards Manu P.S In your log4j.properties you can give the file path as log4j.appender.FILE.file=${org.apache.geronimo.server.dir}/var/log/test.log where org.apache.geronimo.server.dir is a system property On Fri, Nov 7, 2008 at 4:10 PM, Hearty [EMAIL PROTECTED] wrote: I have tried the below 2 options of setting my fp-log4j.properties. Both these options fails. I am not able to see log files created. SET JAVA_OPTS=-Dlog4j.configuration=C:\WebSphere\AppServerCommunityEdition\var\log\fp-log4j.properties SET JAVA_OPTS=-Dorg.apache.geronimo.log4jservice.configuration=C:\WebSphere\AppServerCommunityEdition\var\log\fp-log4j.properties These envionment variable I've specified from a command prompt and I've run start-server command from the same instance. My fp-log4j.properties is as follows #attach an appender to the base apacheds package logger: log4j.logger.org.apache.directory=INFO,fp #do not log apacheds to geronimo logs: log4j.additivity.org.apache.directory=false #Configure the fp specific appender: log4j.appender.fp=org.apache.log4j.DailyRollingFileAppender log4j.appender.fp.layout=org.apache.log4j.PatternLayout # geronimo style logging log4j.appender.fp.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c{1}] %m%n log4j.appender.fp.append=true log4j.appender.fp.file=${org.apache.geronimo.server.dir}/var/log/fp.log log4j.appender.fp.bufferedIO=false
Re: status from shell script (System V starup)
Thanks for the suggestion -- I didn't want to have to modify the start script to save the PID. Here's what I've come up with -- it's not polished, but does what you need a System V startup script to do: #! /bin/sh ### BEGIN INIT INFO # Provides: geronimo # Required-Start:$local_fs $remote_fs # Required-Stop: $local_fs $remote_fs # Default-Start: 2 3 4 5 # Default-Stop: S 0 1 6 # Short-Description: Apache Geronimo application server # Description: Apache Geronimo startup script ### END INIT INFO set -e PATH=/sbin:/bin:/usr/sbin:/usr/bin #DESC=Apache Geronimo NAME=geronimo USER=gdaemon JAVA_HOME=/usr/java/jdk GERONIMO_HOME=/usr/local/geronimo DAEMON=$GERONIMO_HOME/bin/geronimo.sh SCRIPTNAME=/etc/init.d/$NAME GERONIMO_ADMIN=gadmin GERONIMO_PASSWORD=xx # JAVA_HOME must be set export JAVA_HOME # Gracefully exit if the package has been removed. test -x $DAEMON || exit 0 # # Function that starts the daemon/service. # d_start() { su -c $DAEMON start $USER } # # Function that stops the daemon/service. # d_stop() { su -c $DAEMON stop --user $GERONIMO_ADMIN --password $GERONIMO_PASSWORD $USER } # #Function that gets status # d_status() { ps_log=`mktemp /var/tmp/geronimo-ps$$.log` ps auxww $ps_log if grep -Dorg.apache.geronimo.base.dir=.*server.jar $ps_log /dev/null 2/dev/null; then echo $NAME is running else echo $NAME is not running fi rm -f $ps_log } case $1 in start) echo -n Starting $NAME d_start echo . ;; stop) echo Stopping $NAME d_stop echo . ;; restart) # # If the reload option is implemented, move the force-reload # option to the reload entry above. If not, force- reload is # just the same as restart. # echo Restarting $NAME d_stop # One second might not be time enough for a daemon to stop, # if this happens, d_start will fail (and dpkg will break if # the package is being upgraded). Change the timeout if needed # be, or change d_stop to have start-stop-daemon use --retry. # Notice that using --retry slows down the shutdown process somewhat. sleep 10 d_start echo . ;; status) d_status echo . ;; *) echo Usage: $SCRIPTNAME {start|stop|restart|status} 2 exit 3 ;; esac exit 0 smime.p7s Description: S/MIME cryptographic signature