what is domain location of weblogic application server? - weblogic-10.x

I am new to weblogic.I am trying to configure liferay with weblogic.
I want to put liferay dependency jar files inside lib folder of domain.
Now i am confused because in Oracle>Middleware>user_projects>domains there are two folders that contains lib folder.
1)base_domain
2)my_domain.
Can someone let me know where should i put all dependency jar files?

First of all, make sure which domain you are using. base_domain and my_domain are not the ones shipped with weblogic. They are the ones created for app deployment.
Please check where your application is deployed and then place your jar in that domain.

Related

cannot find service.jar file custom portlet liferay

I am using liferay 6.2 & built a maven portlet and working fine, I want to use its tables to store data for another portlet so that I need its services in this portlet.
But we can't access it externally so i find a way something like: required-deployment-contexts=Portlet-Project1 inside liferay-plugin-package.properties, then found its works for Ant only.
I was also finding the xxx-portlet-service.jar but didn't able to, so that i could manually put it in other portlet's lib folder i.e inside tomcat-webapps-xxxportlet-WEB-INF.
Just want to find how to use xxxLocalService.util in other in maven portlet
The best approach you can implement is a plugin to manage all the interaction with the DB.
First of all you must create a Service with a maven project and include it into your pom.xml in each portlet that you need. Then you can invoke its methods whenever you want because each portlet will store the dependencies.
Create Service Plugin into jar file
Rebuild with mvn clean liferay:build-service
Custom your own methods to manage the iteraction with the DB (LocalServiceUtilImpl and rebuild).
Include this plugin into pom.xml portlets
Rebuild your portlet.
The JAR will be placed in your .m2 folder, then each time that you rebuild your Service Plugin will be updated.
If i understood your question correctly, You need to create service builder project using maven and then you can add as dependency in other project wherever you need access to use xxxLocalServicutil class.
You can follow below link to create maven service builder project.
http://www.liferay-guru.com/how-to-use-liferay-servicebuilder-archetype/
As you mentioned in your question.
was also finding the xxx-portlet-service.jar but didn't able to, so
that i could manually put it in other portlet's lib folder
To answer this, manually putting .jar file in lib directory will not help when you are working with maven project

Deploy multiple war files under the same root path on tomcat

I'm trying to deploy multiple spring war files with tomcat maven plugin each with a shared root path between them.
For example when I deploy now each app can be accessed by:
localhost:8080/app1
localhost:8080/app2
The desired paths would be:
localhost:8080/apps/app1
localhost:8080/apps/app2
Is this possible to do with multiple war files? I would like to keep this app decoupled from tomcat as much as possible as well so please take this into consideration as well.
You can add /apps to each application's context path.

Spring Rest Controllers: deployment to Tomcat

I want to develop a RESTful API within my multi-module Spring-based project using Spring Rest. For that purpose, I have a webapp module and some other business/data layer modules. For example, this would be my simplified project structure:
myProject
-- webapp (war-packaged)
-- business (jar-packaged)
-- data (jar-packaged)
Business module depends on data module and so does webapp on business module. Webapp imports successfully every module's application context. Now I want to be able to use some business module classes that do some kind of calculation according to some data retrieved from a DB in order to provide a certain resource. All examples I had a look at were quite simple and this multi-module approach was not covered at all.
What is the problem? As far as I am concerned, Tomcat loads classes in a certain order. Concretely, it first loads WEB-INF/classes and only then WEB-INF/lib (where all webapp dependencies are placed, business module in this case). So, there goes my question. Where should I place my Controller classes? If I place them within the webapp module I won't be able to autowire any business-module bean since Tomcat will throw a ClassNotFoundException when I deploy the webapp war (at least this is the behaviour I have experienced).
The answer is probably easy but I'm quite new to Spring and its world!
Thank you all in advance.
Your business and data jars would go into the WEB-INF/lib directory. Then those jars will automatically be added to the CLASSPATH for your app when you deploy it. You will need to deploy your application as a WAR file.
Ideally, you would build the business and data jars, add them to some repository, and then the build system would pull the proper version of each jar into the WEB-INF/lib directory for you.
And as to the original question, the controller classes go into the webapp/src directory.
Assuming you are using Maven 2. Make sure your assembly creator (e.g. maven war module) is including your dependent .jar files within the final .war file's WEB-INF/lib directory. This should be the default procedure (per: http://maven.apache.org/plugins/maven-war-plugin/war-mojo.html#dependentWarIncludes ). The other concern, then is whether your sub-projects (business and data) are even creating jars so that they could be included in the WAR output.
If you have doubts as to the contents of that war file, browse the listing of it by executing
'jar tvf $WAR_FILENAME' from the command line and by observing the WEB-INF/lib directory contents. You should see your business and data jars in there. Go further by exploding your war file, then browsing the contents of business and data jar (using 'jar xvf $FILENAME' to explode in a new directory).
Hope this helps!

