[JBoss Portal] - Re: org.jboss.portal.portlet.container.PortletInitialization
by klsateesh
Hi,
Thanks for your reply..
Here is the my sample portlet..
|
| package com.lmco.dpa;
|
| // Import Statements go here..
|
| public class AssessSamplePortlet extends GenericPortlet{
|
| /** Creates a new instance of AssessSamplePortlet */
| public AssessSamplePortlet() {
|
| }
|
| protected void doView(RenderRequest rRequest, RenderResponse rResponse) throws PortletException, IOException, UnavailableException {
| rResponse.setContentType("text/html");
| PrintWriter writer = rResponse.getWriter();
| writer.write("Assessment Sample Portlet!");
| writer.close();
| }
|
| }
|
|
portlet-instances.xml:
| <?xml version="1.0" standalone="yes"?>
| <deployments>
| <deployment>
| <instance>
| <instance-id>AssessSamplePortletInstance</instance-id>
| <portlet-ref>AssessSamplePortlet</portlet-ref>
| </instance>
| </deployment>
| </deployments>
|
portlet.xml:
| <portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
| version="1.0">
| <portlet>
| <portlet-name>AssessSamplePortlet</portlet-name>
| <portlet-class>com.lmco.dpa.AssessSamplePortlet</portlet-class>
| <supports>
| <mime-type>text/html</mime-type>
| <portlet-mode>VIEW</portlet-mode>
| </supports>
| <portlet-info>
| <title>AssessSample Portlet</title>
| </portlet-info>
| </portlet>
| </portlet-app>
|
jbossportlet-object.xml:
|
| <?xml version="1.0" encoding="UTF-8"?>
| <deployments>
| <deployment>
| <if-exists>overwrite</if-exists>
| <parent-ref>default.default</parent-ref>
| <window>
| <window-name>AssessSamplePortletWindow</window-name>
| <instance-ref>AssessSamplePortletInstance</instance-ref>
| <region>center</region>
| <height>1</height>
| </window>
| </deployment>
| </deployments>
|
|
And i have an Empty web.xml
My Web Application name is jbossportal . Is there a naming convention for xxx-object.xml file ?
Thanks
Sateesh
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3965732#3965732
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3965732
19 years, 8 months
[Persistence, JBoss/CMP, Hibernate, Database] - "Could not configure entity resolver" Problem
by s4shif
hi,
I am using hibernate 3 with Eclipse 3.1.
on "Hibernate Configuration" tab, when I am trying to "Create SessionFactory", I get the following exception with the heading "Exception while connecting/starting Hibernate":
| org.hibernate.console.HibernateConsoleRuntimeException: Could not configure entity resolver tyn.cm.hibernate.Member
| org.hibernate.console.HibernateConsoleRuntimeException: Could not configure entity resolver tyn.cm.hibernate.Member
| java.lang.ClassNotFoundException: tyn.cm.hibernate.Member
|
The class Member is in its package and generated by the hibernate tool, "tyn.cm.hibernate.Member".
Follwing is my "hibernate.cfg.xml" file:
| <?xml version="1.0" encoding="UTF-8"?>
| <!DOCTYPE hibernate-configuration PUBLIC
| "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
| "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
| <hibernate-configuration>
| <session-factory name="memberSessionFactory">
| <property name="hibernate.connection.driver_class">com.microsoft.jdbc.sqlserver.SQLServerDriver</property>
| <property name="hibernate.connection.password">tyn</property>
| <property name="hibernate.connection.url">jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=YellowNumber;SelectMethod=cursor</property>
| <property name="hibernate.connection.username">tyn</property>
| <property name="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</property>
| <property name="hibernate.session_factory_name">java:org/hibernate/SessionFactory</property>
| <!-- mapping files (outer) -->
| <!-- mapping resource="src/WEB-INF/Member.hbm.xml" /> -->
| </session-factory>
| </hibernate-configuration>
I map the
resourse xml file (tyn/src/Member.hbm.xml) and
Entity Resolver (tyn.cm.hibernate.Member)
through console configuration.
"Member.hbm.xml" is as follows:
<?xml version="1.0"?>
| <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
| "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
| <!-- Generated Aug 16, 2006 5:41:58 PM by Hibernate Tools 3.1.0.beta5 -->
| <hibernate-mapping auto-import="true">
| <class name="tyn.cm.hibernate.Member" table="Member" schema="dbo" catalog="YellowNumber">
| <id name="memberId" type="int">
| <column name="MemberID" />
| <generator class="assigned" />
| </id>
| <property name="memberName" type="string">
| <column name="MemberName" length="20" />
| </property>
| <property name="password" type="string">
| <column name="Password" length="10" />
| </property>
| </class>
| </hibernate-mapping>
Please review my code and configuration, and guide me what is wrong with it.
Please also suggest what should be the correct path to put *.hbm.xml files.
Thanks in advance
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3965730#3965730
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3965730
19 years, 8 months
[JBossWS] - Programmatic service deployment, again!
by Doug.Palmer
Hi
I'm still trying to add aliases for a web service at runtime. I have managed to persuade JBossWS to deploy my service endpoint but my service doesn't get registered with tomcat and requests to the context root return a 404 error. I guess I have missed a step in the deployment; can anyone tell me what I am missing? Here is the code I have so far:
| String targetNS = "http://services/jaws";
| String serviceName = "aService";
| String portName = "aServicePort";
| String operationName = "anOperation";
|
| String javaClassName = this.getClass().getName();
| String javaMethodName = "method";
| String contextRoot = "contextRoot";
| String endpoint = "http://localhost:8080/"+contextRoot+"/"+serviceName;
|
| UnifiedDeploymentInfo udi = new JSR181Deployment(UnifiedDeploymentInfo.Type.JSR181_JSE);
| URLClassLoader ctxLoader = (URLClassLoader)Thread.currentThread().getContextClassLoader();
| udi.localCl = ctxLoader;
| udi.ucl = ctxLoader.getParent();
| udi.annotationsCl = ctxLoader.getParent();
|
| UnifiedMetaData wsMetaData = new UnifiedMetaData();
| wsMetaData.setClassLoader(udi.ucl);
| ServiceMetaData serviceMetaData = new ServiceMetaData(wsMetaData, new QName(targetNS, serviceName));
| wsMetaData.addService(serviceMetaData);
|
| ServerEndpointMetaData sepMetaData = new ServerEndpointMetaData(serviceMetaData, new QName(targetNS, portName));
| sepMetaData.setServiceEndpointImplName(javaClassName);
| sepMetaData.setStyle(Style.RPC);
| sepMetaData.setEncodingStyle(Use.LITERAL);
| sepMetaData.setParameterStyle(ParameterStyle.BARE);
| sepMetaData.setServiceEndpointID(ObjectNameFactory.create("jboss.ws:context="+contextRoot+",endpoint="+serviceName));
| sepMetaData.setEndpointAddress(endpoint);
| sepMetaData.setContextRoot(contextRoot);
| serviceMetaData.addEndpoint(sepMetaData);
|
| OperationMetaData opMetaData = new OperationMetaData(sepMetaData, new QName(targetNS, operationName), javaMethodName);
| opMetaData.setOneWayOperation(false);
| sepMetaData.addOperation(opMetaData);
|
| ServiceEndpointInfo seInfo = new ServiceEndpointInfo(udi, sepMetaData);
| ServiceEndpointManagerFactory semFactory = ServiceEndpointManagerFactory.getInstance();
| ServiceEndpointManager epManager = semFactory.getServiceEndpointManager();
| epManager.createServiceEndpoint(seInfo);
|
| ObjectName sepID = sepMetaData.getServiceEndpointID();
| epManager.startServiceEndpoint(sepID);
|
Thanks in advance
Doug
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3965728#3965728
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3965728
19 years, 8 months