If I have Liferay 7.2 Community Edition and want to use Oracle 12c as an external database for my business data then what would be the simplest and best way to connect using JNDI? Can I create DataSource in Tomcat and use JNDI lookup to connect with Liferay Service Builder?
How to connect Liferay 7.2 CE with Oracle database using JNDI
1.7k Views Asked by Joy At
1
There are 1 best solutions below
Related Questions in JAVA
- I need the BIRT.war that is compatible with Java 17 and Tomcat 10
- Creating global Class holder
- No method found for class java.lang.String in Kafka
- Issue edit a jtable with a pictures
- getting error when trying to launch kotlin jar file that use supabase "java.lang.NoClassDefFoundError"
- Does the && (logical AND) operator have a higher precedence than || (logical OR) operator in Java?
- Mixed color rendering in a JTable
- HTTPS configuration in Spring Boot, server returning timeout
- How to use Layout to create textfields which dont increase in size?
- Function for making the code wait in javafx
- How to create beans of the same class for multiple template parameters in Spring
- How could you print a specific String from an array with the values of an array from a double array on the same line, using iteration to print all?
- org.telegram.telegrambots.meta.exceptions.TelegramApiException: Bot token and username can't be empty
- Accessing Secret Variables in Classic Pipelines through Java app in Azure DevOps
- Postgres && statement Error in Mybatis Mapper?
Related Questions in ORACLE12C
- How to use CONNECT BY in Oracle with columns that contain strings with forward slashes
- Yii2 - Oracle performance issue when getting one row by a unique field
- Pivot statement randomly produces NULL valued columns (Oracle 12c)
- Validate datatype stored in VARCHAR2 column
- No data source definition was found for data source name: 'StorePrimary'. Oracle Retail Xstore POS Dev Setup
- Oracle catch exception code given at runtime
- Oracle's SDO_NET.FIND_CONNECTED_COMPONENTS fails with 'wrong number or types of arguments in call'
- Clone schema within same database
- Oracle PL_SQL set execution timeout
- Error while exchanging partition in Oracle ORA-14097: column type or size mismatch in ALTER TABLE EXCHANGE PARTITION
- Oracle impdb command throws ORA-12154 error, but sqlplus and sql developer are working properly
- Oracle xQuery merge two xml matching nodes
- Oracle 12c impdp ORA-12154: TNS:could not resolve the connect identifier specified
- Get new password from OraOLEDB Password Change Dialog
- Fetch/Update the amount value from previous record based on date
Related Questions in JNDI
- Jndi connect to LDAP by GssApi KrbException: Server not found in Kerberos database (7)
- javax.naming.NoInitialContextException: IDE Issue
- Cannot create JDBC driver of class '' for connect URL 'null' java.sql.SQLException: No suitable driver
- javax.naming.Exception: Could not create resource instance
- java.lang.NoClassDefFoundError: com/sun/jndi/toolkit/chars/CharacterEncoder
- In Spring, is it possible to use @Value to inject a String JNDI value from java:global?
- Direct LDAP User Authentication for API Access without Separate Bind User
- How to fix Ldap error after Java 17 upgrade
- JBoss 7.4 ActiveMQ Artemis Queue Can't binding to a specific JNDI name
- Module path problem when looking for a remote EJB in JNDI
- How to create jndi datasource in spring boot application
- WFLYJCA0041: Failed to load module for driver [com.oracle]
- Connecting to LDAPS from Java in multitenancy
- Error invoking methods on EJB in WebLogic 12c: AOP configuration issue
- Unable to access Wildfly remoting service for JNDI after switching to HTTPS
Related Questions in LIFERAY-SERVICE-BUILDER
- Should general entity classes be put under service or api module in Liferay 7.4?
- shopping-api module classes not found in shopping-web
- Liferay 7.4.3.61 - Blob type column in service builder
- Liferay service-builder fails to generate good code
- Service Builder: custom query using inner join across the same table
- error liferay: mvc portlet don't connect to the service builder , java.lang.NullPointerException
- liferay 7.2 service-builder error.NoClassDefFoundError: com/liferay/portal/kernel/dao/orm/ArgumentsResolver when deploying the service
- Liferay 7.2 No value has been specified for property 'apiDir'
- Liferay Service Builder - is there a recommended way to describe a self reference relation in service.xml?
- How to connect Liferay 7.2 CE with Oracle database using JNDI
- The type com.liferay.petra.sql.dsl.query.DSLQuery cannot be resolved. It is indirectly referenced from required .class files
- Launching appium server programmatically throws server-side error Could not find 'adb' in PATH
- How to create Rest API with Jax-rs Backend in Liferay Dev Studio?
- Liferay Service Builder and portlet instance specific data
- Unit tests for a Liferay service
Related Questions in LIFERAY-7.2
- <aui:button> not working after deploying project into AWS
- how to change data type range in liferay
- Blank data comming in controller layer
- In liferay project While fetching html form values getting null result
- How to access a text file in root directory from a browser in Liferay 7.2?
- Use Liferay 7.2 Elastisearch Custom Filter to exclude all Web Content Articles with specific tag
- Add pannel in Liferay 7.2 doesnt show the basic web content
- Liferay Elastic Search Query: Search for DLFileEntries that have a Custom Document Type
- Which version of log4j is used in Liferay 7.2
- How to use slf4j logger instead of builtin Liferay DXP 7.2 logger in mvc-portlet?
- Liferay 7.2 - use journalarticle class in custom jsp hook
- Liferay 7.3 java.lang.NullPointerException after porting from 7.2
- Programmatically get list of Portlets deployed in Liferay 7.2
- How to refresh a portlet on a page where there is more portlets? (liferay-7.2)
- Errors when adapting an Angular application in Liferay
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Here is a simple way I have identified and using:
Step (1): Define/Map Entities into service.xml based on existing external databases. If tables are not present create all tables and fields manually because Liferay Service builder will not generate SQL code to automatically create tables in external database. If you want to use namespace, map manually below entities and define the same in database as well.
Service.xml
Step (2): Put following in LIFERAY-HOME\tomcat-9.0.17\conf\server.xml under
Step (3): Put following in LIFERAY-HOME\tomcat-9.0.17\conf\context.xml under Context
Step (4): To connect with Oracle or any proprietary database following 2 JARs are needed:
from Maven repository
https://mvnrepository.com/artifact/it.dontesta.labs.liferay.portal.db/liferay-portal-database-all-in-one-support/1.2.1
Download the JAR liferay-portal-database-all-in-one-support-1.2.1.jar and put under LIFERAY-HOME\tomcat-9.0.17\webapps\ROOT\WEB-INF\lib
Step (5): Define followings into portal-ext.properties
Step (6): Create a DataSourceProviderImpl class under *-service:
Step (7): Register above implementation with JDK SPI (Service Provider Interface). To do this, create following folder/file under *-service
Put following line under this file:
All done. Just build the service, do Gradle refresh and start the server. This will work perfectly.
Happy Learning!