Foros de discusión

Ext Environment Compile Issue

Alex Belt, modificado hace 10 años.

Ext Environment Compile Issue

Junior Member Mensajes: 49 Fecha de incorporación: 9/10/12 Mensajes recientes
Hi All,

I'm having a database related issue when I build the EXT Environment. I've created a web service in the EXT Environment in Lilferay 5.2.3. When I compile and deploy Liferay without the EXT Environment, it works fine. As soon as I compile and deploy the EXT Environment, with or without the main Liferay code, it changes my database configuration from using SQLServer back to HSQL. The end result is, when I attempt to start Liferay after deploying the EXT Environment build, I get a massive stack trace on the screen because it's trying to update a non-existent HSQL database instead of looking at the SQL Server database it's supposed to.

The database connection information resides in Tomcat's server.xml as Resource tags, and the database connections are directly injected into DAO objects using Spring config files.

Has anyone encountered an issue like this before? Any ideas on how to solve it?

Thanks,
Alex
James Harrison Schueler, modificado hace 10 años.

RE: Ext Environment Compile Issue

Alex Belt, modificado hace 10 años.

RE: Ext Environment Compile Issue

Junior Member Mensajes: 49 Fecha de incorporación: 9/10/12 Mensajes recientes
Hi James,

No, the database information is not contained in portal-ext.properties. The only database config data is contained in the portal.properties, and it's the default HSQL config. It doesn't make sense to me though, that I can build and deploy Liferay and it finds the SQL Server configuration fine, but as soon as I add in the EXT Environment, it reverts to HSQL.

Thanks.

Update: I put some configuration data in the portal-ext.properties file, that stopped the HSQL errors, but it still doesn't run. Examining the Tomcat logs produces this:
...
SEVERE: Error listenerStart
Apr 24, 2013 org.apache.catalina.core.StandardContext start
SEVERE: Context [] startup failed due to previous errors
Apr 24, 2013 org.apache.catalina.startup.ContextConfig stop
FINE: ContextConfig: Processing STOP
Apr 24, 2013 3:01:10 PM org.apache.catalina.startup.ContextConfig init
FINE: ContextConfig: Initializing
...
Apr 24, 2013 org.apache.catalina.loader.WebappClassLoader loadClass
INFO: Illegal access: this web application instance has been stopped already. Could not load javax.servlet.Servlet. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1273)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
at org.apache.catalina.loader.WebappClassLoader.validateJarFile(WebappClassLoader.java:2294)
at org.apache.catalina.loader.WebappClassLoader.addJar(WebappClassLoader.java:682)
at org.apache.catalina.loader.WebappLoader.setRepositories(WebappLoader.java:1010)
at org.apache.catalina.loader.WebappLoader.start(WebappLoader.java:650)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4212)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:926)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:889)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)


Any ideas?
thumbnail
Manish Yadav, modificado hace 10 años.

RE: Ext Environment Compile Issue

Expert Mensajes: 493 Fecha de incorporación: 26/05/12 Mensajes recientes
Hello Alex Belt,

Might be you are missing to update porta-ext.properties present in <EXT>\docroot\WEB-INF\ext-impl\src\portal-ext.properties.Because when you deploy ext then portal-ext.properties will always override present in <liferay>/tomcat/webapps/ROOT/WEB-INF/classes/portal-ext.properties.

So before deploying EXT ensure that,both files should have same values porat-ext.properties in EXT and server

Thanks & Regards
Manish Yadav
James Harrison Schueler, modificado hace 10 años.

RE: Ext Environment Compile Issue

Alex Belt, modificado hace 10 años.

RE: Ext Environment Compile Issue

Junior Member Mensajes: 49 Fecha de incorporación: 9/10/12 Mensajes recientes
I did that, but it still won't work. It refuses to load Liferay, and to make matters worse, I only get the stack trace as I indicated in my previous post - there is no indication what might be wrong, only that it failed to start and won't run.
thumbnail
Manish Yadav, modificado hace 10 años.

RE: Ext Environment Compile Issue

Expert Mensajes: 493 Fecha de incorporación: 26/05/12 Mensajes recientes
Please follow below steps
1 keep your db setting properties in only portal-ext.properties. [<LIFERY_HOME>/tomcat/webapps/ROOT/WEB-INF/classes/portal-ext.properties].and no where else
2. copy same file portal-ext.properties in your ext ->impl->src->portal-ext.properties

Hope this will help you
Alex Belt, modificado hace 10 años.

RE: Ext Environment Compile Issue

Junior Member Mensajes: 49 Fecha de incorporación: 9/10/12 Mensajes recientes
I can appreciate that I should do that, but I don't think I can. I'm working on an already existing site where the database connections are being injected to DAOs using Spring JDBC. Plus, there are multiple database connections, not just one, and it doesn't appear that the db properties allow for more than one connection. If I move all the database connection information to portal-ext.properties, I would have to do some significant re-writing of our existing application, which is not acceptable. Thanks anyway.
Alex Belt, modificado hace 10 años.

RE: Ext Environment Compile Issue

Junior Member Mensajes: 49 Fecha de incorporación: 9/10/12 Mensajes recientes
I finally managed to get a stack trace - there's a Spring related error in the EXT Environment. When it goes to start up, it tries to instantiate the data sources into the generated service impl classes, but it can't. I'm trying to figure out why it won't.

Has anyone else run into this?
thumbnail
Gaurang Sheladia, modificado hace 10 años.

RE: Ext Environment Compile Issue

Regular Member Mensajes: 159 Fecha de incorporación: 15/02/09 Mensajes recientes
Hi Alex,

Are you getting spring error like bean reference or something else can you please post your error?

Thanks
Alex Belt, modificado hace 10 años.

RE: Ext Environment Compile Issue

Junior Member Mensajes: 49 Fecha de incorporación: 9/10/12 Mensajes recientes
Actually, I have finally solved the problem. It turns out that the ext-spring.xml file was not getting configured with the JNDI database information, so it couldn't inject the database connections into the Spring beans. Once I put the jndi info into the file and deployed it, it worked like a charm.