xmlaccess deploy portlet with library reference

I have problem with deploying JSR168 portlet using xmlaccess. I have no problem with deploy and join to conrete page but I would like to add shared library reference automatically. Is it possible?? I added shared library named 'libshared' using IBM WS console. Can I add this reference in input xml using by xmlaccess?
I don't think you can do this in xmlaccess. But you may try putting a reference to the library under the Manifest.MF file of the META-INF directory of your portlet's war file.
Or could just put the shared jar file under your /shared/ext directory. Or you could put it inside your wps.ear file. Mind you, either of these two solutions would share your library with the entire portal installation, rather than just select portlets.
You can deploy the application using wsadmin or similar and use that to update the classpath (i.e. for the shared library), you can then use xmlaccess to deploy the portlets and reference the previously deployed application - although I think this may only work in WebSphere Portal 6.1.
Give me a shout if you need further details.
I encountered this as well, a while ago... and researched it to the max, including spending some time chatting with IBM's support in various levels.
The XMLAccess protocol doesn't provide for such "system-level" configuration alongside Portlet application deployment; it can only be used to install, customize and uninstall Portlet applications and related artifacts.
If your deployment strategy involves deploying WAR files directly through XMLAccess, then you will have to manually add the shared-library to the application through the WAS admin console; this will have to be done manually because, when deploying WAR files through XMLAccess, an EAR with some random name is being created by WebSphere Portal to "host" your WAR file; hence you can't script the attachment of a shared library.
(alternatively, you may wish to add the shared library to the server's (WebSphere_Portal) classpath)
If your deployment strategy, instead, involves deploying Portlet applications packaged as EARs, then you're in a better position; you could automate the shared-library attachment as part of your EAR deployment process, then use XMLAccess to inform WebSphere Portal about the location, in the EAR, of your Portlet applications (which is what Michael mentioned above; it works in WebSphere Portal 6.0 as well).
Good luck.

Websphere 6.1 server

I have an issue in loading jars in websphere server. Some of the jars are present in WEB-INF/lib and some are present in local hard drive(ex., c:\lib folder). How can i load all these jars, during the startup of the application. If WEB-INF jars are loaded, external jars are not getting loading and viceversa..Need help on this....
WebSphere has a hierarchy of classloaders, parent classloaders cannot see child classloaders, hence you get surprises when you put different aspects of your application in different places.
Never attempt to place application jars in WebSphere's own lib directory, and never adjust WebSphere's own class path. There is ana rchitected way to make external jars visible, I'll explain that in a moment.
There are three places that you can put JAR files so that they will be loaded. By far the the best is simply to place the JARs in WEB-INF/lib. You can specify the search order preference PARENT LAST so that these take prececdence over jars supplied by websphere - but note that some fundamental jars cannot be over-ridden You cannot replace the IBM security for example.
Second you can add jars to the root of the EAR file. Noe that the hierarchy comes into play now, WEB-INF/lib jars can see EAR jars but EAR jars cannot see WEB-INF/lib jars.
Finally you can specify a WebSphere "Shared Libarary". See the Info Centre for how, it's very easy through the console. A shared library has a classpath, you add jars to that. Then you allocate the shared libarary to individual applicaitons or whole servers.
Once again You WEB app can see the shared library, but i don't beleive taht the convers is true. Hence putting framework code in a shread library may not work for you.

Resources